/* ============================================================
   styles.css — สไตล์กลาง (หน้าร้าน / หลังบ้าน / ไรเดอร์)
   สีแบรนด์ตั้งค่าที่ config.js → ถูก set เป็น CSS variables ตอนโหลด
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #d6467e;
  --primary-dark: #b02f62;
  --accent: #7a4a2b;
  --bg: #fff8f3;
  --card: #ffffff;
  --ink: #2d2a26;
  --ink-2: #6b655e;
  --line: #efe6dd;
  --good: #0ca30c;
  --warn: #f0932b;
  --bad: #d03b3b;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(60, 40, 20, .08);
  --shadow-lg: 0 8px 32px rgba(60, 40, 20, .16);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans Thai', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.55;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; font-size: inherit; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 15px; }
img { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 14px 120px; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; }
.row { display: flex; align-items: center; gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grow { flex: 1; }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--primary); color: #fff; font-weight: 700;
  border-radius: 999px; padding: 12px 22px; transition: transform .1s, box-shadow .2s;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent);
}
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); box-shadow: none; }
.btn.plain { background: #f3ede7; color: var(--ink); box-shadow: none; }
.btn.small { padding: 7px 14px; font-size: 13.5px; }
.btn.danger { background: var(--bad); box-shadow: none; }
.btn.good { background: var(--good); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- ป้าย ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px;
  background: #f3ede7; color: var(--ink-2);
}
.chip.pink { background: color-mix(in srgb, var(--primary) 12%, #fff); color: var(--primary); }
.chip.green { background: #e3f5e3; color: #0a7d0a; }
.chip.orange { background: #fdeed8; color: #c46e10; }
.chip.red { background: #fde3e3; color: var(--bad); }
.chip.gray { background: #eee; color: #666; }

/* ---------- header หน้าร้าน ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, #fff); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 560px; margin: 0 auto; padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.logo-badge {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 40%, transparent);
}
.shop-name { font-weight: 800; font-size: 16.5px; line-height: 1.2; }
.open-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--good); display: inline-block; margin-right: 4px; }
.open-dot.closed { background: var(--bad); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: #fff; border: 1px solid var(--line); font-size: 18px;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.icon-btn .bubble {
  position: absolute; top: -5px; right: -5px; background: var(--bad); color: #fff;
  font-size: 10.5px; font-weight: 700; border-radius: 99px; min-width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ---------- ประกาศ / ร้านปิด ---------- */
