/* =========================================
   ระบบสั่งอาหาร QR — Styles
   ========================================== */
/* ฟอนต์ไทยทันสมัยทั้งระบบ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700;800&display=swap');
body, .btn, .form-control, .form-select, .input-group-text, .badge, .dropdown-item, .nav-link, .modal-title {
  font-family: 'Noto Sans Thai', 'Leelawadee UI', Tahoma, sans-serif !important;
}

body { background: #f4f6f3; }

/* Login */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f5132 0%, #157347 100%); }
.login-card { width: 100%; max-width: 400px; border: 0; border-radius: 1rem; }
.login-icon { font-size: 3rem; }

/* คิวครัว */
.order-col { max-height: calc(100vh - 170px); overflow-y: auto; padding-right: 2px; }
.order-card { border: 0; border-radius: .7rem; }
.order-new { border-left: 5px solid #dc3545; animation: pulse 1.5s ease-in-out 3; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.015); } 100% { transform: scale(1); } }

/* ===== หน้าลูกค้า (mobile-first) — ใช้สีประจำร้านจาก CSS variables ===== */
:root { --shop-color: #157347; --shop-color-dark: #0f5132; --header-h: 64px; }
.cust-body { background: #fffdf7; padding-bottom: 90px; overflow-x: hidden; }
.cust-header {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(135deg, var(--shop-color-dark), var(--shop-color)); color: #fff;
  padding: .6rem .75rem; box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.cust-header .d-flex.justify-content-between { flex-wrap: wrap; row-gap: .45rem; }
@media (max-width: 420px) {
  #shopName { font-size: 1.05rem !important; }
  .cust-header .btn-sm { padding: .2rem .5rem; font-size: .78rem; }
  .cust-header img { height: 32px !important; width: 32px !important; }
}

/* แท็บหมวด sticky ตามความสูง header จริง */
.cust-tabs {
  position: sticky; top: var(--header-h); z-index: 99;
}
.menu-card { display: flex; gap: .8rem; background: #fff; border-radius: .8rem; padding: .7rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.08); margin-bottom: .7rem; align-items: center; }
.menu-thumb { width: 64px; height: 64px; border-radius: .6rem; object-fit: cover; flex-shrink: 0;
  background: #e9ecef; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.menu-price { color: #b02a37; font-weight: 700; }
.menu-add-btn { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; }

/* Lightbox รูปซัพพอร์ต (กดรูป → popup เต็ม) */
.lb-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.87);
  z-index: 3000; display: flex; align-items: center; justify-content: center;
  cursor: zoom-out; animation: lbFade .15s ease-out;
}
.lb-overlay img { max-width: 94vw; max-height: 92vh; border-radius: .5rem; box-shadow: 0 0 40px rgba(0,0,0,.7); }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }

/* ==========================================
   POS — จอขาย 3 ส่วน (โต๊ะ | เมนู | ตะกร้า)
   ========================================== */
.pos-body { background: #f4f6f3; }
.pos-wrap { display: flex; height: calc(100vh - 56px); overflow: hidden; }
.pos-side {
  width: 230px; flex-shrink: 0; background: #fff; border-right: 1px solid #e5e7eb;
  overflow-y: auto;
}
.pos-menu { flex-grow: 1; overflow-y: auto; background: #f8f9fa; }
.pos-cart {
  width: 300px; flex-shrink: 0; background: #fff; border-left: 1px solid #e5e7eb;
  display: flex; flex-direction: column; overflow: hidden;
}
.pos-cart > #posCartItems { flex-grow: 1; overflow-y: auto; }
.pos-cart-foot { background: #f8f9fa; }
.sticky-pos { position: sticky; top: 0; z-index: 5; }

.pos-table {
  display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem;
  border: 1px solid #e5e7eb; border-radius: .6rem; margin-bottom: .4rem;
  cursor: pointer; background: #fff; transition: all .1s;
}
.pos-table:hover { border-color: #157347; }
.pos-table.sel { border-color: #157347; background: #f0fff4; box-shadow: inset 3px 0 0 #157347; }
.pos-table .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.pos-item {
  background: #fff; border: 1px solid #e5e7eb; border-radius: .9rem;
  padding: .6rem; cursor: pointer; transition: all .12s; position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.pos-item:hover { border-color: #157347; box-shadow: 0 4px 14px rgba(21,115,71,.18); transform: translateY(-2px); }
.pos-item:active { transform: scale(.97); }
.pos-thumb {
  width: 100%; height: 130px; border-radius: .6rem; background: #e9ecef;
  display: flex; align-items: center; justify-content: center; font-size: 3rem;
  margin-bottom: .5rem; overflow: hidden;
}
.pos-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pos-item .it-name { font-weight: 700; font-size: 1rem; line-height: 1.25; min-height: 2.5em; }
.pos-item .menu-price { font-size: 1.05rem; }
.pos-add {
  width: 34px; height: 34px; border-radius: 50%; background: #157347; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.25rem;
  box-shadow: 0 2px 6px rgba(21,115,71,.35);
}
.pos-item:hover .pos-add { background: #0f5132; transform: scale(1.1); }

.pos-cart-item {
  display: flex; justify-content: space-between; align-items: center; gap: .4rem;
  border: 1px solid #e5e7eb; border-radius: .5rem; padding: .45rem .55rem; margin-bottom: .4rem;
}

/* มือถือ: เรียงแนวตั้ง */
@media (max-width: 767.98px) {
  .pos-wrap { display: block; height: auto; overflow: visible; }
  .pos-side { width: auto; border-right: 0; border-bottom: 1px solid #e5e7eb; max-height: none; position: static; }
  .pos-menu { height: auto; overflow: visible; }
  .pos-cart { width: auto; border-left: 0; border-top: 1px solid #e5e7eb; height: auto; }
  .pos-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .pos-thumb { height: 110px; }
  .pos-item .it-name { font-size: .9rem; }
}

/* แถวยอดนิยม 5 อันดับ (เลื่อนแนวนอน) */
.top-scroll {
  display: flex; gap: .6rem; overflow-x: auto; padding: 2px 2px 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.top-scroll::-webkit-scrollbar { height: 5px; }
.top-scroll::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
.top-card {
  min-width: 128px; max-width: 128px; scroll-snap-align: start;
  background: #fff; border-radius: .7rem; padding: .55rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.1); cursor: pointer;
  border: 1px solid #eee; transition: transform .1s;
}
.top-card:active { transform: scale(.96); }
.top-thumb {
  width: 100%; height: 74px; border-radius: .5rem; background: #e9ecef;
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
  margin-bottom: .4rem; overflow: hidden;
}
.top-thumb img { width: 100%; height: 100%; object-fit: cover; }
.text-truncate-2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ปุ่ม/ส่วนประกอบใช้สีประจำร้าน */
.cust-body .btn-success { background: var(--shop-color) !important; border-color: var(--shop-color) !important; }
.cust-body .btn-success:hover, .cust-body .btn-success:active { filter: brightness(.9); }
.menu-add-btn { background: var(--shop-color) !important; border-color: var(--shop-color) !important; }
#catTabs .btn-success { background: var(--shop-color) !important; border-color: var(--shop-color) !important; }
#catTabs .btn-outline-success { color: var(--shop-color) !important; border-color: var(--shop-color) !important; }
.top-card { border-top: 3px solid var(--shop-color); }

/* ปุ่มเลือกสีสำเร็จรูป (หน้าตั้งค่าร้าน) */
.swatch { width: 34px; height: 34px; border-radius: 8px; border: 2px solid #fff; box-shadow: 0 0 0 1px #ccc; }
.swatch:active { transform: scale(.92); }

/* ปรับ cart-bar ให้ไม่ล้นจอเล็ก */
.cart-bar { gap: .5rem; }
.cart-bar .btn { white-space: nowrap; }

/* แถบตะกร้าลอย */
.cart-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: #fff; box-shadow: 0 -2px 12px rgba(0,0,0,.15);
  padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; align-items: center;
}
.cart-badge { background: #dc3545; color: #fff; border-radius: 10px; padding: 1px 8px; font-size: .8rem; }

/* Modal เลือกตัวเลือก */
.opt-group { border: 1px solid #e0e0e0; border-radius: .6rem; padding: .7rem; margin-bottom: .7rem; }
.opt-group-title { font-weight: 700; font-size: .95rem; }
.opt-group-title .req { color: #dc3545; font-size: .75rem; }
.opt-group-title .type { color: #6c757d; font-size: .75rem; font-weight: normal; }
.opt-value-row { display: flex; justify-content: space-between; align-items: center; padding: .35rem 0; }
/* 🎨 ปุ่มไอคอนเรียงด้านบนกล่องกลุ่มตัวเลือก (หน้าจัดการเมนู) */
.opt-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.opt-actions { display: flex; align-items: center; gap: .3rem; flex-shrink: 0; }
.opt-icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid #dee2e6;
  background: #f8f9fa; font-size: .85rem; line-height: 1; display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer; transition: background .12s;
}
.opt-icon-btn:hover { background: #e9ecef; }
.opt-icon-btn.danger { color: #dc3545; border-color: #f5c2c7; background: #fff5f5; }
.opt-icon-btn.danger:hover { background: #ffe3e6; }
.opt-group-edit { display: none; flex-wrap: wrap; gap: .4rem; align-items: center;
  margin: .35rem 0 .5rem; background: #f8f9fa; border: 1px dashed #ced4da;
  border-radius: .5rem; padding: .5rem; }
.opt-group-edit .ge-name { flex: 1 1 140px; }
.opt-group-edit .ge-type { max-width: 135px; }
.opt-group-edit .ge-req-wrap { margin: 0; padding: 0 .4rem; }
.opt-value-row .opt-value-name { font-weight: 600; }
/* 🖼 รูปย่อหน้าชื่อเมนู (ตาราง + การ์ดมือถือ) */
.mi-thumb {
  width: 42px; height: 42px; object-fit: cover; border-radius: 8px;
  border: 1px solid #e9ecef; background: #fff; flex-shrink: 0;
}
.mi-thumb-empty {
  width: 42px; height: 42px; border-radius: 8px;
  border: 1px dashed #ced4da; background: #f8f9fa;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
/* ===== รายการเมนู (flex list — โครงสร้างเดียว ทำงานเหมือนกันทุกเครื่อง) ===== */
.menu-list { padding: .25rem 0; }
.menu-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .9rem; border-bottom: 1px solid #f1f3f5;
}
.menu-row:hover { background: #f8faf9; }
.mr-actions { display: flex; gap: .3rem; flex-shrink: 0; order: 3; }
.mr-main { flex: 1 1 auto; min-width: 0; order: 1; }
.mr-name { min-width: 0; word-break: break-word; }
.mr-meta { display: flex; align-items: center; gap: 1.1rem; flex-shrink: 0; order: 2; font-size: .92rem; }
.mr-label { display: none; }
/* 📱 มือถือ: การ์ดแยกรายการ — ปุ่มจัดการอยู่แถวบนขวา */
@media (max-width: 767.98px) {
  .menu-row {
    position: relative; flex-wrap: wrap; align-items: flex-start;
    margin: .7rem .5rem; padding: 3.3rem .95rem .85rem;
    border: 1px solid #e9ecef; border-radius: .9rem;
    background: #fff; box-shadow: 0 1px 5px rgba(0,0,0,.07);
  }
  .mr-actions { position: absolute; top: .6rem; right: .55rem; }
  .mr-actions .btn { padding: .32rem .48rem; font-size: .88rem; }
  .mr-actions .btn .btn-label { display: none !important; }
  .mr-main { flex: 1 1 100%; }
  .mr-meta { flex: 1 1 100%; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .84rem; padding-top: .45rem; border-top: 1px dashed #eef1f0; margin-top: .5rem; }
  .mr-label { display: inline; color: #6c757d; font-weight: 600; font-size: .76rem; }
}

/* สถานะออเดอร์ลูกค้า */
.order-timeline { border-left: 3px solid #dee2e6; padding-left: 1rem; margin-left: .4rem; }
.step { position: relative; padding-bottom: 1rem; }
.step::before { content: ''; position: absolute; left: -1.55rem; top: .25rem; width: .9rem; height: .9rem;
  border-radius: 50%; background: #adb5bd; }
.step.active::before { background: #198754; box-shadow: 0 0 0 3px #19875433; }

/* โต๊ะ */
.table-card { border: 0; border-radius: .8rem; box-shadow: 0 1px 5px rgba(0,0,0,.08); }
.table-status-available { border-top: 5px solid #198754; }
.table-status-occupied { border-top: 5px solid #dc3545; }
.table-status-disabled { border-top: 5px solid #6c757d; opacity: .75; }

/* Toast — จัดกึ่งกลางจอ (กัน iOS Safari ที่มี horizontal overflow แล้ว toast หลุดจอด้านขวา) */
.app-toast {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  width: max-content;
  max-width: calc(100vw - 2rem);
  min-width: 280px;
}

/* ===== โหมดเต็มจอ (Fullscreen) ===== */
.fs-exit { position: fixed; top: 8px; right: 8px; z-index: 2000; display: none; opacity: .55; }
.fs-exit:hover { opacity: 1; }
body.fs-mode .fs-exit { display: block; }
body.kds.fs-mode .order-col { max-height: calc(100vh - 175px); }
body.pos-body.fs-mode .pos-wrap { height: calc(100vh - 56px); }

/* ---------- 📱 แถบเมนูล่างสำหรับมือถือ (หลังบ้าน) ---------- */
.mobile-bottomnav{
  position:fixed;left:0;right:0;bottom:0;z-index:1030;
  display:flex;background:#fff;border-top:1px solid #e5e7eb;
  box-shadow:0 -4px 14px rgba(0,0,0,.08);
  padding:6px 6px calc(6px + env(safe-area-inset-bottom));
}
.mobile-bottomnav .bn-item{
  flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;
  color:#6b7280;text-decoration:none;font-size:.68rem;font-weight:600;
  background:none;border:0;padding:4px 0;border-radius:10px;
}
.mobile-bottomnav .bn-item i{font-size:1.3rem;line-height:1}
.mobile-bottomnav .bn-item:active{background:#f3f4f6}
.mobile-bottomnav .bn-item.active{color:#157347}
.mobile-bottomnav .bn-item.active i{transform:translateY(-2px)}
@media (max-width:991.98px){ body{padding-bottom:72px} }

/* ---------- 🔍 Lightbox ดูรูปเมนูเต็มจอ (หน้าลูกค้า) ---------- */
#imgViewer {
  position: fixed; inset: 0; z-index: 4000;
  background: rgba(0,0,0,.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px; cursor: zoom-out;
}
#imgViewer #ivImg {
  max-width: 96vw; max-height: 82vh; object-fit: contain;
  border-radius: 12px; box-shadow: 0 10px 60px rgba(0,0,0,.6);
}
#imgViewer .iv-name {
  margin-top: 12px; color: #fff; font-weight: 700; text-align: center;
  max-width: 90vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#imgViewer .iv-close {
  position: absolute; top: 10px; right: 12px;
  background: rgba(255,255,255,.15); color: #fff; border: 0;
  width: 40px; height: 40px; border-radius: 50%; font-size: 18px; font-weight: 700;
}
#imgViewer .iv-close:active { background: rgba(255,255,255,.3); }

/* ==========================================
   Kitchen Display System (KDS) — ธีมเข้ม
   ========================================== */
body.kds { background: #111827; color: #e5e7eb; }
body.kds .navbar { border-bottom: 2px solid #1f2937; }
.kds-top { background: #1f2937; border-bottom: 1px solid #374151; position: sticky; top: 0; z-index: 50; }
.kds-chip {
  background: #374151; color: #e5e7eb; border-radius: 999px;
  padding: .3rem .9rem; font-size: .85rem; display: inline-flex; gap: .35rem; align-items: center;
}
.kds-chip.c-new b { color: #fca5a5; }
.kds-chip.c-cook b { color: #fcd34d; }
.kds-chip.c-done b { color: #86efac; }
.kds-chip.c-paid b { color: #93c5fd; }
.kds-btn { background: #374151; color: #e5e7eb; border: 1px solid #4b5563; }
.kds-btn:hover { background: #4b5563; color: #fff; }

.kds-col-header {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 1.05rem; color: #fff;
  border-radius: .6rem .6rem 0 0; padding: .55rem .9rem;
}
.kds-col-header.h-new  { background: #b91c1c; }
.kds-col-header.h-cook { background: #b45309; }
.kds-col-header.h-done { background: #15803d; }
.kds-col-header.h-paid { background: #1d4ed8; }
.kds-count {
  background: rgba(255,255,255,.25); border-radius: 999px; padding: 0 .7rem;
  font-size: 1rem; min-width: 2rem; text-align: center;
}

.kds-card {
  background: #1f2937; border-radius: .8rem; padding: .8rem .9rem;
  border-left: 6px solid #4b5563; margin-bottom: .8rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
  overflow: hidden; min-width: 0;
}
.kds-card.card-new { border-left-color: #ef4444; }
.kds-card.card-late { border-left-color: #ef4444; box-shadow: 0 0 0 2px #ef444455, 0 2px 6px rgba(0,0,0,.4); }
.kds-card.card-next { border-left-color: #22d3ee; box-shadow: 0 0 0 2px #22d3ee66, 0 2px 6px rgba(0,0,0,.4); }
.k-next {
  background: #164e63; color: #a5f3fc; font-size: .8rem; font-weight: 700;
  border-radius: .4rem; padding: .25rem .5rem; margin-bottom: .45rem; display: inline-block;
}
/* 🍳 แผงแนะนำเมนูทำรวมกันได้ */
.kds-batch {
  background: #1f2937; border: 1px solid #374151; border-left: 6px solid #f59e0b;
  border-radius: .8rem; padding: .7rem .9rem;
}
.kds-batch .kb-title { color: #fbbf24; font-weight: 800; font-size: .95rem; margin-bottom: .45rem; }
.kds-batch .kb-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.kds-batch .kb-chip {
  background: #374151; color: #f9fafb; border-radius: 999px;
  padding: .3rem .8rem; font-size: .9rem;
}
.kds-batch .kb-chip b { color: #fbbf24; }
.kds-batch .kb-chip small { color: #9ca3af; }
.k-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.k-table { font-size: 1.25rem; font-weight: 800; color: #fff; }
.k-timer { font-size: .8rem; font-weight: 700; border-radius: 999px; padding: .1rem .6rem; white-space: nowrap; }
.k-timer.t-ok   { background: #064e3b; color: #6ee7b7; }
.k-timer.t-warn { background: #78350f; color: #fcd34d; }
.k-timer.t-late { background: #7f1d1d; color: #fca5a5; animation: latePulse 1.2s ease-in-out infinite; }
@keyframes latePulse { 50% { opacity: .55; } }
.k-no { font-size: .75rem; color: #9ca3af; letter-spacing: .03em; margin: .1rem 0 .5rem; }
.k-item { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem 0; border-bottom: 1px dashed #374151; }
.k-item:last-child { border-bottom: 0; }
.k-qty {
  min-width: 2rem; height: 2rem; border-radius: .5rem;
  background: #f59e0b; color: #111827; font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
}
.k-name { font-weight: 700; color: #f9fafb; font-size: 1.02rem; word-break: break-word; }
.k-opt { font-size: .8rem; color: #93c5fd; }
.k-note { font-size: .8rem; color: #fca5a5; background: #450a0a; border-radius: .4rem; padding: .15rem .5rem; display: inline-block; }
.kds-note { background: #78350f !important; color: #fde68a; border: 0; padding: .35rem .6rem; font-size: .85rem; }
.k-total-line { display: flex; justify-content: flex-end; align-items: center; margin-top: .55rem; }
.k-total { font-weight: 700; color: #9ca3af; font-size: 1.05rem; }
.k-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.k-actions .kds-btn-lg { flex: 1 1 auto; padding: .45rem .55rem; font-size: .95rem; text-align: center; white-space: nowrap; }
.k-actions .k-sq { flex: 0 0 auto; }
.kds-btn-lg { font-weight: 700; border-radius: .5rem; }
/* 🎛 ปุ่มไอคอนควบคุม KDS — ใหญ่ แตะง่าย สีเขียว = เปิด */
.kds-ctl-row { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.kds-ctl {
  min-width: 58px; min-height: 52px; border-radius: .8rem;
  background: #374151; border: 1px solid #4b5563; color: #e5e7eb;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: .68rem; font-weight: 600; padding: .3rem .5rem; cursor: pointer;
}
.kds-ctl i { font-size: 1.3rem; line-height: 1; }
.kds-ctl.active { background: #14532d; border-color: #16a34a; color: #86efac; }
.kds-ctl:active { transform: scale(.95); }
.kds-ctl:disabled { opacity: .45; cursor: not-allowed; }
/* 🎯 ตัวกรองประเภทออเดอร์: โต๊ะ (อาหาร) / ออนไลน์ (ร้านขายของชำ) */
.kds-filter .kf-btn { border-radius: 999px; background: #374151; border: 1px solid #4b5563; color: #e5e7eb; font-weight: 600; }
.kds-filter .kf-btn.active { background: #14532d; border-color: #16a34a; color: #86efac; }
.kds-card.card-online { border-left-color: #a78bfa; }
@media (max-width: 575.98px) { .kds-ctl { min-width: 0; flex: 1 1 0; } }
.b-cook   { background: #f59e0b; color: #111827; }
.b-cook:hover { background: #d97706; color: #111827; }
.b-done   { background: #16a34a; color: #fff; }
.b-done:hover { background: #15803d; color: #fff; }
.b-cancel { background: #4b5563; color: #e5e7eb; }
.b-call { background: #0ea5e9; color: #fff; }
.b-call:hover { background: #0284c7; color: #fff; }
.k-status-row { display: flex; margin: .1rem 0 .45rem; }
.k-badge-call { background: #0c4a6e; color: #7dd3fc; border-radius: .5rem; padding: .3rem .6rem; font-size: .8rem; font-weight: 600; white-space: normal; text-align: center; flex: 1 1 100%; }
.k-badge-call.b-confirmed { background: #14532d; color: #86efac; }
.k-badge-call.b-acked { background: #3f3f46; color: #fde68a; }
.kds-empty { text-align: center; color: #6b7280; padding: 2.5rem 0; font-size: 1.05rem; }

/* รายการเรียกพนักงาน */
.kds-calls { background: #7f1d1d; border: 1px solid #b91c1c; border-radius: .8rem; padding: .8rem; }
.kds-calls-title { font-weight: 800; color: #fecaca; font-size: 1.05rem; margin-bottom: .5rem; }
.kds-call-row {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  background: rgba(0,0,0,.25); border-radius: .5rem; padding: .45rem .7rem; margin-top: .4rem;
}
.kds-call-row.late { outline: 2px solid #ef4444; }
.k-call-table { font-weight: 800; color: #fff; font-size: 1.1rem; }
.k-call-msg { color: #fecaca; flex-grow: 1; }

/* ปรับ scrollbar คอลัมน์ให้เข้าธีม */
body.kds .order-col::-webkit-scrollbar { width: 8px; }
body.kds .order-col::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 4px; }

/* ===== หน้าจัดการ (admin) ทันสมัย ===== */
.modern-card {
  border: 0; border-radius: 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.modern-card .card-header { border-radius: 1rem 1rem 0 0 !important; }
.modern-card .form-control-sm, .modern-card .form-select-sm { border-radius: .5rem; }
.modern-card td { padding-top: .55rem; padding-bottom: .55rem; }
.modern-card tbody tr:hover { background: #f8faf9; }
.table-light th { font-weight: 600; color: #5c6b63; }

/* แจ้งเตือนเรียกพนักงาน (กะพริบเรียกความสนใจ) */
.call-flash { animation: callBlink 1s ease-in-out 5; }
@keyframes callBlink { 0%,100% { background: transparent; } 50% { background: #fff3cd; } }

/* การ์ดสถิติ (หน้ารายงาน) */
.stat-card { border: 0; border-radius: .8rem; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.stat-card .stat-num { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat-card .stat-label { font-size: .8rem; color: #6c757d; }

/* QR สำหรับพิมพ์ */
.qr-print-area { text-align: center; }
.qr-print-area .qr-box { display: inline-block; border: 2px dashed #999; padding: 16px; margin: 8px; }
@media print {
  body * { visibility: hidden; }
  .qr-print-area, .qr-print-area * { visibility: visible; }
  .qr-print-area { position: absolute; left: 0; top: 0; width: 100%; }
}
