@font-face {
  font-family: 'Mulish';
  font-style: normal;
  font-display: swap;
  font-weight: 300 500;
  src:url(/fonts/mulish-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Mulish';
  font-style: normal;
  font-display: swap;
  font-weight: 300 500;
  src:url(/fonts/mulish-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Mulish';
  font-style: normal;
  font-display: swap;
  font-weight: 300 500;
  src:url(/fonts/mulish-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Prata';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src:url(/fonts/prata-400-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Prata';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src:url(/fonts/prata-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Xếp mâm (điều phối) ---------- */
:root {
  --red: #8e2a2a; --red-d: #6d1f1f; --gold: #c9a24a; --gold-l: #f6ebcc;
  --ink: #3d2a22; --muted: #8a6f60; --cream: #faf4ea; --paper: #fffdf8; --rule: #eadccb;
  --warn: #b5541c; --ok: #3d7a3a;
  --f-empty: #f1ece4; --f-part: #ffe3a3; --f-full: #bfe3b4; --f-over: #f4b4ae;
  --serif: 'Prata', Georgia, serif; --sans: 'Mulish', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 16px/1.5 var(--sans); }
body.busy { cursor: progress; }
body.busy .sheet, body.busy main { opacity: .75; }
a { color: var(--red); }
button, select, input { font: inherit; color: inherit; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 12px 64px; }
.muted { color: var(--muted); }
.warn { color: var(--warn); font-weight: 700; }
.small { font-size: 13px; }
.hint { color: var(--muted); font-size: 14px; margin: 10px 2px; }
.msg { text-align: center; color: var(--muted); margin: 40px 0; }

header.top { text-align: center; padding: 18px 12px 10px; }
.top .kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.top h1 { font: 400 26px/1.2 var(--serif); color: var(--red); margin: 2px 0 8px; }
.sides { display: inline-flex; gap: 4px; padding: 3px; border-radius: 99px; background: var(--paper); border: 1px solid var(--rule); }
.sides button { border: 0; background: none; padding: 6px 14px; border-radius: 99px; font-weight: 700; font-size: 14px; }
.sides button.on { background: var(--red); color: #fff; }
.totals { margin-top: 8px; font-size: 14.5px; }

nav.tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; padding: 8px 12px; background: color-mix(in srgb, var(--cream) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule); justify-content: center; }
nav.tabs a { flex: 1; max-width: 200px; text-align: center; text-decoration: none; padding: 8px 10px; border-radius: 99px; color: var(--ink); font-weight: 700; font-size: 15px; border: 1px solid var(--rule); background: var(--paper); }
nav.tabs a.on { background: var(--red); border-color: var(--red); color: #fff; }

.card { display: block; width: 100%; text-align: left; background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; padding: 12px; margin: 0 0 10px; }
.g-card summary { list-style: none; cursor: pointer; }
.g-card summary::-webkit-details-marker { display: none; }
.g-card summary .g-name::before { content: "▸ "; color: var(--muted); }
.g-card[open] summary .g-name::before { content: "▾ "; }
.g-head { display: flex; align-items: center; gap: 8px; }
.g-name { flex: 1; font-weight: 800; font-size: 17px; }
.zone { font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 99px; background: var(--gold-l); color: #7a5a10; white-space: nowrap; }
.zone.z-auto { background: #eee; color: var(--muted); }
.g-nums { margin-top: 4px; font-size: 14.5px; }
.g-tables, .g-off { margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.bar { height: 6px; border-radius: 99px; background: var(--f-empty); margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; font-size: 13.5px; padding: 3px 10px; border-radius: 99px; background: #f3ece2; border: 0; font-weight: 700; white-space: nowrap; }

ul.people { list-style: none; margin: 8px 0 0; padding: 0; }
.person { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--rule); }
.person.unseated { background: linear-gradient(90deg, #fff4e0, transparent); }
.p-main { flex: 1; min-width: 0; }
.p-name { font-weight: 700; }
.p-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.p-seat { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
select.move { max-width: 150px; font-size: 13.5px; padding: 4px 6px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; }
.b { flex: none; display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 99px; font-size: 13px; font-weight: 800; }
.b-confirmed { background: var(--ok); color: #fff; }
.b-sure { background: #cfe6c9; color: #234d21; }
.b-maybe { background: #fde6b0; color: #6b4b06; }
.b-none { background: #eee; color: #999; text-decoration: line-through; }

.search { width: 100%; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 12px; background: #fff; margin-top: 10px; font-size: 16px; }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--muted); margin: 10px 2px; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid #c9b9a5; }
.lg.empty { background: var(--f-empty); } .lg.part { background: var(--f-part); } .lg.full { background: var(--f-full); } .lg.over { background: var(--f-over); }
.lg.none { background: #fff; border-style: dashed; }
figure.plan { margin: 0 0 10px; background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; padding: 6px; }
figure.plan figcaption { font-size: 13px; color: var(--muted); text-align: center; }
figure.plan svg { display: block; width: 100%; height: auto; }
figure.plan.mezz svg { max-width: 420px; margin: 0 auto; }
.plan .wall { fill: #fbf7f0; stroke: #d8c8b2; stroke-width: 2; }
.plan .stage { fill: var(--gold-l); stroke: var(--gold); }
.plan .aisle { fill: #f3ece2; }
.plan .door { fill: #e8dccb; }
.plan .lbl { font: 700 13px var(--sans); fill: var(--muted); text-anchor: middle; }
.plan .lbl.sm { font-size: 10px; letter-spacing: .08em; }
.plan .slot { cursor: pointer; }
.plan .slot circle { stroke: #b9a58c; stroke-width: 1.5; fill: var(--f-empty); }
.plan .slot text { text-anchor: middle; font: 800 12px var(--sans); fill: var(--ink); pointer-events: none; }
.plan .slot text.u { font-size: 10px; font-weight: 700; }
.plan .slot.part circle { fill: var(--f-part); }
.plan .slot.full circle { fill: var(--f-full); }
.plan .slot.over circle { fill: var(--f-over); stroke: var(--red); }
.plan .slot.none circle { fill: #fff; stroke-dasharray: 4 3; }
.plan .slot.none text { fill: var(--muted); font-weight: 600; }
.plan .slot.tea { cursor: default; }
.plan .slot.tea circle { fill: #eee; stroke: #ddd; }
.plan .slot.tea text { font-size: 10px; fill: #aaa; }

.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.t-card { margin: 0; cursor: pointer; border-left-width: 5px; }
.t-card.empty { border-left-color: #d8cdbd; } .t-card.part { border-left-color: #e9b543; } .t-card.full { border-left-color: var(--ok); } .t-card.over { border-left-color: var(--red); }
.t-head { display: flex; justify-content: space-between; gap: 6px; }
.t-who { font-size: 13px; color: var(--muted); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.btn { border: 1px solid var(--rule); background: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 700; cursor: pointer; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; width: 100%; padding: 12px; }
.btn.sm { padding: 5px 10px; font-size: 13.5px; }

.sheet-back { position: fixed; inset: 0; background: rgba(40, 20, 10, .35); z-index: 20; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 86vh; overflow-y: auto; background: var(--paper); border-radius: 18px 18px 0 0; padding: 12px 14px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 24px rgba(0,0,0,.18); max-width: 760px; margin: 0 auto; }
.s-head { position: sticky; top: -12px; background: var(--paper); display: flex; align-items: center; gap: 8px; padding: 6px 0 8px; z-index: 1; }
.s-head b { font-size: 19px; flex: 1; }
.s-count { font-weight: 800; padding: 2px 10px; border-radius: 99px; background: var(--f-empty); }
.s-count.part { background: var(--f-part); } .s-count.full { background: var(--f-full); } .s-count.over { background: var(--f-over); }
.x { border: 0; background: #f3ece2; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; }
.x.sm { width: 28px; height: 28px; font-size: 16px; }
.row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--rule); }
.row b { min-width: 2ch; text-align: center; }
.row.grp { background: #faf3e6; padding-left: 8px; padding-right: 8px; border-radius: 10px; margin-top: 4px; border-top: 0; }
.g-lbl { flex: 1; font-weight: 700; }
.g-lbl::before { content: "Ngoài app · "; font-weight: 600; color: var(--muted); font-size: 13px; }
.step { border: 1px solid var(--rule); background: #fff; width: 34px; height: 34px; border-radius: 10px; font-size: 18px; font-weight: 800; cursor: pointer; }
.add-grp select { flex: 1; min-width: 0; padding: 7px; border: 1px solid var(--rule); border-radius: 10px; background: #fff; }
.add-grp input { width: 70px; padding: 7px; border: 1px solid var(--rule); border-radius: 10px; }
.sheet h3 { font-size: 15px; margin: 14px 0 0; }
.pool .person { padding: 6px 0; }

.pin { max-width: 340px; margin: 40px auto; text-align: center; }
.pin input { width: 100%; font: 700 26px/1 var(--sans); letter-spacing: .4em; text-align: center; padding: 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); margin-top: 8px; }
.pin button { margin-top: 12px; width: 100%; font: 800 17px var(--sans); padding: 12px; border: 0; border-radius: 12px; background: var(--red); color: #fff; }
.pin .err { color: var(--red); min-height: 1.5em; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14.5px; max-width: 90vw; }
