:root {
  --teal: #2a9393; --teal-d: #1f7373; --teal-l: #e6f3f3;
  --ink: #1f2424; --muted: #6b7373; --line: #dfe4e4; --bg: #f3f5f5; --card: #fff;
  --s-submitted: #2563eb; --s-checking: #d97706; --s-shipped: #16a34a;
  --err: #b3261e; --warn: #8a5a00; --ok: #1b6e3a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
       background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; }
a { color: var(--teal-d); }
h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 15px; margin: 0 0 12px; color: var(--teal-d); }

/* 상단 바 */
.top { background: #fff; border-bottom: 3px solid var(--teal); }
.top-in { max-width: 1240px; margin: auto; padding: 0 16px; display: flex; align-items: center; gap: 20px; min-height: 58px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand b { color: var(--teal); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 8px 12px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.nav a.on, .nav a:hover { background: var(--teal-l); color: var(--teal-d); }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.who .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; display: inline-block; }
.who b { color: var(--ink); }
.who form { margin: 0; }
.linkbtn { background: none; border: 1px solid var(--line); padding: 5px 10px; border-radius: 6px; cursor: pointer; color: var(--muted); font: inherit; font-size: 12px; }
.admin-tag { background: var(--ink); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; }

.wrap { max-width: 1240px; margin: auto; padding: 24px 16px 60px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.panel + .panel { margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: minmax(300px, 440px) 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

/* 숫자 카드 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; text-decoration: none; color: inherit; display: block; }
.stat:hover { border-color: var(--teal); }
.stat .k { color: var(--muted); font-size: 13px; }
.stat .v { font-size: 28px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat.hl { border-color: var(--teal); background: var(--teal-l); }
.stat.alert .v { color: var(--err); }

/* 표 */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: #fafbfb; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f7fbfb; }
td.num { font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 30px; text-align: center; }

/* 상태 뱃지 */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; }
.badge.submitted { background: var(--s-submitted); }
.badge.checking { background: var(--s-checking); }
.badge.shipped { background: var(--s-shipped); }
.badge.pending { background: #a1a1aa; } .badge.approved { background: var(--s-shipped); } .badge.rejected { background: var(--err); }

/* 탭 */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); background: #fff; font-size: 13px; }
.tabs a.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.tabs a span { opacity: .7; margin-left: 3px; }

/* 폼 */
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 14px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal-l); border-color: var(--teal); }
textarea { resize: vertical; min-height: 52px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; align-items: end; }
.hint { font-size: 11px; color: var(--muted); margin-top: 3px; }
/* 다수 주문 목록 */
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.count-pill { display: inline-block; font-size: 12px; background: var(--teal-l); color: var(--teal-d); padding: 1px 8px; border-radius: 999px; margin-left: 4px; vertical-align: middle; }
.items { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 10px; }
.item { display: grid; grid-template-columns: 180px 1fr; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.item.editing { border-color: var(--teal); background: var(--teal-l); }
.item.warn { border-color: #f1c4c0; }
.item img { width: 100%; border-radius: 3px; box-shadow: 0 1px 6px rgba(0,0,0,.15); cursor: pointer; background: #fff; }
.item-name { font-weight: 700; }
.item-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.item-chk { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink); margin: 4px 0 2px; cursor: pointer; }
.item-chk input { width: auto; margin: 0; }
.summary { font-weight: 700; margin-bottom: 4px; }
@media (max-width: 600px) { .item { grid-template-columns: 1fr; } }
.with-step { display: flex; gap: 6px; align-items: stretch; }
.with-step input, .with-step textarea { flex: 1; min-width: 0; }
.with-step:has(.size-ctl) { margin-bottom: 18px; }
.size-ctl { position: relative; display: flex; flex: none; }
.sz-cap, .sz-val { position: absolute; left: 50%; transform: translateX(-50%); font-size: 11px; line-height: 1; white-space: nowrap; color: var(--muted, #6b7676); }
.sz-cap { top: -15px; }
.sz-val { bottom: -15px; font-weight: 600; }
.sz-val.changed { color: var(--teal-d); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stepper { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; flex: none; }
.stepper button { flex: 1; width: 34px; border: 0; background: #fff; color: var(--teal-d); font-size: 10px; line-height: 1; cursor: pointer; padding: 0; }
.stepper button + button { border-top: 1px solid var(--line); }
.stepper button:hover:not(:disabled) { background: var(--teal-l); }
.stepper button:disabled { color: #c3cbcb; cursor: not-allowed; }
.lbl-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.lbl-row label.off { display: flex; align-items: center; gap: 4px; margin: 10px 0 4px; font-size: 12px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.lbl-row label.off input { width: auto; margin: 0; }
input:disabled { background: #eef1f1; color: var(--muted); }
input.invalid { border-color: var(--err); background: #fff7f6; }
.field-err { font-size: 12px; color: var(--err); margin-top: 4px; }
.btn { display: inline-block; padding: 10px 16px; background: var(--teal); color: #fff; border: 0; border-radius: 8px; font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { background: var(--teal-d); }
.btn.big { width: 100%; padding: 13px; font-size: 16px; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--teal); }
.btn.warn { background: var(--s-checking); }
.btn.danger { background: #fff; color: var(--err); border: 1px solid #f1c4c0; }
.btn:disabled { background: #b9c4c4; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* 알림 */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.flash.err { background: #fdecea; color: var(--err); }
.flash.warn { background: #fff4db; color: var(--warn); }
.flash.ok { background: #e7f6ec; color: var(--ok); }

/* 인증 화면 */
.auth { max-width: 420px; margin: 60px auto; padding: 0 16px; }
.auth .panel { padding: 28px; }
.auth h1 { text-align: center; }
.auth .sub { text-align: center; color: var(--muted); margin: -8px 0 18px; font-size: 13px; }
.auth .alt { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }

/* 진행 단계 */
.steps { display: flex; gap: 0; margin: 6px 0 4px; }
.step { flex: 1; text-align: center; position: relative; color: var(--muted); font-size: 13px; }
.step::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.step:first-child::before { display: none; }
.step .c { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid var(--line); margin: 0 auto 6px; position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.step.done { color: var(--ink); } .step.done .c { background: var(--teal); border-color: var(--teal); color: #fff; }
.step.done::before { background: var(--teal); }
.step .t { font-size: 11px; color: var(--muted); }

/* 상세 */
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-all; }
.proofs { display: flex; flex-direction: column; gap: 10px; }
.proofs img { width: 100%; max-width: 560px; box-shadow: 0 2px 10px rgba(0,0,0,.14); border-radius: 3px; background: #fff; }
.cap { font-size: 12px; color: var(--muted); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--line); position: relative; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.timeline .when { color: var(--muted); font-size: 12px; }
.ship-box { background: #e7f6ec; border: 1px solid #b6e2c4; border-radius: 8px; padding: 14px; }

/* 시안 편집 */
.cards { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.cards img { width: 100%; max-width: 640px; box-shadow: 0 2px 12px rgba(0,0,0,.15); border-radius: 3px; background: #fff; }
.cards .cap { width: 100%; max-width: 640px; margin-top: 6px; }
.en, .site, .kr { display: none; } .en.on, .site.on, .kr.on { display: block; }
.confirm { margin-top: 18px; padding: 14px; background: #fff8e6; border: 1px solid #f0d58a; border-radius: 8px; }
.confirm label.chk { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 14px; margin: 0; }
.confirm input[type=checkbox] { width: auto; }
.missing { font-size: 12px; color: var(--err); min-height: 16px; }
.section-gap { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line); }

@media (max-width: 600px) {
  .who { margin-left: 0; width: 100%; padding-bottom: 8px; }
  .row { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 90px 1fr; }
}
.proof-head { font-weight: 700; font-size: 13px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.proof-head:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
/* 목록 도구·페이지 */
.list-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.list-tools .search { margin-left: auto; display: flex; gap: 6px; }
.list-tools .search input { width: 240px; }
@media (max-width: 600px) { .list-tools .search { margin-left: 0; width: 100%; } .list-tools .search input { flex: 1; width: auto; } }
.pager { display: flex; gap: 4px; align-items: center; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.pager a { min-width: 32px; padding: 5px 8px; text-align: center; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--ink); background: #fff; }
.pager a.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.pager .hint { margin-left: 8px; }
/* 하단 */
.foot { border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px; }
.foot-in { max-width: 1240px; margin: auto; padding: 18px 16px 24px; display: flex; gap: 8px 24px; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; }
.foot a { color: var(--teal-d); }
.foot b { color: var(--ink); }
/* 안내 */
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p, .faq details ul { margin: 8px 0 0; color: var(--ink); }
.contact-box { background: var(--teal-l); border-radius: 10px; padding: 16px 18px; }
/* 통계 */
.stat-num td.num, .stat-num th.num { text-align: right; }
tr.total td { font-weight: 700; background: #fafbfb; }
@media print { .top, .foot, .no-print { display: none !important; } body { background: #fff; } .panel { border: 0; padding: 0; } }
.list-tools .search .btn { white-space: nowrap; }
.list-tools .search select { width: auto; }
/* 수령·보관 */
.badge.received { background: #64748b; }
.receive-box { border-color: var(--teal); }
.keep-list { list-style: none; padding: 0; margin: 8px 0 0; }
.keep-list li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.keep-list li .actions { margin-left: auto; }
.keep-list form { margin: 0; }
.purged-note { font-size: 13px; color: var(--muted); background: #f6f7f7; border-radius: 6px; padding: 10px 12px; }
/* 수령·보관 */
.badge.received { background: #64748b; }
.receive-box { border-color: var(--teal); }
.keep-list { list-style: none; padding: 0; margin: 8px 0 0; }
.keep-list li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.keep-list li .actions { margin-left: auto; }
.keep-list form { margin: 0; }
.purged-note { font-size: 13px; color: var(--muted); background: #f6f7f7; border-radius: 6px; padding: 10px 12px; }

.old { color: var(--muted); text-decoration: line-through; }
.badge.approved { background: var(--s-shipped); } .badge.canceled { background: #a1a1aa; }

/* 이전 명함 불러오기 */
.picker { margin-top: 12px; border: 1px solid var(--teal); border-radius: 8px; padding: 12px; background: #fbfefe; }
.picker-head { display: flex; gap: 6px; margin-bottom: 4px; }
.picker-head input { flex: 1; }
.pick-list { list-style: none; padding: 0; margin: 8px 0 0; max-height: 360px; overflow-y: auto; }
.pick-list li { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
