/* K-Store POS v2 · 서울픽 / K-스토어 분리 · 한·미 병기 UI
   every label carries Korean + Myanmar, no language switch, no page overflow */
@font-face {
  font-family: 'MMSans';
  src: url('fonts/NotoSansMyanmar.ttf') format('truetype');
  font-display: swap;
  unicode-range: U+1000-109F, U+AA60-AA7F, U+A9E0-A9FF;
}

:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --ink: #141a22;
  --muted: #69737f;
  --line: #e3e7ee;
  --accent: #d81b60;
  --accent-soft: #fdeaf1;
  --pick: #d81b60;
  --pick-soft: #fdeaf1;
  --own: #2b6cb0;
  --own-soft: #e8f0fa;
  --good: #0f8a52;
  --warn: #b45309;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 24, 33, .04), 0 6px 18px rgba(18, 24, 33, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', 'Malgun Gothic', 'MMSans', 'Noto Sans Myanmar', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }

/* ---------- bilingual labels ---------- */
.bi { display: inline; }
.bi .sl { display: inline-block; margin: 0 4px; }
.bi .ko { }
.bi .sl { color: #b9c0c9; font-weight: 400; }
.bi .my { margin-left: 1px; }
.bi .my, .pname .my, .sname .my, b .my {
  font-family: 'MMSans', 'Noto Sans Myanmar', sans-serif;
  color: var(--muted);
  font-weight: 500;
}
.bpara { display: block; }
.bpara .ko { display: block; }
.bpara .my { display: block; color: var(--muted); font-family: 'MMSans', 'Noto Sans Myanmar', sans-serif; font-size: .95em; }
.card h3 .sub .bpara .ko { color: var(--muted); }
.bi.stack { display: inline-flex; flex-direction: column; gap: 0; line-height: 1.2; align-items: flex-start; }
.bi.stack .my { font-size: 10.5px; }
.pname { display: flex; flex-direction: column; line-height: 1.3; }
.pname .my { font-size: 11.5px; }
.sname { display: flex; flex-direction: column; line-height: 1.25; }
.sname .my { font-size: 11px; }
kpi, .kpi .k { min-width: 0; }
.kpi .k .bi { display: block; line-height: 1.25; }
.kpi .k .bi .my { font-size: 10.5px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  padding: 9px 16px; background: rgba(255,255,255,.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.logo {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(135deg, #d81b60, #7b1fa2);
  color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 16px;
}
.brand strong { font-size: 15px; display: block; line-height: 1.15; }
.brand small { color: var(--muted); font-size: 11px; display: block; }

.fx-chip {
  display: flex; align-items: center; gap: 8px;
  background: #f7f8fa; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font-size: 12.5px; white-space: nowrap;
}
.fx-chip b { font-size: 13.5px; }
.fx-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.fx-chip .dot.warn { background: var(--warn); }

/* ---------- tabs ---------- */
.tabs {
  display: flex; gap: 4px; padding: 7px 16px; background: #fff;
  border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 10px;
  color: var(--muted); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab .bi .ko { font-weight: 700; font-size: 13.5px; }
.tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.tab[aria-selected="true"] .my { color: #b0245a; }

main { max-width: 1320px; margin: 0 auto; padding: 16px 16px 96px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h2 { font-size: 19px; }
.page-head h2 .bi .my { font-size: 15px; }
.page-head p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.card + .card { margin-top: 14px; }
.card h3 { font-size: 14.5px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.card h3 .sub { font-weight: 500; color: var(--muted); font-size: 11.5px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; box-shadow: var(--shadow); min-width: 0; }
.kpi .k { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.kpi .v { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; overflow-wrap: anywhere; }
.kpi .s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.kpi.accent { background: linear-gradient(160deg, #fff 0%, #fff5f9 100%); }
.kpi.accent .v { color: var(--accent); }

/* ---------- section split (SeoulPick vs K-Store) ---------- */
.sections { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 14px; }
.sec-card {
  text-align: left; background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 3px;
  box-shadow: var(--shadow); min-width: 0;
}
.sec-card .sec-name { font-size: 15px; font-weight: 800; display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.sec-card .sec-name .my { font-family: 'MMSans', 'Noto Sans Myanmar', sans-serif; color: var(--muted); font-size: 12.5px; }
.sec-card .sec-sub { font-size: 11px; color: var(--muted); }
.sec-card .sec-sub .my { font-family: 'MMSans', 'Noto Sans Myanmar', sans-serif; }
.sec-card .sec-cnt { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sec-card:nth-child(1).active { border-color: var(--pick); background: linear-gradient(160deg, #fff 0%, var(--pick-soft) 100%); }
.sec-card:nth-child(2).active { border-color: var(--own); background: linear-gradient(160deg, #fff 0%, var(--own-soft) 100%); }
.sec-card:nth-child(1).active .sec-name { color: var(--pick); }
.sec-card:nth-child(2).active .sec-name { color: var(--own); }

.sec-block.pick { border-left: 4px solid var(--pick); }
.sec-block.own { border-left: 4px solid var(--own); }
.sec-block .sec-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.sec-block .sec-head h3 { margin: 0; }
.sec-block.pick h3 { color: var(--pick); }
.sec-block.own h3 { color: var(--own); }

.total-strip { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.total-strip .k { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.total-strip .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.total-strip .v span { font-size: 13px; font-weight: 700; color: var(--muted); }
.total-strip .s { font-size: 11.5px; color: var(--muted); }
.total-strip .ts-right { display: flex; gap: 10px; flex-wrap: wrap; }
.ts-item { background: #f7f8fa; border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; min-width: 118px; }
.ts-item span { display: block; font-size: 10.5px; color: var(--muted); }
.ts-item span .my { font-family: 'MMSans', 'Noto Sans Myanmar', sans-serif; }
.ts-item b { font-size: 15px; }

/* ---------- pos ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.search { position: relative; flex: 1 1 200px; min-width: 160px; }
.search input {
  width: 100%; padding: 9px 12px 9px 32px; border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search .mag { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 6px 11px; border-radius: 999px; font-size: 12px; cursor: pointer; white-space: nowrap; font-weight: 600;
  display: inline-flex; align-items: center; gap: 3px;
}
.chip .my { font-family: 'MMSans', 'Noto Sans Myanmar', sans-serif; font-weight: 500; }
.chip[aria-pressed="true"], .chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[aria-pressed="true"] .my, .chip.on .my { color: #d9dee5; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.pcard {
  text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 11px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; min-height: 126px;
  transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease; min-width: 0;
}
.pcard:hover { border-color: #cfd6df; box-shadow: 0 4px 14px rgba(18,24,33,.08); }
.pcard:active { transform: scale(.985); }
.pcard .nm { font-weight: 700; font-size: 13px; line-height: 1.3; }
.pcard .sk { font-size: 10.5px; color: var(--muted); letter-spacing: .02em; }
.pcard .pr { margin-top: auto; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.pcard .u { font-weight: 800; font-size: 15px; }
.pcard .mm { font-size: 11px; color: var(--muted); }
.pcard .st { font-size: 11px; color: var(--muted); }
.pcard .st .my { font-family: 'MMSans', 'Noto Sans Myanmar', sans-serif; }
.pcard .st.low { color: var(--warn); font-weight: 700; }
.pcard.out { opacity: .55; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge .my { font-family: 'MMSans', 'Noto Sans Myanmar', sans-serif; font-weight: 500; }
.badge.pick { background: var(--pick-soft); color: var(--pick); }
.badge.own { background: var(--own-soft); color: var(--own); }
.badge.retail { background: #eef7f1; color: var(--good); }
.badge.wholesale { background: #fdf3e7; color: var(--warn); }
.badge.void { background: #f3f4f6; color: #6b7280; text-decoration: line-through; }
.badge.ok { background: #eef7f1; color: var(--good); }
.badge.warn { background: #fdf3e7; color: var(--warn); }
.badges { display: flex; gap: 4px; flex-wrap: wrap; }

/* cart */
.cart { position: sticky; top: 108px; }
.cart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; flex-wrap: wrap; }
.cart-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 22px 6px; }
.line { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 8px; padding: 9px 0; border-top: 1px dashed var(--line); }
.line:first-of-type { border-top: 0; }
.line .ln { font-weight: 700; font-size: 13px; }
.line .lm { font-size: 11px; color: var(--muted); }
.line .ldisc { color: var(--warn); font-weight: 700; }
.line .lrow { display: flex; align-items: center; gap: 6px; min-width: 0; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.stepper button { border: 0; background: #f7f8fa; width: 26px; height: 28px; cursor: pointer; font-weight: 800; color: var(--muted); }
.stepper input { width: 34px; border: 0; text-align: center; padding: 4px 0; background: #fff; }
.line input.amt { width: 100%; min-width: 0; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; text-align: right; font-variant-numeric: tabular-nums; }
.line input.amt.left { text-align: left; }
.line .rm { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; padding: 2px 4px; }
.field { margin-top: 10px; }
.field label { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.field label .my { font-family: 'MMSans', 'Noto Sans Myanmar', sans-serif; font-weight: 500; }
.field select, .field input, .field textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none;
}
.field select:focus, .field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.seg { display: flex; background: #f1f3f7; border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 3px; }
.seg button .my { font-family: 'MMSans', 'Noto Sans Myanmar', sans-serif; font-weight: 500; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* coupon */
.coupon-box { margin-top: 12px; border: 1px solid #f0d5e1; background: #fff8fb; border-radius: 12px; padding: 10px; }
.cb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.cb-head .lbl { font-size: 12px; font-weight: 800; color: var(--pick); }
.cb-head .lbl .my { font-family: 'MMSans', 'Noto Sans Myanmar', sans-serif; font-weight: 500; }
.coupon-box input { width: 100%; padding: 9px 10px; border: 1px solid #f0d5e1; border-radius: 10px; background: #fff; font-weight: 800; font-size: 16px; text-align: right; outline: none; }
.coupon-box input:focus { border-color: var(--pick); box-shadow: 0 0 0 3px var(--pick-soft); }
.coupon-box .hint { margin: 6px 0 0; font-size: 10.5px; color: var(--muted); line-height: 1.45; }
.coupon-box .hint .my { font-family: 'MMSans', 'Noto Sans Myanmar', sans-serif; }

.sum { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.sum .r { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); padding: 2px 0; }
.sum .r > span:first-child { min-width: 0; }
.sum .r .my { font-family: 'MMSans', 'Noto Sans Myanmar', sans-serif; }
.sum .r.big { font-size: 18px; font-weight: 800; color: var(--ink); padding-top: 6px; }
.sum .r.big span:last-child { color: var(--accent); }
.sum .neg { color: var(--warn); }
.comm-hint { font-size: 10.5px; color: var(--muted); background: #f8f9fb; border-radius: 8px; padding: 7px 9px; margin-top: 8px; line-height: 1.5; }
.comm-hint .my { font-family: 'MMSans', 'Noto Sans Myanmar', sans-serif; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 13px; border-radius: 10px; font-weight: 700; font-size: 12.5px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; text-decoration: none;
}
.btn .my { font-family: 'MMSans', 'Noto Sans Myanmar', sans-serif; font-weight: 500; }
.btn:hover { border-color: #cfd6df; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary .my { color: #fff; }
.btn.primary:hover { filter: brightness(.96); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark .my { color: #e6e9ee; }
.btn.ghost { background: transparent; }
.btn.viber { background: #7360f2; border-color: #7360f2; color: #fff; }
.btn.viber .my { color: #fff; }
.btn.sm { padding: 6px 9px; font-size: 11.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.acts { display: flex; gap: 4px; flex-wrap: nowrap; }

/* ---------- tables ---------- */
.scrollx { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
table.t { min-width: 660px; }
th, td { text-align: left; padding: 8px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11px; color: var(--muted); font-weight: 700; background: #fafbfc; position: sticky; top: 0; vertical-align: bottom; }
th .bi.stack { gap: 1px; }
th .bi.stack .ko { font-size: 11px; color: var(--muted); }
th .bi.stack .my { font-size: 10px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.low { color: var(--warn); font-weight: 800; }
td.neg, .neg { color: var(--warn); }
tr.voided td { color: var(--muted); text-decoration: line-through; }
tr.voided td .badge, tr.voided td .btn { text-decoration: none; }
.tfoot td { font-weight: 800; background: #fafbfc; }
.empty { color: var(--muted); text-align: center; padding: 22px 8px; font-size: 12.5px; }
.prod-sum { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 2px; font-size: 12px; color: var(--muted); }
.prod-sum b { color: var(--ink); font-size: 14px; }

/* ---------- modal / toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(15,20,28,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 60; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 540px; max-height: 90vh; overflow: auto; padding: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.modal h3 { font-size: 16px; margin-bottom: 4px; }
.modal p.hint { color: var(--muted); font-size: 12.5px; margin: 0 0 12px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid .full { grid-column: 1 / -1; }
#toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); z-index: 90; pointer-events: none; opacity: 0; transition: opacity .18s, transform .18s; max-width: min(92vw, 460px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast .msg { background: var(--ink); color: #fff; padding: 10px 15px; border-radius: 12px; font-size: 13px; box-shadow: 0 10px 28px rgba(0,0,0,.22); }
#toast.err .msg { background: #b42318; }

/* ---------- misc ---------- */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.mono { font-variant-numeric: tabular-nums; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.two-col > .card { min-width: 0; }
.card { min-width: 0; }
.rate-edit { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.rate-edit .field { margin-top: 0; flex: 1 1 130px; }
.hidden { display: none !important; }
.mini-cart { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .pos { grid-template-columns: 1fr; }
  .cart { position: static; }
  .two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  main { padding: 12px 12px 110px; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .brand strong { font-size: 14px; }
  .fx-chip { font-size: 11.5px; padding: 4px 10px; order: 3; flex: 1 1 100%; justify-content: center; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 6px 4px 8px;
    justify-content: space-around; border-top: 1px solid var(--line); border-bottom: 0;
    background: #fff; box-shadow: 0 -2px 12px rgba(18,24,33,.06);
  }
  .tab { flex: 1; flex-direction: column; padding: 4px 2px; gap: 0; border-radius: 8px; }
  .tab .bi.stack { align-items: center; }
  .tab .bi.stack .ko { font-size: 10.5px; }
  .tab .bi.stack .my { font-size: 9px; }
  .tab .ico { font-size: 16px; }
  .sections { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .pcard { min-height: 116px; padding: 10px; }
  .kpi .v { font-size: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  #toast { bottom: 138px; }
  .spacer { display: none; }
  .brand small { display: none; }
  .brand { flex: 1 1 auto; }
  .mini-cart {
    position: fixed; left: 8px; right: 8px; bottom: 70px; z-index: 35;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: var(--ink); color: #fff; border-radius: 12px; padding: 9px 12px;
    font-size: 12px; box-shadow: 0 10px 24px rgba(0,0,0,.28);
  }
  .mini-cart[hidden] { display: none; }
  .mini-cart b { font-size: 14px; }
  .mini-cart button { background: #fff; color: var(--ink); border: 0; border-radius: 8px; padding: 6px 10px; font-weight: 700; font-size: 11.5px; }
  .page-head h2 { font-size: 17px; }
  .total-strip .v { font-size: 22px; }
}
