* { box-sizing: border-box; }
:root {
  color: #17302d;
  background: #f3f6f4;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --ink: #17302d;
  --muted: #536963;
  --line: #dce6e1;
  --dark: #0d322d;
  --teal: #155c4f;
  --mint: #c8eedc;
  --white: #fff;
  --focus: #218273;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { word-break: keep-all; letter-spacing: -.045em; }
p { line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; }
button, input, select { font: inherit; }
button, .button, [type="radio"] { cursor: pointer; }
button:disabled, fieldset:disabled .button { opacity: .58; cursor: wait; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip { position: fixed; top: 8px; left: 8px; z-index: 2; background: white; padding: 12px; }
.kicker { color: var(--teal); font-size: .8rem; font-weight: 750; margin-bottom: 6px; }
.brand { display: inline-flex; gap: 11px; align-items: center; font-weight: 800; text-decoration: none; white-space: nowrap; letter-spacing: -.04em; }
.brand small { display: block; margin-top: 3px; font-weight: 500; font-size: .72rem; letter-spacing: 0; }
.brand-mark { display: grid; place-items: center; flex: 0 0 37px; width: 37px; height: 37px; color: #fff; background: var(--teal); border-radius: 10px; font-weight: 850; font-size: 1.15rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px;
  border: 1px solid transparent; border-radius: 10px; padding: 9px 14px; text-decoration: none;
  font-weight: 730; line-height: 1.2; text-align: center; white-space: nowrap;
}
.primary { background: var(--teal); color: #fff; }
.primary:not(:disabled):hover { background: #10483e; }
.secondary { border-color: var(--line); color: var(--teal); background: #fff; }
.secondary:not(:disabled):hover { border-color: #83b4a0; background: #eff8f3; }
.text-button { border: 0; background: transparent; color: var(--teal); font-weight: 730; padding: 5px; }
.text-button:hover { text-decoration: underline; }
.full { width: 100%; }
label { display: grid; gap: 7px; color: var(--ink); font-size: .86rem; font-weight: 680; }
input:not([type=radio]):not([type=file]), select {
  width: 100%; min-width: 0; min-height: 46px; padding: 9px 12px; border: 1px solid #cddbd4;
  border-radius: 9px; color: var(--ink); background: #fff; font-size: 1rem;
}
input::placeholder { color: #687d75; }
.error { color: #862f26; }
.success { color: #125341; }
.banner, .form-message { padding: 12px 15px; border-radius: 9px; margin-bottom: 15px; background: #e3f2e9; font-weight: 640; }
.banner.error, .form-message.error { background: #fff0eb; }
.hint { color: var(--muted); font-weight: 480; }

.public { background: #f4f7f3; }
.public-header, .public-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1440px; margin: auto; padding: 17px clamp(20px,6vw,88px); }
.public-header nav { display: flex; align-items: center; gap: clamp(13px,4vw,36px); }
.public-header nav a, .public-footer a { text-decoration: none; font-size: .9rem; font-weight: 710; }
.public-header nav a:hover, .public-footer a:hover { text-decoration: underline; }
.public-login { border: 1px solid #c9dad2; border-radius: 9px; padding: 10px 13px; }
.public-hero { position: relative; min-height: 570px; isolation: isolate; overflow: hidden; background: #0b2522; color: #fff; }
.public-hero img { position: absolute; z-index: -2; right: 0; width: 72%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.public-hero::after {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(90deg,#0b2522 4%,#0b2522 27%,#0b2522e8 38%,#0b25226b 62%,#0b25221a 83%);
}
.hero-content { max-width: 1440px; margin: auto; padding: 98px clamp(20px,6vw,88px) 72px; }
.hero-content .kicker { color: #b7ead5; letter-spacing: .08em; }
.hero-content h1 { font-size: clamp(3rem,6.7vw,6.5rem); line-height: 1.05; margin-bottom: 18px; }
.hero-content > p:nth-of-type(2) { color: #e5f0eb; font-size: clamp(1rem,1.5vw,1.15rem); }
.hero-content .button { margin-top: 25px; background: #c4efd9; color: #103c33; padding-inline: 16px; }
.hero-content .button:hover { background: #e3f7eb; }
.image-caption { position: absolute; right: 16px; bottom: 14px; padding: 3px 8px; background: #13322de0; color: white; font-size: .7rem; border-radius: 4px; }
.public-services { max-width: 1440px; margin: auto; padding: 56px clamp(20px,6vw,88px) 64px; }
.public-services h2 { font-size: clamp(1.55rem,3vw,2.35rem); margin-bottom: 22px; }
.service-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.service-grid article { background: white; padding: 22px; border: 1px solid var(--line); border-radius: 13px; }
.service-grid article p { color: var(--muted); margin-top: 8px; }
.public-footer { border-top: 1px solid var(--line); color: var(--muted); }

.work { background: #f3f6f4; }
.login-screen { min-height: 100svh; display: grid; place-items: center; padding: 22px; background: radial-gradient(at 30% 18%, #dceee4, transparent 43%), #f1f6f2; }
.login-card { width: min(100%, 410px); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 30px; box-shadow: 0 20px 46px #183d2a0e; }
.login-card h1 { font-size: 2rem; margin-top: 24px; }
.login-card > p { margin: 9px 0 24px; color: var(--muted); }
.login-card form { display: grid; gap: 14px; }
.workspace { display: grid; grid-template-columns: 224px minmax(0,1fr); min-height: 100svh; }
.sidebar {
  position: sticky; top: 0; display: flex; flex-direction: column; min-width: 0; height: 100svh;
  padding: 25px 15px 15px; background: var(--dark); color: #eaf5ed;
}
.sidebar .brand { padding-inline: 7px; font-size: 1.13rem; }
.sidebar .brand-mark { background: #c9efdb; color: #113c32; }
.sidebar .brand small { color: #b1c8be; }
.workspace-nav { display: grid; gap: 5px; margin-top: 35px; }
.workspace-nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; min-height: 45px;
  padding: 9px 11px; border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: #caddd2; font-size: .91rem; font-weight: 660;
}
.workspace-nav button[aria-current="page"] { color: #fff; border-color: #4b7569; background: #24534a; }
.workspace-nav button:hover { background: #234c43; }
.staff { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: auto; padding: 11px 7px 0; border-top: 1px solid #406058; font-size: .79rem; }
.staff span { overflow-wrap: anywhere; }
.staff .text-button { color: #d7efdf; white-space: nowrap; }
.nav-icon { display: inline-block; position: relative; flex: 0 0 16px; width: 16px; height: 16px; color: inherit; }
.cell-icon { border: 1.7px solid; border-radius: 3px; }
.cell-icon::after { content: ""; position: absolute; top: 5px; left: 0; width: 100%; border-bottom: 1.5px solid; }
.item-icon { border: 1.7px solid; border-radius: 3px; }
.item-icon::after { content: ""; position: absolute; top: 0; left: 4px; width: 4px; height: 6px; border: solid; border-width: 0 1.5px 1.5px; }
.scan-icon { border: 1.7px dashed; border-radius: 3px; }
.scan-icon::after { content: ""; position: absolute; inset: 3px 4px; border-left: 1px solid; border-right: 2px solid; }
.history-icon { border: 1.7px solid; border-radius: 50%; }
.history-icon::after { content: ""; position: absolute; top: 3px; left: 6px; width: 4px; height: 5px; border-left: 1.5px solid; border-bottom: 1.5px solid; }
.tiles { border: 1.7px solid; border-radius: 3px; }
.tiles::before, .tiles::after { content: ""; position: absolute; }
.tiles::before { left: 6px; height: 100%; border-left: 1.5px solid; }
.tiles::after { top: 6px; width: 100%; border-bottom: 1.5px solid; }

.main-content { min-width: 0; max-width: 1460px; width: 100%; margin: 0 auto; padding: 33px clamp(17px,3.5vw,55px) 42px; }
.main-content:focus { outline: none; }
.view-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 25px; }
.view-heading h1 { font-size: clamp(1.9rem,3.3vw,3rem); line-height: 1.14; }
.view-heading p:not(.kicker) { color: var(--muted); margin-top: 7px; font-size: .92rem; }
.stats { display: grid; grid-template-columns: 1fr 1fr 1.22fr; gap: 13px; margin-bottom: 20px; }
.stats article, .panel { border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.stats article { display: grid; justify-items: start; align-content: start; min-width: 0; gap: 7px; padding: 18px 19px; }
.stat-icon { display: grid; place-items: center; width: 32px; height: 32px; color: var(--teal); background: #e8f4ed; border-radius: 8px; margin-bottom: 4px; font-weight: 850; }
.stats article > span:nth-child(2) { color: var(--muted); font-size: .84rem; font-weight: 650; }
.stats strong { font-size: clamp(1.3rem,2.75vw,2.4rem); letter-spacing: -.045em; line-height: 1.15; overflow-wrap: anywhere; }
.stats small { color: #cfe6d9; font-size: .74rem; }
.stats .value-stat { background: #1b5446; border-color: #1b5446; color: #fff; }
.stats .value-stat > span:nth-child(2) { color: #e2f1e7; }
.stats .value-stat .stat-icon { background: #3a7463; color: #fff; }
.overview-columns { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0,1fr); gap: 15px; }
.panel { min-width: 0; padding: 18px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-heading h2 { font-size: 1.2rem; }
.panel-heading p { color: var(--muted); font-size: .84rem; margin-top: 4px; }
.panel-heading .text-button { flex: none; font-size: .83rem; }
.cell-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 158px),1fr)); gap: 11px; }
.cell-grid.compact { grid-template-columns: repeat(2,minmax(0,1fr)); }
.cell-card { display: grid; gap: 5px; text-align: left; min-width: 0; background: #f5f9f6; border: 1px solid var(--line); border-radius: 12px; padding: 13px; color: var(--ink); }
.cell-card:hover, .cell-card[aria-pressed="true"] { background: #e5f2e9; border-color: #7aaf97; }
.cell-card strong { font-size: .95rem; overflow-wrap: anywhere; }
.cell-card span { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.cell-card .cell-code { color: var(--teal); font-size: .79rem; font-weight: 820; }
.detail-panel { margin-top: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.empty { grid-column: 1 / -1; color: var(--muted); background: #f6f9f7; border: 1px dashed #ceded4; border-radius: 10px; padding: 17px; font-size: .88rem; }
.empty p + button { margin-top: 7px; }
.record-list { min-width: 0; display: grid; }
.record {
  min-width: 0; display: flex; align-items: center; justify-content: space-between;
  gap: 13px; padding: 10px 0; border-bottom: 1px solid #edf1ee;
}
.record:last-child { border-bottom: 0; }
.record-body { min-width: 0; display: grid; gap: 3px; }
.record-body strong, .record-body span { overflow-wrap: anywhere; }
.record-body strong { font-size: .91rem; }
.record-body span { color: var(--muted); font-size: .76rem; }
.record-end { flex: 0 0 auto; display: grid; justify-items: end; gap: 4px; color: var(--muted); font-size: .77rem; }
.record-end b { color: var(--ink); }
.record-end button { font-size: .78rem; }
.search-label { max-width: 390px; margin-bottom: 12px; }
.history-list .record { padding-block: 12px; }
.scan-view { max-width: 735px; }
.stock-form { padding: clamp(16px,4.4vw,28px); }
.stock-form fieldset { min-inline-size: 0; padding: 0; margin: 0; border: 0; }
.mode-row { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin-bottom: 19px; padding: 5px; background: #edf4ef; border-radius: 11px; }
.mode-row label { position: relative; display: grid; place-items: center; min-height: 39px; border-radius: 8px; white-space: nowrap; cursor: pointer; }
.mode-row label:has(:checked) { color: #115243; background: #fff; box-shadow: 0 1px 4px #28543b26; }
.mode-row label:has(:focus-visible) { outline: 3px solid var(--focus); }
.mode-row input { position: absolute; opacity: 0; }
.scan-steps { display: grid; gap: 14px; }
.scan-step { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 8px; }
.stock-preview { font-size: .87rem; color: var(--teal); border-radius: 9px; background: #edf6f0; padding: 11px 12px; line-height: 1.45; }
.quantity-row { display: grid; grid-template-columns: minmax(0,.5fr) minmax(0,1fr); gap: 10px; }
.quantity-row label { display: block; }
.quantity-row label input { margin-top: 7px; }
.stock-form .full { margin-top: 18px; }
.stock-form .form-message { margin: 12px 0 0; }
.dialog { width: min(calc(100vw - 26px), 430px); margin: auto; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); padding: 19px; }
.dialog::backdrop { background: #102b24a4; }
.dialog form { display: grid; gap: 13px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-heading h2 { font-size: 1.25rem; }
.icon-button { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: white; min-width: 39px; min-height: 39px; color: var(--ink); font-size: 1.3rem; }
.scanner video { width: 100%; min-height: 145px; max-height: 45vh; aspect-ratio: 4 / 3; object-fit: cover; background: #172d28; border-radius: 10px; margin-top: 12px; }
.scanner p { margin: 9px 0 13px; font-size: .85rem; color: var(--muted); }
.file-button { position: relative; cursor: pointer; }
.file-button:focus-within { outline: 3px solid var(--focus); }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.print-label { display: grid; justify-items: center; width: 100%; padding: 16px 5px; overflow: auto; }
.print-label canvas { max-width: 100%; height: auto; }
.print-label span { color: var(--muted); }
@media (max-width: 950px) {
  .overview-columns { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .workspace { display: block; }
  .sidebar { position: static; height: auto; padding: 11px 11px 6px; gap: 11px; display: grid; grid-template-columns: 1fr auto; }
  .sidebar .brand { padding: 0; font-size: 1rem; }
  .sidebar .brand small { display: none; }
  .sidebar .brand-mark { width: 32px; height: 32px; flex-basis: 32px; }
  .workspace-nav { grid-row: 2; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); margin-top: 0; gap: 2px; }
  .workspace-nav button { justify-content: center; flex-direction: column; gap: 5px; padding: 6px 1px; min-height: 49px; font-size: .69rem; text-align: center; white-space: nowrap; }
  .staff { grid-column: 2; grid-row: 1; margin: 0; padding: 0; border: 0; min-width: 0; }
  .main-content { padding: 20px 14px 32px; }
  .view-heading { margin-bottom: 16px; gap: 8px; align-items: end; }
  .view-heading .button { padding-inline: 8px; font-size: .82rem; }
  .stats { gap: 6px; margin-bottom: 12px; grid-template-columns: .82fr .94fr 1.38fr; }
  .stats article { padding: 9px 7px; gap: 5px; }
  .stats strong { font-size: clamp(.96rem,4.2vw,1.55rem); }
  .stats small, .stats article > span:nth-child(2) { font-size: .69rem; }
  .stat-icon { width: 26px; height: 26px; margin-bottom: 3px; }
  .panel { padding: 13px; }
  .detail-panel .panel-heading { align-items: start; flex-direction: column; }
  .public-header, .public-footer { padding: 13px 15px; gap: 9px; }
  .public-hero { min-height: 495px; }
  .public-hero img { width: 100%; object-position: 62% 36%; }
  .public-hero::after { background: linear-gradient(90deg,#082822dd,#08282296 62%,#08282234), linear-gradient(0deg,#0828229e,transparent 55%); }
  .hero-content { padding-top: 92px; }
  .service-grid { grid-template-columns: 1fr; }
  .public-services { padding-block: 32px; }
}
@media print {
  body { background: white; }
  body > *:not(#label-dialog) { display: none !important; }
  #label-dialog { position: static; width: 100%; max-width: none; border: 0; padding: 0; margin: 0; }
  #label-dialog::backdrop, #label-dialog > :not(.print-label) { display: none !important; }
  .print-label { width: auto; justify-items: start; overflow: visible; }
}