.announce {
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 14%, #fff), color-mix(in srgb, var(--warn) 14%, #fff));
  border: 1px solid color-mix(in srgb, var(--primary) 22%, #fff);
  border-radius: 12px; padding: 8px 12px; font-size: 13px; margin-top: 12px;
}
.closed-banner {
  background: #3b3632; color: #fff; border-radius: 12px; padding: 12px 14px; margin-top: 12px;
  display: flex; gap: 10px; align-items: center; font-size: 13.5px;
}

/* ---------- แบนเนอร์สไลด์ ---------- */
.banner-scroll {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 14px -14px 0; padding: 0 14px 6px; scrollbar-width: none;
}
.banner-scroll::-webkit-scrollbar { display: none; }
.banner {
  flex: 0 0 88%; scroll-snap-align: center; border-radius: var(--radius);
  padding: 22px 20px; color: #fff; position: relative; overflow: hidden; min-height: 120px;
  display: flex; flex-direction: column; justify-content: center;
}
.banner .b-emoji { position: absolute; right: 10px; bottom: -6px; font-size: 72px; opacity: .9; }
.banner h3 { font-size: 19px; font-weight: 800; text-shadow: 0 1px 4px rgba(0,0,0,.18); max-width: 75%; }
.banner p { font-size: 13px; opacity: .95; max-width: 70%; }
.banner-dots { display: flex; gap: 5px; justify-content: center; margin-top: 4px; }
.banner-dots i { width: 6px; height: 6px; border-radius: 99px; background: #ddd0c4; transition: .2s; }
.banner-dots i.on { width: 18px; background: var(--primary); }

/* ---------- ค้นหา ---------- */
.searchbar {
  display: flex; gap: 8px; margin-top: 14px;
}
.searchbar input {
  flex: 1; border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 18px;
  background: #fff; outline: none;
}
.searchbar input:focus { border-color: var(--primary); }

/* ---------- หมวดหมู่ ---------- */
.cat-tabs {
  display: flex; gap: 8px; overflow-x: auto; margin: 14px -14px 0; padding: 4px 14px 8px;
  position: sticky; top: 62px; z-index: 30; background: var(--bg); scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex: none; border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 13.5px;
  background: #fff; border: 1.5px solid var(--line); color: var(--ink-2); white-space: nowrap;
}
.cat-tab.on { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 35%, transparent); }

/* ---------- โปรโมชั่นแถบ ---------- */
.promo-strip { margin-top: 18px; }
.promo-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.promo-head h2 { font-size: 16.5px; font-weight: 800; }
.countdown { font-size: 12.5px; font-weight: 700; color: var(--bad); background: #fde3e3; border-radius: 8px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.h-scroll { display: flex; gap: 10px; overflow-x: auto; margin: 0 -14px; padding: 2px 14px 8px; scrollbar-width: none; }
.h-scroll::-webkit-scrollbar { display: none; }
.mini-card {
  flex: 0 0 140px; background: var(--card); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line); position: relative;
}
.mini-card .m-img { height: 90px; display: flex; align-items: center; justify-content: center; font-size: 44px; }
.mini-card .m-body { padding: 8px 10px 10px; }
.mini-card .m-name { font-size: 12.5px; font-weight: 600; line-height: 1.3; height: 33px; overflow: hidden; }
.price-now { color: var(--primary); font-weight: 800; }
.price-old { color: #b3aca4; text-decoration: line-through; font-size: 12px; margin-left: 4px; }
.corner-badge {
  position: absolute; top: 8px; left: 8px; background: var(--bad); color: #fff;
  font-size: 10.5px; font-weight: 800; border-radius: 8px; padding: 2px 7px; z-index: 2;
}
.corner-badge.gold { background: #c98500; }
.corner-badge.top { background: var(--accent); }
.qty-left { position: absolute; top: 66px; right: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; border-radius: 8px; padding: 2px 6px; }
.menu-card .qty-left { top: 96px; }

/* ---------- combo ---------- */
.combo-card {
  flex: 0 0 240px; background: linear-gradient(135deg, #fff, color-mix(in srgb, var(--primary) 7%, #fff));
  border: 1.5px dashed color-mix(in srgb, var(--primary) 45%, #fff); border-radius: 14px; padding: 12px;
}
.combo-emojis { font-size: 30px; letter-spacing: -6px; }

/* ---------- กริดเมนู ---------- */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.menu-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden; text-align: left;
  box-shadow: var(--shadow); border: 1px solid var(--line); position: relative; padding: 0;
  display: flex; flex-direction: column; transition: transform .12s;
}
.menu-card:active { transform: scale(.97); }
.menu-card .m-img { height: 120px; display: flex; align-items: center; justify-content: center; font-size: 56px; position: relative; }
.menu-card .m-body { padding: 10px 12px 12px; flex: 1; display: flex; flex-direction: column; }
.menu-card .m-name { font-weight: 700; font-size: 13.5px; line-height: 1.35; }
.menu-card .m-desc { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; height: 31px; overflow: hidden; }
.menu-card .m-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.add-fab {
  width: 30px; height: 30px; border-radius: 10px; background: var(--primary); color: #fff;
  font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px color-mix(in srgb, var(--primary) 40%, transparent);
}
.soldout-cover {
  position: absolute; inset: 0; background: rgba(255,255,255,.72); z-index: 3;
  display: flex; align-items: center; justify-content: center;
}
.soldout-cover span { background: #3b3632; color: #fff; font-weight: 700; font-size: 13px; border-radius: 99px; padding: 6px 16px; transform: rotate(-6deg); }
.stars { color: #eda100; font-size: 12px; letter-spacing: 1px; }

/* ---------- ตะกร้าลอย ---------- */
.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(255, 248, 243, .9) 40%);
  pointer-events: none;
}
.cart-bar-in {
  max-width: 532px; margin: 0 auto; pointer-events: auto;
  background: var(--ink); color: #fff; border-radius: 18px; padding: 13px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  box-shadow: var(--shadow-lg); cursor: pointer; width: 100%;
}
.cart-count {
  background: var(--primary); border-radius: 10px; min-width: 26px; height: 26px; padding: 0 6px;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13.5px;
}

/* ---------- sheet / modal ---------- */
.sheet-overlay {
  position: fixed; inset: 0; background: rgba(30, 20, 12, .5); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .18s;
}
@keyframes fadeIn { from { opacity: 0 } }
.sheet {
  background: var(--bg); width: 100%; max-width: 560px; border-radius: 24px 24px 0 0;
  max-height: 92dvh; overflow-y: auto; animation: slideUp .22s ease-out;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
@keyframes slideUp { from { transform: translateY(60px); opacity: .6 } }
.sheet-head {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--line);
}
.sheet-head h2 { font-size: 17px; font-weight: 800; }
.x-btn { width: 34px; height: 34px; border-radius: 99px; background: #f0e8e0; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.sheet-body { padding: 14px 16px; }

/* ---------- หน้ารายละเอียดเมนู ---------- */
.detail-img { height: 190px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 96px; position: relative; }
.opt-group { margin-top: 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.opt-group h4 { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.opt-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.opt-row:last-child { border-bottom: none; }
.opt-row label { display: flex; align-items: center; gap: 9px; flex: 1; cursor: pointer; }
.opt-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.qty-ctl { display: flex; align-items: center; gap: 14px; }
.qty-ctl button {
  width: 36px; height: 36px; border-radius: 12px; background: #fff; border: 1.5px solid var(--line);
  font-size: 19px; font-weight: 700; color: var(--primary);
}
.qty-ctl .q { font-size: 17px; font-weight: 800; min-width: 24px; text-align: center; }
textarea.note {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px;
  min-height: 64px; resize: vertical; outline: none; background: #fff;
}
textarea.note:focus { border-color: var(--primary); }

/* ---------- ตะกร้า / เช็คเอาต์ ---------- */
.cart-item { display: flex; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
.cart-item .c-img { width: 52px; height: 52px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.progress-wrap { background: #fff; border: 1.5px dashed color-mix(in srgb, var(--good) 50%, #fff); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.progress-track { background: #eee5dc; height: 10px; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--good), #7ed17e); border-radius: 99px; transition: width .4s; }
.mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode-tab {
  border: 1.5px solid var(--line); border-radius: 14px; background: #fff; padding: 12px 6px;
  text-align: center; font-weight: 600; font-size: 13px;
}
.mode-tab .ico { font-size: 22px; display: block; }
.mode-tab.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, #fff); color: var(--primary); }
.field { margin-top: 12px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px;
  background: #fff; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.pay-opt {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--line);
  border-radius: 14px; padding: 12px 14px; margin-top: 8px; cursor: pointer;
}
.pay-opt.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, #fff); }
.pay-opt input { accent-color: var(--primary); width: 18px; height: 18px; }
.sum-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 14px; }
.sum-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.sum-row.total { border-top: 1.5px dashed var(--line); margin-top: 6px; padding-top: 10px; font-size: 17px; font-weight: 800; }
.sum-row .neg { color: var(--good); }

/* ---------- แผนที่จำลอง ---------- */
.mock-map {
  border-radius: 14px; overflow: hidden; border: 1.5px solid var(--line); position: relative;
  touch-action: none; user-select: none; background: #eef3e9;
}
.mock-map svg { display: block; width: 100%; }
.map-hint { position: absolute; bottom: 8px; left: 8px; right: 8px; text-align: center; background: rgba(255,255,255,.92); border-radius: 10px; font-size: 11.5px; padding: 4px 8px; color: var(--ink-2); }

/* ---------- QR ---------- */
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; text-align: center; }
.qr-box svg { width: 190px; height: 190px; margin: 8px auto; display: block; }
.pp-head { background: #113566; color: #fff; border-radius: 10px; padding: 8px; font-weight: 700; font-size: 14px; }
.upload-drop {
  border: 2px dashed var(--line); border-radius: 14px; padding: 22px; text-align: center;
  color: var(--ink-2); font-size: 13px; background: #fff; cursor: pointer;
}
.upload-drop.has { border-color: var(--good); color: var(--good); background: #f3faf3; }

/* ---------- ติดตามออเดอร์ ---------- */
.track-steps { margin: 18px 0; }
.t-step { display: flex; gap: 14px; position: relative; padding-bottom: 26px; }
.t-step:last-child { padding-bottom: 0; }
.t-step::before { content: ""; position: absolute; left: 17px; top: 38px; bottom: 2px; width: 2.5px; background: var(--line); border-radius: 2px; }
.t-step:last-child::before { display: none; }
.t-step.done::before { background: var(--good); }
.t-dot {
  width: 36px; height: 36px; border-radius: 99px; background: #efe6dd; flex: none; z-index: 1;
  display: flex; align-items: center; justify-content: center; font-size: 17px; filter: grayscale(1); opacity: .55;
}
.t-step.done .t-dot { background: #e3f5e3; filter: none; opacity: 1; }
.t-step.current .t-dot { background: var(--primary); filter: none; opacity: 1; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 45%, transparent) } 55% { box-shadow: 0 0 0 10px transparent } }
.courier-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.courier-avatar { width: 46px; height: 46px; border-radius: 99px; background: #f3ede7; display: flex; align-items: center; justify-content: center; font-size: 24px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 18px;
  font-size: 13.5px; z-index: 300; box-shadow: var(--shadow-lg); animation: fadeIn .2s;
  max-width: 86vw; text-align: center;
}

/* ---------- รีวิว ---------- */
.review-row { border-bottom: 1px dashed var(--line); padding: 10px 0; }
.star-pick { font-size: 34px; letter-spacing: 6px; cursor: pointer; user-select: none; }
.star-pick span { filter: grayscale(1); opacity: .4; }
.star-pick span.on { filter: none; opacity: 1; }

/* ============================================================
   หลังบ้าน (admin)
   ============================================================ */
body.admin { background: #f6f3ef; }
.adm-layout { display: flex; min-height: 100dvh; }
.adm-side {
  width: 230px; flex: none; background: #241d18; color: #cfc6bd; padding: 18px 12px;
  display: flex; flex-direction: column; gap: 3px; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
}
.adm-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; color: #fff; }
.adm-nav-btn {
  display: flex; align-items: center; gap: 10px; text-align: left; border-radius: 12px;
  padding: 10px 12px; font-size: 14px; font-weight: 600; color: #cfc6bd; width: 100%;
}
.adm-nav-btn:hover { background: rgba(255,255,255,.06); }
.adm-nav-btn.on { background: var(--primary); color: #fff; }
.adm-nav-btn .bubble { margin-left: auto; background: var(--bad); color: #fff; border-radius: 99px; font-size: 11px; min-width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.adm-main { flex: 1; padding: 22px 26px 60px; min-width: 0; }
.adm-main h1 { font-size: 21px; font-weight: 800; margin-bottom: 4px; }
.adm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-top: 16px; }
.stat-tile { background: #fff; border: 1px solid #eae3da; border-radius: 16px; padding: 16px 18px; }
.stat-tile .v { font-size: 26px; font-weight: 800; margin-top: 2px; }
.stat-tile .d { font-size: 12px; color: var(--ink-2); }
.panel { background: #fff; border: 1px solid #eae3da; border-radius: 16px; padding: 16px 18px; margin-top: 16px; }
.panel h3 { font-size: 15.5px; font-weight: 800; margin-bottom: 10px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th { text-align: left; color: var(--ink-2); font-weight: 600; font-size: 12px; padding: 8px 10px; border-bottom: 1.5px solid #eae3da; white-space: nowrap; }
table.tbl td { padding: 9px 10px; border-bottom: 1px solid #f2ece5; vertical-align: top; }
table.tbl tr:last-child td { border-bottom: none; }
.tbl-scroll { overflow-x: auto; }
.order-card { background: #fff; border: 1.5px solid #eae3da; border-radius: 16px; padding: 14px 16px; margin-top: 12px; }
.order-card.new { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); animation: pulse 2s infinite; }
.adm-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toggle { position: relative; width: 46px; height: 26px; flex: none; }
.toggle input { opacity: 0; width: 100%; height: 100%; position: absolute; z-index: 2; cursor: pointer; margin: 0; }
.toggle i { position: absolute; inset: 0; background: #d8d0c7; border-radius: 99px; transition: .2s; }
.toggle i::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 99px; background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.toggle input:checked + i { background: var(--good); }
.toggle input:checked + i::after { left: 23px; }
.drag-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #eae3da; border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.drag-row.dragging { opacity: .4; }
.drag-handle { cursor: grab; color: #b5aca2; font-size: 17px; padding: 4px; }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.bar-col .bar { width: 100%; max-width: 34px; background: #2a78d6; border-radius: 4px 4px 0 0; min-height: 2px; transition: height .3s; position: relative; }
.bar-col .bar:hover { background: #1c5cab; }
.bar-col .bl { font-size: 10px; color: #898781; white-space: nowrap; }
.hbar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hbar-name { width: 170px; flex: none; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { flex: 1; background: #f2ece5; height: 18px; border-radius: 4px; overflow: hidden; }
.hbar-fill { height: 100%; background: #2a78d6; border-radius: 4px 4px 4px 4px; }
.hbar-val { width: 76px; flex: none; font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }
.line-mock { background: #849ebf22; border: 1px solid #d3ddea; border-radius: 14px; padding: 12px; }
.line-bubble { background: #fff; border-radius: 4px 14px 14px 14px; padding: 10px 12px; font-size: 13px; margin-top: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); white-space: pre-line; }
.adm-menu-toggle { display: none; }

@media (max-width: 860px) {
  .adm-side { position: fixed; z-index: 90; left: -240px; transition: left .2s; }
  .adm-side.open { left: 0; box-shadow: var(--shadow-lg); }
  .adm-main { padding: 16px 14px 60px; }
  .adm-menu-toggle { display: flex; }
}

/* ---------- พิมพ์ใบสั่งเข้าครัว ---------- */
@media print {
  body * { visibility: hidden; }
  #printSlip, #printSlip * { visibility: visible; }
  #printSlip { position: absolute; left: 0; top: 0; width: 58mm; font-size: 11px; }
}
#printSlip { font-family: 'Noto Sans Thai', monospace; }
#printSlip .slip-line { border-top: 1px dashed #000; margin: 6px 0; }

/* ---------- ไรเดอร์ ---------- */
body.rider { background: #f2f4f8; }
.rider-job { background: #fff; border: 1.5px solid #e3e6ee; border-radius: 16px; padding: 14px 16px; margin-top: 12px; }
.duty-banner { border-radius: 16px; padding: 16px 18px; color: #fff; display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.duty-banner.on { background: linear-gradient(120deg, #0ca30c, #0a8a0a); }
.duty-banner.off { background: #5a5650; }
.photo-proof { border: 2px dashed #c9cfdd; border-radius: 14px; padding: 18px; text-align: center; background: #fff; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.photo-proof img { max-height: 140px; border-radius: 10px; }

@media (min-width: 700px) {
  .menu-grid { grid-template-columns: repeat(3, 1fr); }
}

/* โหมดลดอีโมจิ: ไอคอน SVG และสไตล์ประกอบ */
.icon-btn svg { display: block; }
.courier-avatar svg, .logo-badge svg { width: 22px; height: 22px; }
.t-dot { font-weight: 800; color: #8d8378; }
.t-step.done .t-dot { color: #0a7d0a; }
.t-step.current .t-dot { color: #fff; }
.star-pick { color: #eda100; }
.c-img svg { width: 22px; height: 22px; }

/* ---------- รูปภาพจริง (โลโก้ / เมนู / แบนเนอร์) ---------- */
.logo-badge img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.banner.has-img h3, .banner.has-img p { position: relative; z-index: 1; }
.banner.has-img::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(40,10,20,.5), rgba(40,10,20,.04) 70%); }
.banner.has-img h3 { text-shadow: 0 1px 8px rgba(0,0,0,.4); }

/* ---------- แบนเนอร์ดาวน์โหลดแอป + ไอคอนสวย ๆ ---------- */
.icon-btn { color: var(--primary); box-shadow: 0 2px 8px rgba(60, 40, 20, .07); transition: transform .12s; }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; display: block; }
.pwa-banner {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 13px 14px;
  border-radius: 18px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--primary), var(--primary-dark));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 38%, transparent);
}
.pwa-banner::before {
  content: ""; position: absolute; right: -30px; top: -40px; width: 130px; height: 130px;
  border-radius: 99px; background: rgba(255, 255, 255, .12);
}
.pwa-ico {
  width: 48px; height: 48px; border-radius: 14px; background: #fff; flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .22);
}
.pwa-ico img { width: 100%; height: 100%; object-fit: cover; }
.pwa-install {
  background: #fff; color: var(--primary); font-weight: 800; border-radius: 999px;
  padding: 9px 18px; flex: none; box-shadow: 0 3px 10px rgba(0, 0, 0, .18); font-size: 14px;
  position: relative; z-index: 1;
}
.pwa-install:active { transform: scale(.95); }
.pwa-x {
  flex: none; width: 26px; height: 26px; border-radius: 99px; background: rgba(255, 255, 255, .2);
  color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
}

/* ---------- ค้นหาที่อยู่ + แผนที่จริง ---------- */
.addr-search { position: relative; display: flex; gap: 8px; }
.addr-search input {
  flex: 1; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px;
  background: #fff; outline: none;
}
.addr-search input:focus { border-color: var(--primary); }
.addr-results {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; z-index: 60;
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden;
  overflow-y: auto; max-height: 230px; box-shadow: var(--shadow-lg);
}
.addr-item { display: block; width: 100%; text-align: left; padding: 10px 12px; font-size: 12.5px; border-bottom: 1px dashed var(--line); background: #fff; }
.addr-item:last-child { border-bottom: none; }
.addr-item:hover { background: color-mix(in srgb, var(--primary) 6%, #fff); }
#leafMap { border-radius: 14px; z-index: 1; }
.mock-map .map-hint { z-index: 500; }
.shop-pin { font-size: 26px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
