@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Lao:wght@400;500;600;700&display=swap');

/* ===== ສີຫຼັກ (แก้สีทั้งเว็บได้ที่นี่) ===== */
:root {
  --pink: #d70f64;
  --pink-dark: #b00c52;
  --pink-soft: #fdeef4;
  --pink-line: #f8c9dc;
  --bg: #f7f7f7;
  --card: #ffffff;
  --text: #2e2e2e;
  --muted: #757575;
  --line: #ebebeb;
  --green: #12a150;
  --green-soft: #e3f6eb;
  --amber: #f59e0b;
  --amber-soft: #fff4dc;
  --blue: #2563eb;
  --blue-soft: #e6eefe;
  --red: #dc2626;
  --red-soft: #fde8e8;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(0, 0, 0, .06);
  /* ພື້ນຫຼັງລາຍອາຫານ (food doodle background) */
  --doodle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cg opacity='.07' font-size='30'%3E%3Ctext x='10' y='40'%3E🍜%3C/text%3E%3Ctext x='100' y='70'%3E🥗%3C/text%3E%3Ctext x='40' y='120'%3E🍗%3C/text%3E%3Ctext x='125' y='160'%3E☕%3C/text%3E%3Ctext x='5' y='172'%3E🍚%3C/text%3E%3Ctext x='130' y='25'%3E🥭%3C/text%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* ຂະໜາດຕົວອັກສອນຫຼັກ (ขนาดตัวอักษรทั้งเว็บ: เดิม 16px → 17px) */
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body {
  /* ລາວ → ອັງກິດ → ຈີນ (ฟอนต์จีนใช้ของเครื่อง: iPhone/Mac = PingFang, Windows = YaHei, Android = Noto CJK) */
  font-family: 'Noto Sans Lao', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans SC', sans-serif;
  background: var(--bg) var(--doodle); color: var(--text);
  min-height: 100vh; -webkit-tap-highlight-color: transparent; line-height: 1.5;
}
a { color: inherit; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.3; }
h2 { font-size: 1.2rem; }
code, pre { background: #f1f1f1; border-radius: 6px; padding: 2px 6px; font-size: .88em; }
pre { padding: 10px; overflow-x: auto; white-space: pre-wrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ===== ປຸ່ມ / ຊ່ອງກອກ ===== */
.btn {
  border: 0; border-radius: 12px; padding: 12px 18px; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 6px; font: inherit; font-weight: 600; color: #fff; background: var(--pink);
  transition: transform .08s, background .15s, opacity .2s; text-decoration: none;
}
.btn:hover { background: var(--pink-dark); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.green { background: var(--green); } .btn.green:hover { background: #0e8642; }
.btn.amber { background: var(--amber); color: #3b2300; }
.btn.blue { background: var(--blue); }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: #fafafa; border-color: #d6d6d6; }
.btn.outline { background: #fff; color: var(--pink); border: 1.5px solid var(--pink); }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #f3b7b7; }
.btn.danger-solid { background: var(--red); color: #fff; } .btn.danger-solid:hover { background: #b91c1c; }
.btn.sm { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn.lg { padding: 15px 22px; font-size: 1.05rem; border-radius: 14px; }
.btn.block { width: 100%; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
  background: #fff; color: var(--pink); font-size: 22px; font-weight: 700; line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18); display: grid; place-items: center;
}
input, select, textarea {
  font: inherit; color: var(--text); background: #fff;
  border: 1px solid #dcdcdc; border-radius: 12px; padding: 11px 14px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pink); border-color: transparent; }
label { display: block; font-size: .85rem; color: var(--muted); margin: 12px 0 4px; font-weight: 500; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.narrow { max-width: 460px; width: 100%; }
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }

/* ===== ສະຖານະ ===== */
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.s-new { background: var(--pink-soft); color: var(--pink); }
.s-cooking { background: var(--amber-soft); color: #9a5b00; }
.s-done { background: var(--green-soft); color: #0b7a3b; }
.s-served { background: var(--blue-soft); color: var(--blue); }
.s-cancelled { background: #eee; color: #777; }

/* ===== ແຖບເທິງ (ພະນັກງານ) ===== */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; background: var(--pink); color: #fff; box-shadow: 0 2px 10px rgba(215, 15, 100, .25);
}
.brand { font-weight: 700; font-size: 1.05rem; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.brand .logo { background: #fff; border-radius: 10px; width: 34px; height: 34px; display: grid; place-items: center; font-size: 20px; }
.mainnav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.mainnav a {
  text-decoration: none; padding: 7px 12px; border-radius: 10px; color: #ffe3ee; white-space: nowrap;
  font-size: .92rem; display: flex; align-items: center; gap: 6px; font-weight: 500;
}
.mainnav a:hover { background: rgba(255, 255, 255, .12); }
.mainnav a.active { background: #fff; color: var(--pink); }
.topbar-right { display: flex; gap: 8px; align-items: center; }
.topbar .btn.ghost { background: rgba(255, 255, 255, .15); color: #fff; border-color: rgba(255, 255, 255, .3); }
.role-chip { background: rgba(255, 255, 255, .18); border-radius: 99px; padding: 4px 10px; font-size: .82rem; white-space: nowrap; }
.money-badge { background: #fff; color: var(--pink); padding: 5px 12px; border-radius: 99px; font-weight: 700; white-space: nowrap; }
.live { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .4); display: inline-block; }
.live.on { background: #7dffb0; box-shadow: 0 0 8px #7dffb0; }
.page { padding: 16px; max-width: 1400px; margin: 0 auto; }
.page-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.page-title h1 { font-size: 1.35rem; margin: 0; }

/* ມືຖື: ເມນູລຸ່ມຈໍ ແບບແອັບ */
@media (max-width: 760px) {
  .mainnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .08); justify-content: space-around; gap: 0; }
  .mainnav a { flex-direction: column; gap: 0; color: var(--muted); font-size: .7rem; padding: 4px 6px; border-radius: 10px; }
  .mainnav a .ni { font-size: 1.3rem; }
  .mainnav a.active { background: var(--pink-soft); color: var(--pink); }
  body.has-bottomnav { padding-bottom: 72px; }
  .hide-sm { display: none; }
  /* ຫົວແຖບແບ່ງເປັນ 2 ແຖວ ເພື່ອບໍ່ໃຫ້ລົ້ນຈໍ */
  .topbar { flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
  .brand { flex: 1 1 100%; min-width: 0; }
  .brand > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .topbar-right { flex: 1 1 100%; min-width: 0; justify-content: flex-end; flex-wrap: wrap; }
  body.has-bottomnav .mainnav:has(a:only-child) { display: none; }   /* ມີໜ້າດຽວ ບໍ່ຕ້ອງມີເມນູລຸ່ມ */
  .mainnav a { flex: 1 1 0; min-width: 0; padding: 4px 1px; text-align: center; white-space: normal; line-height: 1.25; overflow-wrap: anywhere; }
}

/* ===== ສະຖິຕິ ===== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: 14px; padding: 12px 14px; cursor: pointer; box-shadow: var(--shadow); border: 2px solid transparent; }
.stat.sel { border-color: var(--pink); }
.stat b { display: block; font-size: 1.7rem; color: var(--pink); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat span { font-size: .82rem; color: var(--muted); }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ===== ຄົວ ===== */
.orders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.order-card { background: #fff; border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); border-top: 5px solid var(--line); }
.order-card.st-new { border-top-color: var(--pink); animation: glow 1.6s infinite; }
.order-card.st-cooking { border-top-color: var(--amber); }
.order-card.st-done { border-top-color: var(--green); }
@keyframes glow { 50% { box-shadow: 0 0 0 4px rgba(215, 15, 100, .15); } }
.order-head { display: flex; justify-content: space-between; align-items: start; }
.order-head h3 { color: var(--pink); font-size: 1.35rem; margin: 0; }
.item-box { background: #fafafa; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.item-box .name { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.item-box .qty { background: var(--pink); color: #fff; border-radius: 8px; padding: 0 8px; flex: none; }
.item-box .opts { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.note { background: var(--amber-soft); color: #7a4b00; border-radius: 10px; padding: 8px 10px; font-size: .9rem; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { font-size: 3rem; }
.empty h2 { color: var(--text); }

/* ===== ໂຕະ ===== */
.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.table-card { background: #fff; border-radius: var(--radius); padding: 14px; cursor: pointer; min-height: 120px; box-shadow: var(--shadow); border: 2px solid transparent; }
.table-card h3 { font-size: 1.3rem; margin: 0; }
.table-card .amt { font-size: 1.25rem; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.table-card.free { opacity: .8; }
.table-card.open { border-color: var(--pink-line); background: var(--pink-soft); }
.table-card.open h3 { color: var(--pink); }
.table-card.billing { border-color: var(--amber); background: var(--amber-soft); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(245, 158, 11, .25); } }
.ready-tag { display: inline-block; margin-top: 6px; background: var(--green-soft); color: #0b7a3b; border-radius: 99px; padding: 2px 10px; font-size: .78rem; font-weight: 600; }

/* ===== ໜ້າຕ່າງປັອບອັບ ===== */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  border-radius: 22px 22px 0 0; padding: 18px; animation: up .22s ease-out;
}
.sheet.wide { max-width: 760px; }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 22px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.sheet-head h2 { margin: 0; }
.close-x { background: #f2f2f2; border: 0; color: var(--text); width: 36px; height: 36px; border-radius: 50%; font-size: 18px; cursor: pointer; flex: none; }
.sheet-hero { margin: -18px -18px 12px; height: 200px; background: var(--pink-soft); display: grid; place-items: center; font-size: 90px; border-radius: 22px 22px 0 0; overflow: hidden; }
.sheet-hero img { width: 100%; height: 100%; object-fit: cover; }

/* ===== ໜ້າລູກຄ້າ (ແບບແອັບສັ່ງອາຫານ) ===== */
.c-hero { background: var(--pink); color: #fff; padding: 14px 16px 54px; position: relative; overflow: hidden; }
.c-hero::after { content: ''; position: absolute; inset: 0; background: var(--doodle); opacity: .9; filter: brightness(10); pointer-events: none; mix-blend-mode: overlay; }
.c-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.c-shop { font-size: 1.35rem; font-weight: 700; }
.table-chip { display: inline-block; background: #fff; color: var(--pink); font-weight: 700; padding: 3px 12px; border-radius: 99px; margin-top: 4px; }
.lang-switch { display: flex; background: rgba(255, 255, 255, .2); border-radius: 99px; padding: 3px; }
.lang-switch button { border: 0; background: transparent; color: #fff; font: inherit; font-size: .82rem; padding: 4px 10px; border-radius: 99px; cursor: pointer; }
.lang-switch button.active { background: #fff; color: var(--pink); font-weight: 700; }
.lang-switch.on-light { background: #f2f2f2; display: inline-flex; margin: 0 auto 10px; }
.lang-switch.on-light button { color: var(--muted); }
.lang-switch.on-light button.active { background: var(--pink); color: #fff; }
.topbar .lang-switch { flex: none; }
.c-body { margin: -38px auto 0; max-width: 760px; position: relative; z-index: 2; padding: 0 12px; }
.c-card { background: #fff; border-radius: 18px; box-shadow: 0 4px 18px rgba(0, 0, 0, .08); padding: 12px; }
.searchbox { position: relative; }
.searchbox input { padding-left: 40px; background: #f5f5f5; border-color: transparent; border-radius: 99px; }
.searchbox::before { content: '🔍'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: .95rem; }
.c-sticky { position: sticky; top: 0; z-index: 10; background: rgba(247, 247, 247, .96); backdrop-filter: blur(6px); margin: 0 -12px; padding: 8px 12px 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.chip { flex: none; border: 0; background: transparent; color: var(--muted); padding: 8px 12px; font: inherit; font-size: .95rem; cursor: pointer; border-bottom: 3px solid transparent; font-weight: 500; }
.chip.active { color: var(--pink); border-bottom-color: var(--pink); font-weight: 700; }
.tabs { display: flex; gap: 6px; background: #f2f2f2; padding: 4px; border-radius: 12px; margin-top: 10px; }
.tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 9px; border-radius: 9px; font: inherit; cursor: pointer; font-weight: 500; }
.tabs button.active { background: #fff; color: var(--pink); font-weight: 700; box-shadow: var(--shadow); }
.menu-section h2 { font-size: 1.15rem; margin: 18px 4px 10px; }
.dish {
  display: flex; gap: 12px; background: #fff; border-radius: 16px; padding: 12px; margin-bottom: 10px;
  box-shadow: var(--shadow); cursor: pointer; align-items: stretch; transition: transform .1s;
}
.dish:active { transform: scale(.99); }
.dish .info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dish .nm { font-weight: 700; font-size: 1rem; }
.dish .ds { color: var(--muted); font-size: .85rem; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dish .pr { margin-top: auto; padding-top: 6px; font-weight: 700; color: var(--text); }
.dish .pic { width: 104px; height: 104px; flex: none; border-radius: 14px; background: var(--pink-soft); display: grid; place-items: center; font-size: 52px; position: relative; overflow: visible; }
.dish .pic img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.dish .pic .icon-btn { position: absolute; right: -6px; bottom: -6px; }
.dish.soldout { opacity: .45; pointer-events: none; }
.dish.soldout .pr { color: var(--red); }
.dish.hl { outline: 3px solid var(--pink); }
.cart-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; max-width: 736px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--pink); color: #fff; border: 0; border-radius: 14px; padding: 14px 18px; font: inherit; font-weight: 700;
  cursor: pointer; box-shadow: 0 8px 24px rgba(215, 15, 100, .35);
}
.cart-bar .count { background: #fff; color: var(--pink); border-radius: 8px; padding: 0 8px; margin-right: 8px; }
.banner { margin: 10px 0; padding: 12px 14px; border-radius: 12px; background: var(--amber-soft); color: #7a4b00; }
.banner.red { background: var(--red-soft); color: var(--red); }
.opt-group { margin: 14px 0; }
.opt-group .title { font-weight: 700; margin-bottom: 6px; display: flex; justify-content: space-between; }
.opt-group .title small { font-weight: 500; color: var(--muted); background: #f2f2f2; border-radius: 6px; padding: 0 6px; }
.opt-choices { display: flex; flex-direction: column; }
.opt-choices label { margin: 0; display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); color: var(--text); font-size: .95rem; cursor: pointer; }
.opt-choices input { width: 20px; height: 20px; accent-color: var(--pink); flex: none; }
.opt-choices .p { margin-left: auto; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--pink); background: #fff; color: var(--pink); font-size: 20px; cursor: pointer; line-height: 1; }
.stepper b { min-width: 22px; text-align: center; font-size: 1.05rem; }
.cart-line { display: flex; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line .grow { flex: 1; }
.my-order { background: #fff; border-radius: 14px; padding: 12px 14px; margin: 10px 0; box-shadow: var(--shadow); }
.ready-alert {
  position: fixed; inset: auto 16px 90px 16px; z-index: 60; max-width: 420px; margin: 0 auto; text-align: center;
  background: #fff; border: 3px solid var(--green); border-radius: 20px; padding: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .25); animation: up .25s, pulse-g 1.6s infinite .3s;
}
@keyframes pulse-g { 50% { box-shadow: 0 0 0 12px rgba(18, 161, 80, .15), 0 20px 40px rgba(0, 0, 0, .25); } }
.pay-box { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 16px; text-align: center; }
.pay-box img { width: 240px; max-width: 100%; }
.pay-amt { font-size: 1.8rem; font-weight: 700; color: var(--pink); }

/* ===== AI ແນະນຳເມນູ ===== */
.ai-fab {
  position: fixed; right: 16px; bottom: 84px; z-index: 35; border: 0; border-radius: 99px; padding: 12px 16px;
  background: #fff; color: var(--pink); font: inherit; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18); display: flex; align-items: center; gap: 6px;
}
.ai-msgs { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; padding: 4px 0 8px; }
.ai-msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; white-space: pre-wrap; font-size: .95rem; }
.ai-msg.bot { background: var(--pink-soft); align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-msg.user { background: var(--pink); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-add { border: 0; background: var(--pink); color: #fff; border-radius: 99px; font: inherit; font-size: .78rem; padding: 1px 9px; cursor: pointer; margin-left: 4px; }
.ai-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.ai-chips button { border: 1px solid var(--pink-line); background: #fff; color: var(--pink); border-radius: 99px; padding: 5px 10px; font: inherit; font-size: .82rem; cursor: pointer; }
.ai-box { background: linear-gradient(135deg, #fff, var(--pink-soft)); border: 1px solid var(--pink-line); border-radius: var(--radius); padding: 16px; white-space: pre-wrap; }

/* ===== ຫຼັງບ້ານ ===== */
.admin-grid { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.admin-grid > * { min-width: 0; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .emoji { font-size: 28px; width: 48px; height: 48px; border-radius: 10px; background: var(--pink-soft); display: grid; place-items: center; flex: none; overflow: hidden; }
.list-row .emoji img { width: 100%; height: 100%; object-fit: cover; }
.switch { position: relative; width: 46px; height: 26px; flex: none; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfcfcf; border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(20px); }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.qr-card { background: #fff; border-radius: 18px; padding: 16px; text-align: center; box-shadow: var(--shadow); border-top: 6px solid var(--pink); }
.qr-card img { width: 100%; max-width: 220px; }
.qr-card h3 { color: var(--pink); font-size: 1.6rem; margin: 2px 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: .8rem; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }
.edit-group { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-top: 8px; }
.edit-row { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.edit-row input { padding: 8px 10px; }
.photo-pick { display: flex; gap: 12px; align-items: center; }
.photo-pick .preview { width: 84px; height: 84px; border-radius: 14px; background: var(--pink-soft); display: grid; place-items: center; font-size: 40px; overflow: hidden; flex: none; }
.photo-pick .preview img { width: 100%; height: 100%; object-fit: cover; }
.section-title { font-weight: 700; margin: 18px 0 4px; display: flex; align-items: center; gap: 8px; }
details.more summary { cursor: pointer; color: var(--pink); font-weight: 600; margin-top: 14px; }

/* ===== ແຈ້ງເຕືອນ ===== */
#toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { padding: 12px 16px; border-radius: 12px; background: #1f2937; color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); animation: up .2s; }
.toast-err { background: var(--red); }

.demo-flag {
  position: fixed; left: 8px; bottom: 8px; z-index: 40; font-size: .75rem; color: #7a4b00;
  background: #fff8e6; border: 1px solid #f5c96b; border-radius: 10px; padding: 4px 8px; display: flex; gap: 6px; align-items: center;
}
.demo-flag select { width: auto; padding: 2px 4px; font-size: .75rem; border-radius: 6px; }
.demo-flag button { font: inherit; color: #7a4b00; background: none; border: 0; text-decoration: underline; cursor: pointer; }
body.has-bottomnav .demo-flag { bottom: 80px; }
@media (min-width: 761px) { body.has-bottomnav .demo-flag { bottom: 8px; } }
body.customer .demo-flag { display: none; }

@media print {
  body { background: #fff; }
  .topbar, .no-print, .mainnav { display: none !important; }
  .qr-card { break-inside: avoid; border: 1px solid #ccc; box-shadow: none; }
}

/* ===== ແທັບໃນໜ້າ ===== */
.page-tabs { display: flex; gap: 6px; background: #fff; padding: 5px; border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 14px; }
.page-tabs button { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 6px; border-radius: 10px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.page-tabs button.active { background: var(--pink); color: #fff; }
.s-pending { background: #ede9fe; color: #5b21b6; }
.serve-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.serve-grid > * { min-width: 0; }
@media (max-width: 900px) { .serve-grid { grid-template-columns: 1fr; } }
.ready-card { background: #fff; border-radius: 16px; padding: 14px; box-shadow: var(--shadow); border-left: 6px solid var(--green); margin-bottom: 12px; }
.ready-card h3 { margin: 0; font-size: 1.4rem; color: var(--green); }
.ready-card.pend { border-left-color: #7c3aed; }
.ready-card.pend h3 { color: #5b21b6; }
.bill-row { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--amber-soft); margin-bottom: 8px; }
.tbl-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.tbl-btns a { display: block; text-align: center; padding: 14px 6px; border-radius: 14px; background: #fff; border: 1px solid var(--line); text-decoration: none; font-weight: 700; box-shadow: var(--shadow); }
.tbl-btns a.busy { border-color: var(--pink-line); background: var(--pink-soft); }
