:root {
  color: #1a1c19;
  background: #f1f0eb;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  font-synthesis: none;
  --ink: #1a1c19;
  --muted: #6f716b;
  --line: #deddd7;
  --paper: #fff;
  --green-950: #1a281f;
  --green-800: #2e4334;
  --green-600: #58715c;
  --green-100: #e8eee8;
  --orange: #e46e35;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f1f0eb; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 232px; padding: 31px 20px 22px; color: #f8f8f4;
  background: var(--green-950); display: flex; flex-direction: column; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; padding: 0 9px 31px; }
.brand__mark { width: 35px; height: 35px; display: flex; align-items: end; gap: 3px; padding: 7px; border: 1px solid #91a195; border-radius: 8px; transform: rotate(-2deg); }
.brand__mark i { display: block; width: 5px; background: #e0e9e0; border-radius: 1px; transform: skewY(-22deg); }
.brand__mark i:nth-child(1) { height: 13px; }.brand__mark i:nth-child(2) { height: 19px; }.brand__mark i:nth-child(3) { height: 16px; }
.brand > span:last-child { display: grid; }
.brand b { font-size: 17px; letter-spacing: .01em; line-height: 1.1; }
.brand small { color: #afbab1; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; margin-top: 4px; }
.sidebar nav { display: grid; gap: 7px; }
.sidebar nav button { position: relative; display: flex; align-items: center; gap: 13px; width: 100%; padding: 12px 13px; border: 0; border-radius: 8px; background: transparent; color: #aeb9b1; font-weight: 500; text-align: left; transition: .18s ease; }
.sidebar nav button:hover { background: #24362a; color: #fff; }
.sidebar nav button.is-active { background: #e8eee8; color: #23372a; font-weight: 700; }
.sidebar nav svg { width: 19px; height: 19px; }
.sidebar nav em { margin-left: auto; display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 10px; background: #ad4f2b; color: #fff; font-size: 11px; font-style: normal; }
.sidebar__footer { display: flex; gap: 10px; align-items: center; margin-top: auto; padding: 16px 10px 2px; border-top: 1px solid #34463a; }
.sidebar__footer > div { display: grid; gap: 3px; }
.sidebar__footer b { font-size: 11px; color: #dce3dd; font-weight: 600; }
.sidebar__footer small { color: #819087; font: 9px "DM Mono", monospace; }
.connection-dot { width: 7px; height: 7px; background: #78b388; border-radius: 50%; box-shadow: 0 0 0 4px rgba(120,179,136,.12); }

main { margin-left: 232px; min-height: 100vh; }
.workspace { width: min(1180px, calc(100vw - 292px)); margin: 0 auto; padding: 55px 0 70px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; margin-bottom: 32px; }
.kicker { margin: 0 0 8px!important; color: #6f806f!important; font: 500 10px "DM Mono", monospace!important; letter-spacing: .2em!important; }
.page-heading h1 { margin: 0; font-size: clamp(28px, 3vw, 40px); line-height: 1.2; letter-spacing: -.045em; }
.page-heading p { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.heading-stat { min-width: 148px; padding: 16px 18px; border-left: 2px solid #637967; display: grid; text-align: right; }
.heading-stat span { color: var(--muted); font-size: 10px; }
.heading-stat strong { font: 500 28px "DM Mono", monospace; }
.heading-stat small { color: #778079; font-size: 10px; }

.control-panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: grid; grid-template-columns: auto minmax(240px, 1fr) auto auto; gap: 18px; align-items: end; box-shadow: 0 1px 1px rgba(34,38,31,.03); }
.segmented { display: flex; padding: 3px; background: #efefeb; border-radius: 7px; align-self: end; }
.segmented button { border: 0; border-radius: 5px; background: transparent; color: #777a74; padding: 10px 15px; font-size: 12px; font-weight: 600; }
.segmented button.is-active { background: white; color: #25382b; box-shadow: 0 1px 4px rgba(40,45,37,.13); }
.field { display: grid; gap: 7px; }
.field span, .target-summary span { color: #74766f; font-size: 10px; font-weight: 600; letter-spacing: .03em; }
select { width: 100%; min-height: 40px; border: 1px solid #d9d9d3; border-radius: 6px; padding: 0 38px 0 12px; color: #242621; background: white; outline: none; }
select:focus, textarea:focus { border-color: #718675; box-shadow: 0 0 0 3px rgba(92,119,97,.1); }
.target-summary { display: grid; gap: 7px; min-width: 64px; }
.target-summary b { font: 500 18px "DM Mono", monospace; white-space: nowrap; }
.primary-button, .secondary-button, .file-button { border: 0; border-radius: 6px; min-height: 41px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.primary-button { background: var(--green-800); color: #fff; }
.primary-button:hover { background: #213629; }
.primary-button svg, .secondary-button svg { width: 17px; height: 17px; }
.secondary-button, .file-button { border: 1px solid #d6d6cf; background: #fff; color: #31332f; }
.secondary-button:hover, .file-button:hover { background: #f7f7f4; }

.empty-state { min-height: 390px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-state__icon { display: grid; place-items: center; width: 64px; height: 64px; border: 1px dashed #acb0a9; border-radius: 50%; color: #819083; margin-bottom: 17px; }
.empty-state__icon svg { width: 28px; }
.empty-state h2 { font-size: 15px; margin: 0 0 7px; }
.empty-state p { color: #888983; font-size: 12px; line-height: 1.75; margin: 0; }
.results-heading { display: flex; align-items: center; justify-content: space-between; margin: 38px 0 16px; }
.results-heading h2 { margin: 0; font-size: 18px; }
.results-heading p { color: var(--muted); font-size: 11px; margin: 6px 0 0; }
.label-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.label-card { background: white; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.label-card__paper { width: calc(100% - 48px); aspect-ratio: 1.8; margin: 24px; padding: 20px 28px; border: 1px solid #d9d6ce; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto 1fr auto; background: #fff; overflow: hidden; }
.label-card__eyebrow { grid-column: 1 / -1; font: 600 8px "DM Mono", monospace; letter-spacing: .18em; }
.label-card__paper strong { grid-column: 1; margin-top: 6px; font-size: clamp(18px, 2.1vw, 26px); letter-spacing: -.03em; }
.label-card__paper span { grid-column: 2; grid-row: 2; align-self: center; color: #5d6059; font-size: 10px; }
.barcode { grid-column: 1 / -1; width: 100%; height: 58px; margin-top: 13px; fill: #151613; stroke: none; }
.label-card__paper code { grid-column: 1 / -1; text-align: center; font: 500 11px "DM Mono", monospace; letter-spacing: .08em; }
.label-card__paper small { grid-column: 1 / -1; align-self: end; padding-top: 6px; color: #4f6352; font: 600 7px "DM Mono", monospace; letter-spacing: .1em; }
.label-card__meta { border-top: 1px solid #ecebe6; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; padding: 14px 18px; }
.label-card__meta > div { display: grid; gap: 3px; min-width: 0; }
.label-card__meta b { font-size: 12px; }
.label-card__meta span:not(.status) { color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { display: inline-flex!important; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 10px; width: max-content; font-size: 9px!important; font-weight: 600; white-space: nowrap; }
.status--good { color: #3e6749!important; background: #edf4ee; }.status--bad { color: #9b402b!important; background: #fbede9; }
.status__dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.icon-button { width: 34px; height: 34px; border: 1px solid #deded8; border-radius: 5px; display: grid; place-items: center; color: #5c6059; background: #fff; }
.icon-button:hover { color: #263c2d; background: #f6f7f4; }.icon-button svg { width: 16px; }

.data-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 18px; }
.import-card, .validation-card, .records-card { background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.import-card__header, .import-card__footer, .records-card__header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.import-card__header { padding: 20px 22px 16px; }
.import-card h2, .records-card h2 { font-size: 14px; margin: 0; }.import-card p, .records-card p { color: var(--muted); font-size: 10px; margin: 5px 0 0; }
.file-button { min-height: 35px; cursor: pointer; }.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
textarea { display: block; width: calc(100% - 44px); height: 244px; margin: 0 22px; padding: 16px; resize: vertical; border: 1px solid #dcddd7; border-radius: 5px; background: #f8f8f5; color: #30332d; font: 12px/1.8 "DM Mono", monospace; outline: none; white-space: pre; }
.import-card__footer { padding: 14px 22px 18px; }
.import-card__footer span { color: #898b84; font: 9px "DM Mono", monospace; }
.validation-card { padding: 20px; }
.validation-score { display: flex; align-items: center; gap: 13px; padding-bottom: 18px; border-bottom: 1px solid #e8e8e3; }
.validation-score > svg { width: 38px; height: 38px; padding: 8px; color: #4d7257; background: #edf4ee; border-radius: 50%; }
.validation-score.has-errors > svg { color: #b5502f; background: #fbede8; }
.validation-score > div { display: grid; gap: 3px; }.validation-score strong { font-size: 14px; }.validation-score span { color: var(--muted); font-size: 10px; }
.validation-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 17px 0; border-bottom: 1px solid #e8e8e3; }
.validation-stats div { display: grid; text-align: center; border-right: 1px solid #e8e8e3; }.validation-stats div:last-child { border: 0; }
.validation-stats b { font: 500 18px "DM Mono", monospace; }.validation-stats span { color: var(--muted); font-size: 8px; margin-top: 3px; }
.error-list h3 { font-size: 10px; margin: 17px 0 11px; color: #777a73; }
.error-row { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid #f0f0ec; }.error-row > b { flex: 0 0 32px; color: #b24f30; font-size: 9px; }.error-row > div { display: grid; gap: 2px; }
.error-row span { font-size: 9px; }.error-row small { color: #9a6e5f; font-size: 8px; }
.all-clear { display: flex; gap: 8px; align-items: flex-start; padding: 12px; background: #f5f8f5; border-radius: 5px; color: #56705b; }.all-clear p { margin: 0; font-size: 9px; line-height: 1.6; }
.records-card { margin-top: 18px; overflow: hidden; }.records-card__header { padding: 20px 22px; }.records-card__header > span { color: #68766a; font: 9px "DM Mono", monospace; letter-spacing: .08em; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 11px 20px; border-top: 1px solid #e7e7e2; border-bottom: 1px solid #e7e7e2; background: #f8f8f5; color: #797b75; font-size: 9px; text-align: left; white-space: nowrap; }
td { padding: 14px 20px; border-bottom: 1px solid #eeede8; color: #555851; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; } td b { color: #252722; } td code { color: #344d3a; font: 10px "DM Mono", monospace; }.table-empty { height: 120px; color: #8b8d87; text-align: center; }
.toast { position: fixed; left: calc(50% + 116px); bottom: 24px; z-index: 50; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; padding: 11px 16px; border-radius: 6px; color: #fff; background: #202a23; box-shadow: 0 8px 30px rgba(20,25,21,.22); font-size: 11px; transition: .2s ease; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 900px) {
  .sidebar { width: 76px; padding: 25px 12px; }.brand { padding: 0 8px 30px; }.brand > span:last-child, .sidebar nav span, .sidebar__footer div { display: none; }.brand__mark { width: 34px; flex: 0 0 34px; }
  .sidebar nav button { justify-content: center; padding: 13px; }.sidebar nav em { position: absolute; right: 5px; top: 4px; }
  .sidebar__footer { justify-content: center; }.connection-dot { flex: 0 0 7px; }
  main { margin-left: 76px; }.workspace { width: calc(100vw - 116px); }.toast { left: calc(50% + 38px); }
  .control-panel { grid-template-columns: 1fr 1fr; }.segmented { order: 1; }.field { order: 2; }.target-summary { order: 3; }.primary-button { order: 4; }
  .data-layout { grid-template-columns: 1fr; }.label-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .sidebar { position: fixed; inset: auto 0 0 0; width: auto; height: 64px; padding: 8px 20px; flex-direction: row; align-items: center; }.brand, .sidebar__footer { display: none; }.sidebar nav { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.sidebar nav button { padding: 9px; }.sidebar nav span { display: inline; }.sidebar nav em { position: static; }
  main { margin: 0 0 64px; }.workspace { width: calc(100vw - 30px); padding: 32px 0 45px; }.page-heading { align-items: flex-end; }.page-heading p { max-width: 360px; }.heading-stat { display: none; }
  .control-panel { grid-template-columns: 1fr; gap: 13px; }.segmented, .field, .target-summary, .primary-button { order: initial; }.target-summary { display: flex; justify-content: space-between; align-items: center; }.segmented button { flex: 1; }
  .results-heading { align-items: flex-end; }.results-heading .secondary-button { font-size: 0; padding: 0 12px; }.results-heading .secondary-button svg { margin: 0; }
  .label-card__paper { width: calc(100% - 28px); margin: 14px; padding: 15px; }.label-card__paper span { display: none; }.label-card__paper strong { grid-column: 1 / -1; }
  .data-layout { gap: 14px; }.import-card__header, .import-card__footer { align-items: flex-start; }.import-card__footer { flex-direction: column; }.import-card__footer .primary-button { width: 100%; } textarea { width: calc(100% - 28px); margin: 0 14px; }.toast { left: 50%; bottom: 80px; max-width: calc(100vw - 30px); width: max-content; }
}

@media print {
  body { background: #fff; }.sidebar, .page-heading, .control-panel, .results-heading, .label-card__meta, .toast { display: none!important; }
  main { margin: 0; }.workspace { width: 100%; padding: 0; }.label-grid { display: block; }
  .label-card { break-after: page; border: 0; border-radius: 0; }.label-card__paper { width: 90mm; height: 50mm; aspect-ratio: auto; margin: 0 auto; padding: 6mm; border: 1px solid #bbb; }.barcode { height: 16mm; }
}
