/* Thành phần giao diện trang khách, chủ máy, admin, xưởng. Quy tắc: docs/design.md. */
@import url('/tokens.css');
@import url('/action-icons.css');
body { font-size:15px }
main { width:min(960px,100%); margin:auto; padding:0 var(--gutter) 72px }

/* header và logo chữ */
header { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:16px 0 12px; margin-bottom:16px; border-bottom:1px solid var(--line) }
.brand { color:var(--ink); font-size:30px; font-weight:900; letter-spacing:-.055em; line-height:1; text-decoration:none; text-transform:lowercase }
header a:not(.brand) { padding:9px 14px; border-radius:var(--pill); color:var(--ink); font-size:13px; font-weight:700; text-decoration:none }
header a:not(.brand):hover { background:var(--tint); color:var(--ink) }
header a[aria-current="page"] { background:var(--ink); color:#fff }

/* chữ */
h1 { font-size:clamp(28px,5vw,52px); font-weight:900; letter-spacing:-.045em; line-height:1.08; margin:8px 0 16px }
h2 { font-size:clamp(17px,1.2vw + 13px,21px) }
h3 { font-size:15px }
header small,.muted,small { color:var(--muted) }
.kicker { display:block; margin-bottom:8px; color:var(--rose); font-size:11px; font-weight:800; letter-spacing:.24em; text-transform:uppercase }

/* bề mặt */
section,article,details.panel { background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:clamp(16px,3vw,28px); margin:14px 0; box-shadow:var(--shadow-card) }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,245px),1fr)); gap:12px }
.grid article { margin:0 }
section section,section article,#slots details.panel { box-shadow:none }
summary { cursor:pointer; color:var(--ink); font-weight:700 }
details[open]>summary { margin-bottom:12px }

/* ô nhập */
label { display:grid; gap:6px; margin:10px 0; color:var(--ink); font-weight:600; font-size:13px }
input,button,select,textarea { font:inherit }
input,select,textarea { width:100%; min-height:44px; border:1px solid var(--field-line); border-radius:var(--radius); padding:9px 12px; color:var(--ink); background:var(--card) }
input:focus-visible,select:focus-visible,textarea:focus-visible { outline-offset:1px; border-color:var(--rose) }
input[type=checkbox],input[type=radio] { width:18px; height:18px; min-height:0; padding:0; accent-color:var(--ink) }
input[type=range] { min-height:32px; padding:0; border:0; background:transparent; accent-color:var(--ink) }
label.check { display:flex; align-items:center; gap:10px }

/* nút: viên thuốc, chính nền navy; .light là nút phụ viền mảnh */
button,.action { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:10px 22px; border:0; border-radius:var(--pill); background:var(--ink); color:#fff; font-size:14px; font-weight:700; text-decoration:none; cursor:pointer; transition:transform .2s,box-shadow .2s,background .2s }
button:hover:not(:disabled),.action:hover { transform:translateY(-1px); box-shadow:0 8px 20px rgba(11,22,38,.16); color:#fff }
button.light,.action.light,label.action.light { background:transparent; color:var(--ink); box-shadow:inset 0 0 0 1.5px rgba(11,22,38,.22) }
button.light:hover:not(:disabled),.action.light:hover { color:var(--ink); box-shadow:inset 0 0 0 1.5px var(--ink) }
button:disabled { cursor:default; opacity:.45 }

/* bố cục nhỏ */
.row { display:flex; align-items:center; flex-wrap:wrap; gap:10px }
.spread { justify-content:space-between }
.row input:not([type=checkbox]):not([type=radio]) { width:auto; flex:1; min-width:140px }
.pill { display:inline-block; background:var(--inset); color:var(--ink); padding:5px 12px; border-radius:var(--pill); font-size:12.5px; font-weight:700 }
#msg:not(:empty),.notice { background:var(--warn-bg); color:var(--warn-ink); padding:12px 14px; border-radius:var(--radius); margin:12px 0; overflow-wrap:anywhere }
#msg:empty,[hidden] { display:none!important }
.item { padding:12px 0; border-bottom:1px solid var(--line) }
#goods .item:last-child { border-bottom:0 }
.num { font-variant-numeric:tabular-nums }
.qr { width:160px; height:160px; display:block; max-width:100% }
code { overflow-wrap:anywhere; background:var(--tint); border-radius:var(--radius-sm); padding:1px 5px }
dialog { width:min(420px,92vw); border:0; border-radius:var(--radius-menu); padding:24px; color:var(--text); box-shadow:var(--shadow-pop) }
dialog::backdrop { background:rgba(11,22,38,.55) }

/* giỏ hàng: ô tăng giảm gồm −, số in đậm, + */
.checkout-bar { position:sticky; bottom:0; padding:10px 0 calc(10px + env(safe-area-inset-bottom,0px)); background:var(--page) }
.checkout-bar button { width:100% }
button.qty { width:44px; min-width:44px; padding:0; font-size:18px; background:transparent; color:var(--ink); box-shadow:inset 0 0 0 1px var(--field-line) }
button.qty:hover:not(:disabled) { color:var(--ink); box-shadow:inset 0 0 0 1.5px var(--ink) }
button.qty+b { min-width:2ch; text-align:center; color:var(--ink); font-variant-numeric:tabular-nums }

#slots details.panel { margin:0; padding:12px }
#receive,#linkMachine { margin-top:10px }

@media print { body{background:white} body *{visibility:hidden} #labels,#labels *,#printqr,#printqr *{visibility:visible} #labels,#printqr{position:absolute;inset:0 auto auto 0;width:95%} .no-print{display:none!important} article{break-inside:avoid;box-shadow:none} }
@media print { #labels[data-print="owner"] #guestLabel,#labels[data-print="guest"] #ownerLabel {display:none} }
.entry { max-width:470px; margin:clamp(24px,7vh,80px) auto }
.entry .row { margin-top:20px }
.entry .row button { flex:1; white-space:nowrap }
button.scan-action,button.scan-action:hover { background:var(--scan-yellow); color:var(--ink) }
#reader video { width:100%; border-radius:var(--radius) }
.accounts { width:100%; border-collapse:collapse; text-align:left } .accounts th,.accounts td { padding:10px; border-bottom:1px solid var(--line) }
.admin-workspace {width:100%; max-width:1680px}
.admin-tabs {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.admin-tabs button {padding:8px 4px;background:var(--tint);color:var(--ink)}
.admin-tabs button[aria-pressed=true] {background:var(--ink);color:white}
.cf-turnstile {margin:12px 0;max-width:100%}
