/* 2026-10-18 Bellboy แบบแอปสวน (ทดสอบคนเดียว) — renderBellV2 ใน app.js */
.bv2-wrap { padding: 16px; }
.bv2-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; background: linear-gradient(135deg, #1e5f8c, #2d7fb8); color: #fff; border-radius: 12px; padding: 14px 18px; margin-bottom: 12px; }
.bv2-title { font-size: 18px; font-weight: 700; }
.bv2-test { font-size: 11px; font-weight: 700; background: #fde047; color: #713f12; border-radius: 6px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }
.bv2-prog { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.bv2-bar { display: inline-block; width: 70px; height: 6px; border-radius: 4px; background: #e5e7eb; overflow: hidden; vertical-align: middle; }
.bv2-bar > span { display: block; height: 100%; border-radius: 4px; }
.bv2-bar.big { width: 120px; background: rgba(255,255,255,.35); }
.bv2-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.bv2-tab { border: 1px solid #d0d7de; background: #fff; color: #1f2937; border-radius: 999px; padding: 7px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.bv2-tab.active { background: #1e5f8c; border-color: #1e5f8c; color: #fff; }
.bv2-tabn { font-size: 11px; opacity: .75; margin-left: 2px; }
.bv2-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin-bottom: 12px; }
.bv2-card { text-align: left; border: 1px solid #e5e7eb; border-left: 4px solid #2d7fb8; background: #fff; border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; color: #1f2937; display: flex; flex-direction: column; gap: 6px; min-height: 104px; }
.bv2-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.bv2-card.done { border-left-color: #15803d; }
.bv2-card-ic { font-size: 20px; }
.bv2-card-name { font-weight: 600; font-size: 14px; line-height: 1.3; flex: 1; }
.bv2-card-meta { display: flex; align-items: center; gap: 8px; }
.bv2-card-meta .bv2-bar { flex: 1; }
.bv2-card-num { font-size: 12px; font-weight: 700; color: #475569; white-space: nowrap; }
.bv2-hint { font-size: 12px; margin: 4px 2px 8px; }
.bv2-tblwrap { overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 10px; }
.bv2-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12px; }
.bv2-table th { background: #f1f5f9; font-weight: 600; color: #475569; padding: 6px 4px; text-align: center; white-space: nowrap; border-bottom: 1px solid #e5e7eb; }
.bv2-table th.today, .bv2-table td.today { background: #e0f2fe; }
.bv2-colsub { font-size: 10px; font-weight: 400; color: #94a3b8; }
.bv2-table td { padding: 4px 3px; text-align: center; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.bv2-table .bv2-name { text-align: left; position: sticky; left: 0; background: #fff; z-index: 2; min-width: 170px; max-width: 220px; padding: 6px 8px; font-weight: 600; cursor: pointer; }
.bv2-table th.bv2-name { background: #f1f5f9; }
.bv2-table .bv2-sum { position: sticky; left: 186px; background: #fff; z-index: 2; border-right: 2px solid #dee2e6; padding: 4px 6px; }
.bv2-table th.bv2-sum { background: #f1f5f9; }
.bv2-ic { margin-right: 2px; }
.bv2-slot { font-size: 10px; font-weight: 400; color: #94a3b8; }
.bv2-td.clickable { cursor: pointer; }
.bv2-td.clickable:hover { background: #f8fafc; }
.bv2-chip { display: inline-block; border-radius: 5px; font-weight: 700; font-size: 11px; padding: 3px 5px; min-width: 36px; }
.bv2-chip.big { font-size: 12px; font-weight: 800; padding: 3px 7px; min-width: 42px; border-radius: 6px; }
.bv2-table.compact .bv2-chip:not(.big) { font-size: 10px; min-width: 30px; padding: 3px 2px; }
.bv2-dot { color: #cbd5e1; }
.bv2-sub { font-size: 9.5px; color: #64748b; line-height: 1.2; margin-top: 2px; white-space: nowrap; }
.bv2-by { color: #1e5f8c; max-width: 56px; overflow: hidden; text-overflow: ellipsis; margin: 0 auto; }
.bv2-total td { background: #f8fafc; border-top: 2px solid #cbd5e1; }
.bv2-total .bv2-name, .bv2-total .bv2-sum { background: #f8fafc; }
@media (max-width: 640px) {
  .bv2-wrap { padding: 10px; }
  .bv2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bv2-bar.big { width: 80px; }
}
/* 22ต.ค. ตารางพอดีจอทุกขนาด — คอลัมน์แบ่งความกว้างเท่ากัน ตัวอักษร/ป้ายย่อขยายตามจอ (แทนชุด 19ต.ค. ที่ใหญ่เกิน) */
.bv2-table { --nw: clamp(112px, 13vw, 230px); --sw: clamp(46px, 4.2vw, 64px); table-layout: fixed; width: 100%; font-size: clamp(10.5px, .78vw, 13px); }
.bv2-table.compact { min-width: calc(var(--nw) + var(--sw) + 31 * 29px); }
.bv2-table:not(.compact) { min-width: calc(var(--nw) + var(--sw) + 12 * 44px); }
.bv2-table th { padding: 6px 1px; font-size: clamp(10px, .74vw, 12.5px); overflow: hidden; text-overflow: ellipsis; }
.bv2-table td { padding: 4px 1px; overflow: hidden; }
.bv2-table .bv2-name { width: var(--nw); min-width: 0; max-width: none; box-sizing: border-box; padding: 6px 8px; font-size: clamp(11px, .8vw, 13.5px); line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
.bv2-table .bv2-sum { width: var(--sw); left: var(--nw); box-sizing: border-box; padding: 4px 3px; }
.bv2-colsub { font-size: clamp(9px, .62vw, 11px); }
.bv2-chip, .bv2-table.compact .bv2-chip:not(.big) { display: block; box-sizing: border-box; width: 100%; max-width: 52px; min-width: 0; margin: 0 auto; padding: 3px 0; font-size: clamp(9px, .66vw, 12px); border-radius: 5px; text-align: center; }
.bv2-chip.big { max-width: 60px; padding: 4px 0; font-size: clamp(10px, .76vw, 13.5px); }
.bv2-sub { font-size: clamp(8px, .56vw, 10.5px); overflow: hidden; text-overflow: ellipsis; }
.bv2-by { max-width: 100%; }
.bv2-dot { font-size: clamp(12px, .9vw, 16px); }
/* 20ต.ค. ธีมมืด — เดิมสีขาวตายตัว เปลี่ยนธีมแล้วตารางยังขาว */
:root[data-theme="dark"] .bv2-tab { background: var(--card); border-color: var(--border); color: var(--text); }
:root[data-theme="dark"] .bv2-tab.active { background: #1e5f8c; border-color: #2d7fb8; color: #fff; }
:root[data-theme="dark"] .bv2-card { background: var(--card); border-color: var(--border); border-left-color: #2d7fb8; color: var(--text); }
:root[data-theme="dark"] .bv2-card.done { border-left-color: #22c55e; }
:root[data-theme="dark"] .bv2-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.4); }
:root[data-theme="dark"] .bv2-card-num { color: var(--text2); }
:root[data-theme="dark"] .bv2-bar { background: var(--bg3); }
:root[data-theme="dark"] .bv2-bar.big { background: rgba(255,255,255,.25); }
:root[data-theme="dark"] .bv2-tblwrap { border-color: var(--border); }
:root[data-theme="dark"] .bv2-table { color: var(--text); }
:root[data-theme="dark"] .bv2-table th,
:root[data-theme="dark"] .bv2-table th.bv2-name,
:root[data-theme="dark"] .bv2-table th.bv2-sum { background: var(--bg2); color: var(--text2); border-bottom-color: var(--border); }
:root[data-theme="dark"] .bv2-table td { border-bottom-color: var(--border-soft); }
:root[data-theme="dark"] .bv2-table .bv2-name,
:root[data-theme="dark"] .bv2-table .bv2-sum { background: var(--card); color: var(--text); }
:root[data-theme="dark"] .bv2-table .bv2-sum { border-right-color: var(--border); }
:root[data-theme="dark"] .bv2-table th.today,
:root[data-theme="dark"] .bv2-table td.today { background: #0c4a6e; }
:root[data-theme="dark"] .bv2-td.clickable:hover { background: var(--card2); }
:root[data-theme="dark"] .bv2-colsub, :root[data-theme="dark"] .bv2-slot { color: var(--text3); }
:root[data-theme="dark"] .bv2-dot { color: var(--text3); }
:root[data-theme="dark"] .bv2-sub { color: var(--text2); }
:root[data-theme="dark"] .bv2-by { color: #7cc4f5; }
:root[data-theme="dark"] .bv2-total td,
:root[data-theme="dark"] .bv2-total .bv2-name,
:root[data-theme="dark"] .bv2-total .bv2-sum { background: var(--bg2); border-top-color: var(--border); }

/* 23ต.ค. แถวย่อย — หัวข้อในฟอร์มทำความสะอาด Lobby แตกออกมาในตาราง */
.bv2-table tr.bv2-subrow td { background: #fafcff; }
.bv2-table tr.bv2-subrow .bv2-subname { font-weight: 500; padding-left: 18px; color: #334155; background: #f8fafc; }
.bv2-subhint { font-size: 10.5px; font-weight: 400; color: #94a3b8; line-height: 1.2; }
.bv2-table tr.bv2-subrow .bv2-chip { opacity: .92; }
:root[data-theme="dark"] .bv2-table tr.bv2-subrow td,
:root[data-theme="dark"] .bv2-table tr.bv2-subrow .bv2-subname { background: #111827; color: #cbd5e1; }
:root[data-theme="dark"] .bv2-subhint { color: #64748b; }

/* 23ต.ค. ตารางเลื่อนได้ทั้งแนวนอน/แนวตั้งในตัวตาราง — หัววัน+คอลัมน์หัวข้อ/สรุป ติดอยู่ตอนเลื่อน */
.bv2-tblwrap { overflow: auto; max-height: calc(100vh - 170px); min-height: 240px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.bv2-table thead th { position: sticky; top: 0; z-index: 3; box-shadow: inset 0 -1px 0 #e5e7eb; }
.bv2-table thead th.bv2-name, .bv2-table thead th.bv2-sum { z-index: 5; }
:root[data-theme="dark"] .bv2-table thead th { box-shadow: inset 0 -1px 0 var(--border); }
@media (max-width: 640px) { .bv2-tblwrap { max-height: calc(100vh - 120px); } }
