/* 1024×768 기준. 글자는 크게, 색은 적게. */
:root {
  --bg: #f4f5f7; --panel: #fff; --ink: #1d2330; --muted: #6b7280; --line: #dde1e7;
  --accent: #1565c0; --accent-ink: #fff; --sel: #e3eefc; --ok: #1b7f3b; --warn: #a15c00; --err: #c62828;
  --check: #fff6e0;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 16px/1.4 "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif; }
kbd { font: 11px monospace; border: 1px solid currentColor; border-radius: 3px; padding: 0 3px; opacity: .7; }
button { font: inherit; padding: 8px 14px; border: 1px solid var(--line); background: var(--panel); border-radius: 6px; cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.ghost { background: transparent; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); }
input { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.r { text-align: right; } .c { text-align: center; } .muted { color: var(--muted); }
.warn { color: var(--warn); } .err { color: var(--err); }

header.top { display: flex; justify-content: space-between; align-items: center; height: 44px; padding: 0 12px; background: var(--ink); color: #fff; }
header.top nav a { color: #cfd6e2; text-decoration: none; margin-right: 18px; }
header.top nav a.on { color: #fff; font-weight: 700; }
header.top .who { display: flex; gap: 14px; align-items: center; font-size: 14px; }
header.top .who .link { color: #cfd6e2; }
header.top .sync { color: #9fb3cc; }
main { height: calc(100% - 44px); }

/* 로그인 */
.login { width: 320px; margin: 120px auto; background: var(--panel); padding: 28px; border-radius: 10px; display: grid; gap: 14px; box-shadow: 0 2px 10px #0001; }
.login h1 { margin: 0 0 6px; font-size: 22px; }
.login label { display: grid; gap: 4px; font-size: 14px; }

/* 판매 화면 */
.pos { display: grid; grid-template-columns: 1fr 290px; gap: 10px; height: 100%; padding: 10px; }
.left { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-radius: 8px; padding: 10px; position: relative; }
.scanbar { display: flex; flex-direction: column; gap: 4px; }
#scan { font-size: 20px; padding: 10px 12px; border: 2px solid var(--accent); }
.msg { min-height: 22px; font-size: 15px; }
.msg.ok { color: var(--ok); } .msg.warn { color: var(--warn); } .msg.err { color: var(--err); font-weight: 700; }
.hint { color: var(--muted); font-size: 12px; margin: 4px 0 0; }

.results { position: absolute; left: 10px; right: 10px; top: 86px; max-height: 60%; overflow: auto; background: var(--panel); border: 2px solid var(--accent); border-radius: 8px; z-index: 5; box-shadow: 0 6px 20px #0002; padding: 4px 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 6px; border-bottom: 1px solid var(--line); }
th { font-size: 13px; color: var(--muted); font-weight: 500; text-align: left; position: sticky; top: 0; background: var(--panel); }
tr.sel td { background: var(--sel); }
.results tr { cursor: pointer; }

.cart { margin-top: 6px; display: block; overflow: auto; flex: 1; }
.cart thead, .cart tbody tr { display: table; width: 100%; table-layout: fixed; }
.cart .no { width: 34px; color: var(--muted); }
.cart th:nth-child(3), .cart td:nth-child(3) { width: 110px; }
.cart th:nth-child(4), .cart td:nth-child(4) { width: 120px; }
.cart th:nth-child(5), .cart td:nth-child(5) { width: 100px; }
.cart th:nth-child(6), .cart td:nth-child(6) { width: 44px; }
.cart td { font-size: 17px; }
.cart small { color: var(--muted); font-size: 13px; }
.cart tr.check td { background: var(--check); }
.cart tr.check.sel td { background: #fde9b8; }
.cart input.price { width: 96px; text-align: right; font-size: 16px; padding: 4px 6px; }
.cart .qty button { padding: 2px 8px; }
.cart .qty span { display: inline-block; min-width: 30px; }
.cart td:nth-child(6) button { padding: 4px 10px; }

.right { display: flex; flex-direction: column; gap: 12px; background: var(--panel); border-radius: 8px; padding: 14px; }
.sum { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; margin: 0; align-items: center; }
.sum dt { color: var(--muted); }
.sum dd { margin: 0; text-align: right; font-size: 20px; font-variant-numeric: tabular-nums; }
.sum dd input { width: 120px; text-align: right; font-size: 18px; }
.sum .big { font-size: 28px; font-weight: 800; color: var(--ink); }
.pay { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay button { padding: 16px 8px; font-size: 18px; }
.last { font-size: 14px; color: var(--muted); margin-top: auto; }

dialog { border: 0; border-radius: 10px; padding: 22px; width: 400px; box-shadow: 0 10px 40px #0004; }
dialog::backdrop { background: #0006; }
dialog h2 { margin: 0 0 8px; }
dialog label { display: grid; gap: 4px; margin: 10px 0; font-size: 14px; }
dialog .big { font-size: 20px; }
dialog menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 16px 0 0; }

/* 오늘 판매 */
.today { padding: 12px; height: 100%; overflow: auto; }
.today .cards { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin: 10px 0; }
.today .card { background: var(--panel); border-radius: 8px; padding: 10px; display: grid; }
.today .card span { font-size: 12px; color: var(--muted); }
.today .card b { font-size: 18px; font-variant-numeric: tabular-nums; }
.today .list { background: var(--panel); border-radius: 8px; }
.today .list td { font-size: 14px; }
.today .list .items { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today tr.refund td { color: var(--err); }
.today tr.done td { color: var(--muted); }
.today .act { white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.today .act button { padding: 2px 8px; font-size: 13px; }
