:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1d1d1b;
  --muted: #6b6b66;
  --line: #e4e2db;
  --accent: #1f6f4a;
  --accent-soft: #e3f0e8;
  --danger: #b23a2e;
  --online: #2fa865;
  --offline: #c4c2bb;
  --bar-hour: #d64545;
  --bar-minute: #2fa865;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161715;
    --surface: #212320;
    --text: #ecebe6;
    --muted: #a3a29b;
    --line: #34362f;
    --accent: #5cc08b;
    --accent-soft: #23372b;
    --danger: #e0675a;
    --offline: #55574f;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans KR", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
[hidden] { display: none !important; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 18px; margin: 0 0 12px; }

/* 버튼 */
.btn {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.large { padding: 14px 28px; font-size: 17px; min-width: 140px; }
.btn.clock-out { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn:disabled { opacity: .5; cursor: default; }

/* 로그인 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: 100%; max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: grid; gap: 14px;
}
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input, select {
  font: inherit; color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}
.hint { font-size: 12px; color: var(--muted); margin: 0; }
.error { color: var(--danger); font-size: 13px; margin: 0; }

.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.brand.big { font-size: 20px; margin-bottom: 6px; }
.logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 14px;
}

/* 전체 틀: 왼쪽 메뉴 + 오른쪽 내용 */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar > .brand { padding: 0 8px; }
.nav { display: grid; gap: 2px; }
.nav-item {
  font: inherit; font-size: 14px; color: var(--text); text-align: left;
  border: 0; background: transparent; border-radius: 8px;
  padding: 8px 10px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
}
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav-item.sub { padding-left: 26px; }
.nav-group { font-size: 12px; color: var(--muted); padding: 14px 10px 4px; }
.nav-section { font-size: 14px; font-weight: 700; padding: 8px 10px 2px; }
.count { font-size: 12px; font-weight: 700; color: var(--muted); }
.count.bad { color: var(--danger); }
.sidebar-foot { margin-top: auto; display: grid; gap: 4px; padding: 0 4px; }
.me-line { font-size: 13px; color: var(--muted); padding: 0 6px 4px; }
.sidebar-foot .btn { text-align: left; }

.main { min-width: 0; padding: 16px 28px 40px; }
.quickbar { display: flex; gap: 8px; margin-bottom: 20px; }
.quickbar input { flex: 1; background: var(--surface); }
.btn.dark { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 700; white-space: nowrap; }

.page { max-width: 1120px; }
.page-head { margin-bottom: 16px; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.page-title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-desc { color: var(--muted); font-size: 14px; margin: 6px 0 0; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 16px; }

/* 오늘: 숫자 카드 */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kpi { padding: 14px 18px; border-right: 1px solid var(--line); cursor: pointer; text-align: left; font: inherit; color: inherit; background: transparent; border-top: 0; border-bottom: 0; border-left: 0; }
.kpi:last-child { border-right: 0; }
.kpi:hover { background: var(--bg); }
.kpi .label { font-size: 13px; color: var(--muted); }
.kpi .value { font-size: 26px; font-weight: 700; line-height: 1.3; }
.kpi .value.bad { color: var(--danger); }
.kpi .value.text { font-size: 18px; line-height: 1.9; }
.person { align-content: start; }
.person > .badge { justify-self: start; }
.kpi .meta { font-size: 12px; color: var(--muted); }

.clock-actions { display: flex; align-items: center; gap: 12px; }
.status-text { color: var(--muted); font-size: 14px; }

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.person {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: grid; gap: 10px;
}
.person-top { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700;
  position: relative;
}
.avatar .dot {
  position: absolute; right: -1px; bottom: -1px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--offline); border: 2px solid var(--surface);
}
.avatar .dot.on { background: var(--online); }
.person-name { font-weight: 700; }
.person-role { font-size: 12px; color: var(--muted); }
.badge {
  display: inline-block; font-size: 12px; font-weight: 500;
  padding: 2px 8px; border-radius: 999px;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line);
}
.badge.working { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.person-stats { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.person-stats b { color: var(--text); font-size: 15px; }

/* 근무 기록 */
.records-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.month-nav { display: flex; align-items: center; gap: 10px; }
.totals { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.total-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
}
.total-card .label { font-size: 13px; color: var(--muted); }
.total-card .value { font-size: 22px; font-weight: 700; }
.total-card .meta { font-size: 12px; color: var(--muted); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.records { width: 100%; border-collapse: collapse; font-size: 14px; }
.records th, .records td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.records th { color: var(--muted); font-weight: 500; font-size: 13px; }
.records tr:last-child td { border-bottom: 0; }
.records td { vertical-align: top; }
.records td.num { font-variant-numeric: tabular-nums; }
.records .lines { display: grid; gap: 4px; }
.records .lines > div { min-height: 28px; display: flex; align-items: center; }
.records td.num > b { display: block; margin-top: 4px; }

/* 근무시간 막대 */
.hour-bar { display: flex; gap: 2px; margin-top: 6px; min-width: 180px; }
.hour-bar .cell {
  flex: 1; height: 10px; border-radius: 2px;
  background: var(--line); overflow: hidden; display: flex;
}
.hour-bar .cell.hour { background: var(--bar-hour); }
.hour-bar .minute { background: var(--bar-minute); height: 100%; }
.empty { color: var(--muted); text-align: center; padding: 24px; }

/* 샵마인 발주 */
.badge.ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.bad { background: transparent; color: var(--danger); border-color: var(--danger); }
.badge.warn { background: transparent; color: #b7791f; border-color: #b7791f; }
.day-notice {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; margin: 0 0 12px; font-size: 14px;
}
.day-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
/* 가로로 이어지는 단계 카드 */
.flow-row { list-style: none; margin: 0; padding: 2px 2px 8px; display: flex; gap: 22px; overflow-x: auto; }
.step-card {
  flex: 0 0 176px; position: relative;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px;
  display: grid; gap: 4px; align-content: start; background: var(--surface);
}
.step-card:not(:last-child)::after {
  content: "→"; position: absolute; right: -18px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 14px;
}
.step-card.done { border-color: var(--online); }
.step-card.stopped { border-color: var(--danger); }
.step-card.warn { border-color: #d69e2e; }
.step-card.waiting { border-style: dashed; }
.step-top { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.step-no { font-weight: 700; color: var(--text); }
.step-state { font-weight: 500; }
.step-card.done .step-state { color: var(--online); }
.step-card.stopped .step-state { color: var(--danger); }
.step-card.warn .step-state { color: #b7791f; }
.step-top .time { margin-left: auto; font-variant-numeric: tabular-nums; }
.step-card .title { font-weight: 700; font-size: 14px; line-height: 1.35; }
.step-card .detail { font-size: 12px; color: var(--muted); word-break: break-all; }
.step-card.stopped .detail { color: var(--danger); }

.timeline { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.timeline summary { cursor: pointer; font-weight: 500; }
.timeline ul { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; }
.timeline li { display: grid; grid-template-columns: 70px 1fr; gap: 8px; padding: 4px 0; border-top: 1px solid var(--line); word-break: break-all; }
.timeline li.bad { color: var(--danger); }
.timeline li time { color: var(--muted); font-variant-numeric: tabular-nums; }

/* 돈비 */
.donbi-compose {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: grid; gap: 10px; margin-bottom: 16px;
}
.donbi-compose textarea {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px; resize: vertical;
}
.donbi-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.donbi-reply {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 6px 10px; font-size: 13px;
}
.donbi-list { display: grid; gap: 12px; }
.convo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; }
.msg { display: grid; gap: 4px; }
.msg-head { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.msg-head b { color: var(--text); font-size: 13px; }
.msg-body { white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.msg.answer { border-left: 3px solid var(--accent); padding-left: 10px; }
.msg.answer.error { border-left-color: var(--danger); }
.convo-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* 창 */
dialog {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  padding: 0; width: min(380px, calc(100vw - 32px));
}
dialog::backdrop { background: rgb(0 0 0 / .35); }
.dialog-body { padding: 22px; display: grid; gap: 12px; }
.dialog-actions { display: flex; gap: 8px; align-items: center; }
.spacer { flex: 1; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-size: 14px;
}

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 10px 16px; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { display: flex; overflow-x: auto; gap: 4px; }
  .nav-group, .nav-section { display: none; }
  .nav-item, .nav-item.sub { padding: 6px 10px; white-space: nowrap; flex: 0 0 auto; }
  .sidebar-foot { flex-direction: row; display: flex; gap: 4px; align-items: center; }
  .me-line { padding: 0 6px 0 0; }
  .main { padding: 12px 16px 32px; }
  .quickbar .btn { padding: 8px 10px; }
  .clock-actions { width: 100%; justify-content: space-between; }
  .kpi { border-right: 0; border-bottom: 1px solid var(--line); }
}

.job-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.danger { border-color: var(--danger); }
.job-list { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; color: var(--muted); }
.job-list li { padding: 3px 0; display: flex; gap: 8px; }
.job-list li.error { color: var(--danger); }
.job-list li.running { color: var(--accent); }

/* 쿠팡 */
.cp-sync { display: flex; align-items: center; gap: 8px; }
.cp-table td.num, .cp-table th.num { text-align: right; white-space: nowrap; }
.cp-list { display: grid; gap: 10px; }
.cp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 6px; }
.cp-card.todo { border-color: #b7791f; }
.cp-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.cp-card-body { font-size: 14px; }
.cp-card textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); resize: vertical; }
.cp-card-actions { display: flex; gap: 8px; justify-content: flex-end; }
.cp-reply { border-left: 3px solid var(--line); padding: 4px 0 4px 10px; margin-top: 6px; }
.cp-reply.mine { border-left-color: var(--accent); }
.cp-reply .msg-body { max-height: 220px; overflow: auto; }
.cs-filter { margin-bottom: 10px; font-size: 14px; color: var(--muted); }
.cp-todo { border: 1px solid #b7791f; border-radius: 8px; padding: 8px 10px; font-size: 13px; background: transparent; }
.cp-todo b { color: #b7791f; }
.cs-filter label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.cs-filter input { width: auto; margin: 0; }

/* 주문 관리 */
.page.wide { max-width: none; }
.od-tools { display: flex; gap: 8px; align-items: center; }
.od-tools input[type="search"] { width: 280px; background: var(--surface); }
.od-stages { list-style: none; margin: 0 0 14px; padding: 0; display: flex; gap: 22px; flex-wrap: wrap; }
.od-stages li { position: relative; }
.od-stages li:not(:nth-last-child(-n+2))::after { content: "→"; position: absolute; right: -17px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.od-stages .od-stage-side { margin-left: auto; }
.od-stage {
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 18px; min-width: 190px; display: grid; gap: 2px;
}
.od-stage.small { min-width: 110px; }
.od-stage:hover { border-color: var(--muted); }
.od-stage.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.od-stage-name { font-weight: 700; font-size: 15px; }
.od-stage-count { font-size: 22px; font-weight: 700; line-height: 1.3; }
.od-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; min-height: 34px; flex-wrap: wrap; }
.od-bar .day-nav { margin: 0; }
.od-actions { display: flex; align-items: center; gap: 8px; }
.od-table th, .od-table td { padding: 8px 10px; }
.od-table tbody tr { cursor: pointer; }
.od-table tbody tr:hover { background: var(--bg); }
.od-table tr.cancelled td { color: var(--danger); text-decoration: line-through; }
.od-table tr.cancelled td:first-child { text-decoration: none; }
.od-table td.bad { color: var(--danger); }
.od-product { max-width: 260px; white-space: normal !important; }
.od-addr { max-width: 240px; white-space: normal !important; font-size: 13px; }
.od-memo { max-width: 180px; white-space: normal !important; font-size: 13px; }
.od-invoice { font-variant-numeric: tabular-nums; font-size: 13px; }
#tab-orders.dropping .od-wrap { outline: 3px dashed var(--accent); outline-offset: 4px; }
.od-prices { margin-top: 16px; }
.od-prices summary { cursor: pointer; font-weight: 700; }
.od-price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 10px; }
.od-price-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.od-price-card table { width: 100%; font-size: 13px; margin-top: 6px; }
.od-price-card th { color: var(--muted); font-weight: 500; text-align: left; }
.od-price-card input { width: 100%; padding: 4px 6px; font-size: 13px; }
#od-dialog { width: min(640px, 94vw); }
.od-info { display: grid; gap: 3px; font-size: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.od-info .person-role { display: inline-block; min-width: 64px; }
.od-edit { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.od-dialog-body textarea { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); resize: vertical; }
.od-check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }

/* 매출요약 */
.sales-table th, .sales-table td { padding: 6px 10px; }
.sales-table td.bad { color: var(--danger); }
.sales-table tr.today td { background: var(--accent-soft); }
.sales-table tr.weekend td:first-child { color: var(--danger); }
.sales-table tfoot td { border-top: 2px solid var(--line); background: var(--bg); }
.sales-input { width: 96px; padding: 4px 6px; font-size: 13px; text-align: right; }
.sales-note { margin-top: 8px; }

/* 반품·취소 고객 정보 */
.cp-customer { font-size: 14px; border-left: 3px solid var(--line); padding-left: 10px; }

/* 주문 관리: 상태 거르기 + 상태 칸 */
.od-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.od-filter {
  font: inherit; font-size: 14px; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
}
.od-filter b { margin-left: 4px; }
.od-filter:hover { border-color: var(--muted); }
.od-filter.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.od-filter.main { font-weight: 700; }
.od-status { font-size: 13px; padding: 4px 6px; border-radius: 6px; font-weight: 700; cursor: pointer; }
.od-status.s-received { color: #b7791f; border-color: #b7791f; }
.od-status.s-invoice { color: #2b6cb0; border-color: #2b6cb0; }
.od-status.s-done { color: var(--accent); border-color: var(--accent); }
.od-status.s-cancelled { color: var(--danger); border-color: var(--danger); }
.od-table tr.cancelled td .od-status { text-decoration: none; }
.od-actions select { font-size: 13px; padding: 4px 6px; }

/* 단가표 */
.pr-table th, .pr-table td { padding: 4px 6px; font-size: 13px; vertical-align: middle; }
.pr-table th.calc, .pr-table td.calc { background: var(--bg); color: var(--muted); }
.pr-table td.calc.bad { color: var(--danger); }
.pr-table tr.pr-first td { border-top: 2px solid var(--line); }
.pr-table td.pr-group { vertical-align: top; background: var(--surface); }
.pr-in { width: 100%; min-width: 60px; font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); }
.pr-in:hover { border-color: var(--line); }
.pr-in:focus { border-color: var(--accent); background: var(--surface); outline: none; }
.pr-in.num { text-align: right; min-width: 78px; }
textarea.pr-in { resize: vertical; min-width: 140px; }
.pr-name textarea.pr-in { min-width: 220px; }
.pr-code { font-weight: 700; min-width: 90px; }
.pr-auto { display: inline-block; margin: 4px 0; font-size: 11px; }
.pr-add-opt { display: block; margin-top: 4px; padding: 2px 6px; }
.pr-del { padding: 2px 8px; color: var(--muted); }
.pr-table td.pr-group:first-child { min-width: 130px; }
.pr-auto { display: block; width: max-content; }
.pr-table textarea.pr-in { min-width: 130px; }
.pr-table td.pr-name textarea.pr-in { min-width: 230px; }
.pr-table input[data-f="option_name"] { min-width: 100px; }
.pr-table input[data-f="order_time"] { min-width: 48px; }
/* 단가표: 머리글 두 줄 + 칸 좁게 */
.pr-table th { white-space: normal; line-height: 1.25; vertical-align: bottom; padding: 6px 5px; }
.pr-table th, .pr-table td { padding-left: 4px; padding-right: 4px; }
.pr-table td.pr-name textarea.pr-in { min-width: 160px; width: 160px; }
.pr-table textarea.pr-in { min-width: 110px; }
.pr-table td.pr-group:first-child { min-width: 112px; }
.pr-in.num { min-width: 64px; width: 64px; }
.pr-table input[data-f="fee_rate"] { min-width: 54px; width: 54px; }
.pr-table input[data-f="option_name"] { min-width: 84px; width: 84px; }
.pr-table input[data-f="kg"] { min-width: 52px; width: 52px; }
.pr-table input[data-f="supplier"] { min-width: 64px; width: 64px; }
.pr-table input[data-f="order_time"] { min-width: 40px; width: 40px; }
.pr-table th { word-break: keep-all; }
.pr-table th.calc { min-width: 58px; }
.pr-table textarea.pr-in { min-width: 100px; width: 100px; }
.pr-table td.pr-group:first-child { min-width: 104px; }
.pr-in.num { min-width: 60px; width: 60px; padding: 4px 3px; }
.pr-table input[data-f="fee_rate"] { min-width: 58px; width: 58px; }
.pr-table input[data-f="option_name"] { min-width: 78px; width: 78px; }
.pr-table input[data-f="kg"] { min-width: 48px; width: 48px; }
.pr-table input[data-f="supplier"] { min-width: 60px; width: 60px; }
.pr-table td.calc { font-size: 12px; }
.pr-table { width: auto; }
.pr-del { border: 0; }
table.records.pr-table { width: auto; }
.pr-table .pr-code { width: 96px; min-width: 96px; }
.pr-table td.pr-group:first-child { min-width: 0; width: 104px; }
.table-wrap:has(.pr-table) { width: fit-content; max-width: 100%; }
.pr-valid { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.pr-valid input.pr-in { min-width: 0; width: 128px; border-color: var(--line); padding: 2px 4px; font-size: 12px; }
.pr-pct { display: inline-flex; align-items: center; gap: 1px; font-size: 13px; color: var(--muted); }
.pr-table .pr-pct input[data-f="fee_rate"] { min-width: 46px; width: 46px; }
.pr-table .pr-pct input[data-f="fee_rate"] { min-width: 52px; width: 52px; padding: 4px 2px; }
/* 단가표: 순서 막대 · 복사 */
.pr-table th.pr-handle-th { width: 22px; padding: 0; }
.pr-table td.pr-handle { width: 22px; min-width: 22px; padding: 0; cursor: grab; vertical-align: middle; text-align: center; color: var(--muted); background: var(--bg); border-right: 1px solid var(--line); user-select: none; }
.pr-table td.pr-handle:hover { color: var(--accent); background: var(--accent-soft); }
.pr-table td.pr-handle span { font-size: 15px; letter-spacing: -3px; }
.pr-table tbody.pr-grp.dragging { opacity: .45; }
.pr-table tbody.pr-grp.flash td { animation: pr-flash 2s ease-out; }
@keyframes pr-flash { from { background: var(--accent-soft); } }
.pr-group-btns { display: flex; gap: 4px; margin-top: 4px; }
.pr-group-btns .btn { padding: 2px 6px; }
.pr-table td.pr-group:nth-child(2) { width: 104px; }
/* 코드 칸: 글자 안 잘리게 */
.pr-table td.pr-group:nth-child(2) { width: auto; min-width: 124px; padding-left: 6px; padding-right: 6px; }
.pr-table .pr-code { width: 100%; min-width: 112px; padding: 4px 4px; text-overflow: clip; }
.pr-table .pr-code { width: auto; min-width: 112px; }

/* 주문 (쿠팡·토스 통합 7탭) */
.badge.coupang { background: #fdecea; color: #c0392b; border-color: transparent; }
.badge.toss { background: #e8f0fe; color: #1a5fd0; border-color: transparent; }
.mk-tabs { display: flex; align-items: stretch; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.mk-tab { font: inherit; color: var(--text); cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; display: grid; justify-items: start; min-width: 92px; }
.mk-tab span { font-size: 13px; color: var(--muted); }
.mk-tab b { font-size: 20px; line-height: 1.2; }
.mk-tab:hover { border-color: var(--muted); }
.mk-tab.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.mk-tab.active span { color: var(--accent); font-weight: 700; }
.mk-tab.claim { border-style: dashed; }
.mk-tab.claim.active { border-style: solid; }
.mk-arrow { align-self: center; color: var(--muted); }
.mk-table tr.mk-todo td { background: #fff8e6; }
@media (prefers-color-scheme: dark) { .mk-table tr.mk-todo td { background: #3a3220; } }
.od-period { flex-wrap: wrap; gap: 8px; }
.od-period input[type="date"] { padding: 4px 6px; font-size: 13px; background: var(--surface); }
.od-table tr.od-sheet td { white-space: nowrap; font-size: 13px; padding: 6px 8px; }
