/* ═══════════════════════════════════════════════════════════════
   theme2.css — ธีมใหม่ member "แผงหวย" (vibrant ticket theme)
   ใช้คู่กับ layout views/main2.ejs เท่านั้น (โหลดทับ core.css/custom.css)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --lt-ink: #2b2140;
  --lt-ink-soft: #7a7090;
  --lt-canvas: #f5f2f8;
  --lt-card: #ffffff;
  --lt-chili: #f03e52;
  --lt-tangerine: #ff7a3c;
  --lt-marigold: #ffb020;
  --lt-leaf: #0e9f6e;
  /* สีตัวเลขบวก/ลบ ชุดเดียวทั้งระบบ:
     พื้นสว่างใช้ chili/leaf, พื้นเข้ม (แถบสรุป .lt-rpt-total/.lt-rp-total/.lt-path-total/tfoot) ใช้เฉดสว่างขึ้น
     ห้ามใส่ hex แดง/เขียวใหม่ตรง ๆ ให้ใช้ตัวแปร 4 ตัวนี้ */
  --lt-neg: var(--lt-chili);
  --lt-pos: var(--lt-leaf);
  --lt-neg-dark: #ff6b74;
  --lt-pos-dark: #6ee7b7;
  --lt-line: rgba(43, 33, 64, 0.1);
  --lt-shadow: 0 2px 10px rgba(43, 33, 64, 0.08);
  --lt-chrome: linear-gradient(115deg, var(--lt-chili), var(--lt-tangerine) 55%, var(--lt-marigold));
  --lt-font-display: "Mitr", "Anuphan", sans-serif;
  --lt-font-body: "Anuphan", "Mitr", sans-serif;
  /* Anuphan รองรับ tabular figures — Chakra Petch ไม่รองรับ ทำตัวเลขเต้นทุกวินาที */
  --lt-font-digit: "Anuphan", sans-serif;
}

/* .text-danger/.text-success ของ Bootstrap (#ff4c51 / #28c76f) ที่ตารางเดิมใส่ให้ตัวเลข ให้เป็นเฉดเดียวกับการ์ด theme2
   วางไว้ต้นไฟล์เพื่อให้กฎเฉพาะทาง (แถบพื้นเข้ม) ที่อยู่ถัดลงไปทับได้ */
.lt-body .text-danger { color: var(--lt-neg) !important; }
.lt-body .text-success { color: var(--lt-pos) !important; }
/* บนแถบพื้นเข้มทุกชนิดใช้เฉดสว่าง (specificity เท่ากฎข้างบนแต่มาทีหลังจึงชนะ) */
.lt-rpt-total .text-danger, .lt-rp-total .text-danger, .lt-path-total .text-danger, .lt-num-total .text-danger { color: var(--lt-neg-dark) !important; }
.lt-rpt-total .text-success, .lt-rp-total .text-success, .lt-path-total .text-success, .lt-num-total .text-success { color: var(--lt-pos-dark) !important; }

body.lt-body {
  background: var(--lt-canvas);
  color: var(--lt-ink);
  font-family: var(--lt-font-body);
}
/* หัวข้อใช้ font เดียวกับเนื้อหา (ต่างที่น้ำหนัก) — Mitr เหลือเฉพาะชื่อแบรนด์บน header */
.lt-body h1, .lt-body h2, .lt-body h3, .lt-body h4, .lt-body h5, .lt-body h6,
.lt-body .modal-title {
  font-family: var(--lt-font-body);
  font-weight: 600;
  color: var(--lt-ink);
}
/* ตัวเลขที่เดินตลอดเวลา (countdown ทุกหน้า) — เลขกว้างเท่ากัน ไม่ทำ layout ขยับ */
.lt-body .countdown {
  font-family: var(--lt-font-digit);
  font-weight: 600;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
/* หัวตารางเข้ม (จาก custom.css เดิม) → ไล่เฉดสีแบรนด์ ให้มีสีสันแทนสีทึบ */
.lt-body .table-custom-color {
  --bs-table-bg: var(--lt-ink);
  --bs-table-border-color: rgba(255, 255, 255, 0.2);
}
.lt-body thead.table-custom-color th,
.lt-body tfoot.table-custom-color td {
  background-image: linear-gradient(90deg, var(--lt-chili), #f0602c 55%, #d97706);
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.22);
  font-size: 1rem;
}
.lt-body thead.table-custom-color th:first-child { border-start-start-radius: 10px; }
.lt-body thead.table-custom-color th:last-child { border-start-end-radius: 10px; }
/* Vuexy ใส่กรอบขาว+เงาให้ tab-content ที่ตามหลัง nav-pills (core.css `.nav-pills ~ .tab-content`)
   — ทำกล่องมุมเหลี่ยมโผล่หลังการ์ด ปิดทิ้งทั้งธีม */
.lt-body .nav-pills ~ .tab-content {
  border: 0 !important;
  box-shadow: none !important;
}

/* ── Header (chrome ไล่เฉด + ขอบหยักแบบรอยฉีกตั๋ว) ─────────────── */
.lt-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--lt-chrome);
  color: #fff;
  box-shadow: 0 2px 14px rgba(240, 62, 82, 0.3);
}
.lt-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 7px;
  background-image: radial-gradient(circle at 6px 7px, var(--lt-canvas) 4px, transparent 4.5px);
  background-size: 14px 8px;
  background-repeat: repeat-x;
  pointer-events: none;
}
/* grid 3 คอลัมน์: ซ้าย/ขวากว้างเท่ากัน → nav กลางนิ่ง ไม่ขยับตามความกว้างชิปยอดเงิน */
.lt-header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem 1rem 0.8125rem;
}
.lt-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  min-width: 0;
  grid-column: 1;
  justify-self: start;
}
.lt-brand:hover { color: #fff; }
.lt-brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.25);
  padding: 2px;
}
.lt-brand-name {
  font-family: var(--lt-font-display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* nav desktop — วางบนแทร็กสีหมึกโปร่ง ให้ตัวขาวอ่านออกตลอดช่วงไล่เฉด (contrast ≥ 4.8:1)
   โดยไม่ต้องลดความสดของ gradient */
.lt-nav {
  align-items: center;
  gap: 0.15rem;
  grid-column: 2;
  background: rgba(43, 33, 64, 0.5);
  border-radius: 999px;
  padding: 4px;
}
.lt-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(43, 33, 64, 0.3);
}
.lt-nav-link i { opacity: 0.85; }
.lt-nav-link:hover,
.lt-nav-link:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.24);
}
.lt-nav-link.active {
  background: #fff;
  color: var(--lt-chili);
  box-shadow: 0 2px 8px rgba(43, 33, 64, 0.22);
  text-shadow: none;
}
.lt-nav-link.active i { opacity: 1; }
.lt-nav-link .news-count-new {
  position: absolute;
  top: -3px;
  right: -3px;
  font-size: 0.6rem;
  padding: 0.2em 0.42em;
  line-height: 1;
  border: 2px solid #fff;
}
.lt-nav .dropdown-menu {
  font-family: var(--lt-font-body);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(43, 33, 64, 0.18);
}

/* tools ขวา */
.lt-header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  grid-column: 3;
  justify-self: end;
}
.lt-clock {
  font-family: var(--lt-font-digit);
  font-weight: 600;
  font-size: 0.85rem;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  background: rgba(43, 33, 64, 0.5);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  white-space: nowrap;
}
.lt-balance {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.94);
  color: var(--lt-ink);
  border-radius: 999px;
  padding: 0.32rem 0.8rem 0.32rem 0.6rem;
  box-shadow: 0 2px 6px rgba(43, 33, 64, 0.15);
  cursor: pointer;
  max-width: 40vw;
}
.lt-balance:hover { color: var(--lt-ink); }
.lt-balance i { color: var(--lt-chili); }
.lt-balance .user-credit {
  font-family: var(--lt-font-digit);
  font-weight: 600;
  font-size: 0.9rem;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  /* จองพื้นที่ไว้ กันชิปหด/ขยายตอนสลับ spinner ↔ ตัวเลข */
  min-width: 4.5rem;
  text-align: center;
}
.lt-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}
.lt-bell:hover { color: #fff; background: rgba(255, 255, 255, 0.28); }
.lt-bell .news-count-new {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.6rem;
  padding: 0.2em 0.42em;
  line-height: 1;
  border: 2px solid #fff;
}
.lt-avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--lt-ink);
  color: #fff;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  border: 2px solid rgba(255, 255, 255, 0.6);
}
.lt-avatar-btn:hover { color: #fff; }
.lt-user-dropdown {
  font-family: var(--lt-font-body);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(43, 33, 64, 0.18);
  min-width: 230px;
}

/* ── Main ──────────────────────────────────────────────────────── */
.lt-main {
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
  min-height: calc(100vh - 220px);
}

/* ── Bottom tab bar (มือถือ) ───────────────────────────────────── */
.lt-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--lt-line);
  box-shadow: 0 -4px 18px rgba(43, 33, 64, 0.1);
  padding-bottom: env(safe-area-inset-bottom);
}
.lt-tab {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0 0.55rem;
  color: #8a80a0;
  font-size: 0.68rem;
  font-weight: 500;
}
.lt-tab i { font-size: 1.15rem; }
.lt-tab:hover { color: var(--lt-ink-soft); }
.lt-tab.active { color: var(--lt-chili); }
.lt-tab.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--lt-chrome);
}
.lt-tab .news-count-new {
  position: absolute;
  top: 2px;
  left: calc(50% + 6px);
  font-size: 0.58rem;
  padding: 0.2em 0.4em;
  line-height: 1;
  border: 2px solid #fff;
}
@media (max-width: 991.98px) {
  body.lt-body { padding-bottom: 72px; }
}

/* ── Footer ────────────────────────────────────────────────────── */
.lt-footer {
  text-align: center;
  color: var(--lt-ink-soft);
  font-size: 0.8rem;
  padding: 1rem 0 1.25rem;
}

/* ── ช่องค้นหา ─────────────────────────────────────────────────── */
.lt-search-wrap { margin-bottom: 0.5rem; }
.lt-search {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--lt-card);
  border-radius: 999px;
  padding: 0.65rem 1.15rem;
  box-shadow: var(--lt-shadow);
  max-width: 620px;
  margin: 0 auto;
  border: 1.5px solid transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lt-search:focus-within {
  border-color: var(--lt-chili);
  box-shadow: 0 4px 16px rgba(240, 62, 82, 0.16);
}
.lt-search i { color: var(--lt-ink-soft); }
.lt-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--lt-ink);
  font-size: 0.95rem;
  font-family: var(--lt-font-body);
}
.lt-search input::placeholder { color: var(--lt-ink-soft); }

/* ── หัวหมวดหวย ────────────────────────────────────────────────── */
.lt-group-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.4rem 0.25rem 0.35rem;
  font-family: var(--lt-font-body);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--lt-ink);
}
.lt-group-chip {
  flex: none;
  width: 11px;
  height: 24px;
  border-radius: 4px;
  background-color: var(--lt-accent, var(--lt-chili));
}
.lt-group-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--lt-line);
}
.lt-group-row { margin-bottom: 0.8rem; }

/* ── การ์ดตั๋วหวย (signature) ──────────────────────────────────── */
.lt-ticket-link { display: block; height: 100%; }
.lt-ticket {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--lt-card);
  border: 1px solid var(--lt-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--lt-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a:not(.disabled) .lt-ticket:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(43, 33, 64, 0.14);
}
/* แถบ accent (สีจากหลังบ้านต่อกลุ่มหวย) — flex:none กัน parent ที่เป็น flex column บีบจนหาย */
.lt-ticket-band {
  flex: none;
  height: 5px;
  background-color: var(--lt-accent, var(--lt-chili));
}
.lt-ticket-body {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  flex: 1;
}
.lt-ticket-flag {
  flex: none;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lt-canvas);
  border-radius: 12px;
}
.lt-ticket-flag img {
  max-width: 38px;
  max-height: 38px;
}
.lt-ticket-info { min-width: 0; flex: 1; }
.lt-ticket .lottery-name {
  margin: 0;
  font-family: var(--lt-font-body);
  font-weight: 600;
  font-size: 0.95rem !important;
  line-height: 1.25;
  color: var(--lt-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lt-ticket-date {
  font-size: 0.75rem;
  color: var(--lt-ink-soft);
  margin-top: 0.1rem;
  white-space: nowrap;
}
/* เส้นปรุ + รอยบากสองข้าง */
.lt-ticket-tear {
  position: relative;
  height: 0;
  border-top: 2px dashed rgba(43, 33, 64, 0.14);
  margin: 0 0.75rem;
}
.lt-ticket-tear::before,
.lt-ticket-tear::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--lt-canvas);
  box-shadow: inset 0 1px 2px rgba(43, 33, 64, 0.08);
}
.lt-ticket-tear::before { left: calc(-0.75rem - 7px); }
.lt-ticket-tear::after { right: calc(-0.75rem - 7px); }
.lt-ticket-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem 0.4rem;
  padding: 0.5rem 0.75rem 0.6rem;
}
/* ชิป countdown ตัวเลขสไตล์ป้ายไฟ */
.lt-countdown-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--lt-ink);
  color: #cfc8e0;
  border-radius: 8px;
  padding: 0.18rem 0.5rem;
  font-family: var(--lt-font-digit);
  font-weight: 600;
  font-size: 0.78rem;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.lt-countdown-chip .text-close-time { color: var(--lt-marigold); }
.lt-countdown-chip .text-open-time { color: #cfc8e0; }
/* ป้ายเวลาเปิด/ปิดรับ */
.lt-ticket .open-and-close-time {
  background: rgba(14, 159, 110, 0.12);
  color: var(--lt-leaf);
  font-family: var(--lt-font-body);
  font-weight: 600;
  font-size: 0.72rem;
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  white-space: nowrap;
}
/* สถานะปิดรับ/ยังไม่เปิด (JS toggle .bg-light .text-muted บน .card) */
.lt-ticket.bg-light {
  background: #fbfafc !important;
  filter: grayscale(1);
  opacity: 0.82;
}
a.disabled .lt-ticket:hover { transform: none; }
.lt-ticket .text-not-open {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--lt-ink-soft);
}

/* empty state ค้นหาไม่เจอ */
.lt-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--lt-ink-soft);
}
.lt-empty-ico { font-size: 2.4rem; margin-bottom: 0.6rem; color: var(--lt-marigold); }
.lt-empty-title {
  font-family: var(--lt-font-body);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--lt-ink);
}
.lt-empty-hint { font-size: 0.85rem; margin-top: 0.2rem; }

/* จอแคบมาก: ลดขนาดโซนเวลา */
@media (max-width: 400px) {
  .lt-countdown-chip { font-size: 0.68rem; padding: 0.15rem 0.4rem; }
  .lt-ticket .open-and-close-time { font-size: 0.64rem; padding: 0.25rem 0.4rem; }
  .lt-ticket .lottery-name { font-size: 0.88rem !important; }
}

/* ── Motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .lottery-round { animation: ltRise 0.35s ease backwards; }
  .lottery-round:nth-child(1) { animation-delay: 0.03s; }
  .lottery-round:nth-child(2) { animation-delay: 0.06s; }
  .lottery-round:nth-child(3) { animation-delay: 0.09s; }
  .lottery-round:nth-child(4) { animation-delay: 0.12s; }
  .lottery-round:nth-child(5) { animation-delay: 0.15s; }
  .lottery-round:nth-child(6) { animation-delay: 0.18s; }
  .lottery-round:nth-child(n + 7) { animation-delay: 0.21s; }
}
@keyframes ltRise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* focus ให้เห็นชัดบนคีย์บอร์ด */
.lt-body a:focus-visible,
.lt-body button:focus-visible {
  outline: 2px solid var(--lt-chili);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   Components กลาง (ย้ายมาจาก lottery/bet.ejs — ใช้ซ้ำได้ทุกหน้าในธีมนี้)
   สีที่ผูกกับค่าหลังบ้านอ่านจาก CSS var ที่หน้านั้น ๆ กำหนดไว้ใน :root
   --lt-accent / --lt-accent-contrast / --lt-help / --lt-help-contrast / --lt-amount
   ═══════════════════════════════════════════════════════════════ */
/* การ์ดยืนยันรายการ (bg ขาวปกติ) */
.lt-confirm-card { overflow: hidden; }
.lt-confirm-foot { padding: 0.75rem 1.5rem 1.5rem; }
.lt-confirm-sum {
  background: #f5f2f8;
  border-radius: 12px;
  padding: 0.9rem 1rem;
}
.lt-confirm-sum-tear {
  border-top: 2px dashed rgba(43, 33, 64, 0.2);
  margin: 0.5rem 0;
}
.lt-confirm-total {
  font-size: 1.15rem;
  font-weight: 700;
}
.lt-confirm-total span:last-child,
.lt-confirm-sum .fw-bold {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* hero การ์ดหัวหน้า (ตั๋วหวย) */
.lt-bet-hero { padding: 0; }
.lt-bet-hero-body {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.75rem 0.9rem;
}
.lt-bet-hero-info { flex: 1; min-width: 0; }
.lt-bet-hero-name {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.lt-bet-hero-name h6 {
  font-size: 1.02rem;
}
.lt-bet-hero-date {
  display: block;
  font-size: 0.8rem;
  color: #7a7090;
  margin-top: 0.1rem;
}
.lt-bet-hero-count {
  font-size: 0.95rem;
  padding: 0.3rem 0.7rem;
}
.lt-bet-hero-foot {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem 0.75rem;
}
.lt-bet-hero-rate-label { color: #7a7090; white-space: nowrap; }
.lt-bet-hero-foot .form-select { max-width: 300px; }
/* แถบแท็บหลัก: ถอดกรอบการ์ด ให้เป็น pill ลอยบนพื้น */
.lt-tabs-card {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
/* ล็อกขนาดทุกสถานะ กัน hover ดัน layout */
.lt-tabs-card .tab-menu-category,
.lt-tabs-card .tab-menu-category:hover,
.lt-tabs-card .tab-menu-category:focus {
  padding: 0.55rem 1rem !important;
  border: 0 !important;
}
/* แท็บย่อย: segmented track */
.lt-subtabs {
  background: #f1eef5;
  border-radius: 20px;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  gap: 2px;
}
.lt-subtabs .nav-link,
.lt-subtabs .nav-link:hover,
.lt-subtabs .nav-link:focus {
  margin-right: 0;
  padding: 0.45rem 0.95rem !important;
  border: 0 !important;
}
/* ผลรางวัลย้อนหลังแบบแถบ (แทนตาราง) */
.lt-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.6rem 0.25rem;
}
.lt-result-row + .lt-result-row {
  border-top: 2px dashed rgba(43, 33, 64, 0.12);
}
.lt-result-date {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #7a7090;
  font-weight: 600;
  white-space: nowrap;
}
.lt-result-badge {
  background: var(--lt-accent, var(--lt-chili));
  color: #fff;
  border-radius: 999px;
  font-size: 0.68rem;
  padding: 0.18em 0.6em;
  font-weight: 600;
}
.lt-result-groups {
  display: flex;
  gap: 0.5rem;
}
.lt-result-group {
  text-align: center;
  min-width: 72px;
}
.lt-result-lbl {
  display: block;
  font-size: 0.7rem;
  color: #7a7090;
  margin-bottom: 2px;
}
.lt-result-num {
  display: inline-block;
  min-width: 62px;
  background: #f5f2f8;
  border-radius: 8px;
  padding: 0.15rem 0.6rem;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.08em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: #2b2140;
}
.lt-result-latest .lt-result-num {
  background: #2b2140;
  color: #ffb020;
  font-size: 1.2rem;
}
.lt-result-latest .lt-result-date { color: #2b2140; }
/* อัตราจ่ายแบบแถบ (แทนตาราง — โครงเดียวกับผลรางวัล) */
.lt-rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.6rem 0.25rem;
}
.lt-rate-row + .lt-rate-row {
  border-top: 2px dashed rgba(43, 33, 64, 0.12);
}
.lt-rate-name {
  font-weight: 600;
  color: #2b2140;
  white-space: nowrap;
}
.lt-rate-pay {
  background: #2b2140 !important;
  color: #ffb020 !important;
}
/* เลขตัด-อั้นแบบแถบ (แทนตาราง) */
.lt-limit-row { padding: 0.6rem 0.25rem; }
.lt-limit-row + .lt-limit-row {
  border-top: 2px dashed rgba(43, 33, 64, 0.12);
}
.lt-limit-line {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.lt-limit-lbl {
  flex: none;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.2em 0.6em;
  margin-top: 2px;
  white-space: nowrap;
}
.lt-limit-lbl-close { background: rgba(255, 76, 81, 0.12); color: var(--lt-chili); }
.lt-limit-lbl-half { background: rgba(255, 159, 67, 0.16); color: #e8890c; }
.lt-limit-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.lt-limit-num {
  border-radius: 6px;
  padding: 0.05rem 0.45rem;
  font-weight: 700;
  font-size: 0.85rem;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.lt-limit-num-close { color: var(--lt-chili); background: rgba(255, 76, 81, 0.08); }
.lt-limit-num-half { color: #e8890c; background: rgba(255, 159, 67, 0.12); }
.lt-limit-empty { color: #a9a1bd; font-weight: 600; }
/* บิลล่าสุดแบบแถบ (ตารางถูกซ่อน เหลือแค่ตัวแบ่งหน้า) */
.lt-bill-source table { display: none !important; }
/* ตารางถูกซ่อนแล้ว จึงไม่ต้องเลื่อน — .table-responsive ตั้ง overflow-x:auto ซึ่งดัน overflow-y เป็น auto ทำให้มี scrollbar โผล่ */
.lt-bill-source,
.lt-bd-source {
  overflow: visible !important;
  white-space: normal !important;
}
.lt-bill-source .dt-layout-table,
.lt-bd-source .dt-layout-table { margin: 0 !important; }
.lt-bill-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.25rem;
}
.lt-bill-row + .lt-bill-row {
  border-top: 2px dashed rgba(43, 33, 64, 0.12);
}
.lt-bill-info { flex: 1; min-width: 0; }
.lt-bill-code {
  font-weight: 700;
  color: #2b2140;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.lt-bill-code .btn-bill-detail:hover { text-decoration: underline; }
.lt-bill-time {
  font-size: 0.75rem;
  color: #7a7090;
  margin-top: 1px;
}
.lt-bill-note {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.72rem;
  background: #f5f2f8;
  color: #5a5170;
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lt-bill-amount {
  flex: none;
  background: #2b2140;
  color: #ffb020;
  border-radius: 8px;
  padding: 0.2rem 0.6rem;
  font-weight: 700;
  font-size: 1rem;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.lt-bill-del .btn { padding: 0.25rem 0.4rem; }
/* ตัวแบ่งหน้าของ DataTable ให้เข้าธีม (DataTables 2.x = .dt-paging / .dt-search / .dt-info) */
.lt-bill-source .dt-paging,
.lt-bill-source .dataTables_paginate { padding-top: 0.6rem; }
.lt-bill-source .pagination {
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0;
  gap: 2px;
}
.lt-bill-source .pagination .page-link {
  border: 0;
  border-radius: 999px;
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
}
.lt-bill-source .pagination .page-item.active .page-link {
  background-color: var(--lt-accent, var(--lt-chili));
  border-color: var(--lt-accent, var(--lt-chili));
  color: var(--lt-accent-contrast, #fff);
  box-shadow: none;
}
/* บรรทัด "แสดง x ถึง y" ให้เล็กลง เข้ากับธีม */
.lt-bill-source .dt-info {
  font-size: 0.78rem;
  color: var(--lt-ink-soft);
  padding-top: 0.4rem;
}

/* ── โมดัลรายละเอียดบิล ── */
.lt-detail-modal { overflow: hidden; }
.lt-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  font-size: 0.82rem;
  color: #7a7090;
}
.lt-detail-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
/* JS (bet.js) ใส่ img 35px + ms-auto มา — ปรับให้พอดีบรรทัด ไม่ดันไปชิดขวา */
#billDetailRound img {
  width: 20px !important;
  height: auto;
  border-radius: 3px;
  margin-inline-end: 0.15rem !important;
}
#billDetailCreatedAt .ms-auto { margin-inline-start: 0 !important; }
#billDetailCreatedAt > span {
  background: #f5f2f8;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
#billDetailCreatedAt > span + span { margin-inline-start: 0 !important; }
/* ชิป "อัตราจ่าย: <ชื่อ tier>" — ไม่มีในวิว: scripts/main.js เติมให้เองหลัง DataTable ในโมดัลโหลด (xhr.dt)
   ดู .ai-context.md "ชิปอัตราจ่ายในโมดัลรายละเอียดบิล" */
.lt-detail-meta > .lt-bd-payout {
  background: #f5f2f8;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}
.lt-detail-meta > .lt-bd-payout i { color: var(--lt-accent, var(--lt-chili)); }
.lt-detail-meta > .lt-bd-payout b { color: #2b2140; }
.lt-detail-meta > .lt-bd-payout.is-none b { font-weight: 500; color: #a99fbb; }
.lt-detail-note { font-size: 0.85rem; }
/* ซ่อนบรรทัด Note เมื่อบิลไม่มีโน้ต */
.lt-detail-note:has(#billDetailNote:empty) { display: none; }
/* ลำดับในโมดัล: ช่องค้นหา → รายการ → สรุป (ตาราง data source อยู่ท้ายสุด) */
.lt-detail-modal .modal-body { display: flex; flex-direction: column; }
/* ผูกกับ class (ไม่ใช่ id) เพื่อให้ใช้ได้ทุกหน้าที่มีโมดัลรายละเอียดบิล */
.lt-detail-modal .lt-modal-search { order: 1; }
.lt-detail-modal .lt-result-list { order: 2; }
.lt-detail-modal .lt-bd-sum {
  order: 3;
  position: sticky;
  bottom: 0;
  background: var(--bs-modal-bg, #fff);
  padding-bottom: 0.25rem;
}
.lt-detail-modal .lt-bd-source { order: 4; white-space: normal !important; }
.lt-bd-source table { display: none !important; }
/* ซ่อน chrome ของ DataTable ทั้งชุด (ค้นหา/บรรทัดนับ) — หน้าใช้ช่องค้นหา + สรุปของตัวเอง
   เพราะ search ของ DataTable ใช้ไม่ได้กับ render ที่คืนค่าเฉพาะ type "display" */
.lt-bd-source .dt-search,
.lt-bd-source .dt-info,
.lt-bd-source .dataTables_filter,
.lt-bd-source .dataTables_info { display: none !important; }

/* ── ช่องค้นหาในโมดัล/การ์ด (ใช้ซ้ำได้) ── */
.lt-modal-search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--lt-canvas, #f5f2f8);
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  margin-bottom: 0.75rem;
}
.lt-modal-search:focus-within {
  border-color: var(--lt-accent, var(--lt-chili));
  background: #fff;
}
.lt-modal-search i { color: var(--lt-ink-soft, #7a7090); }
.lt-modal-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--lt-ink, #2b2140);
  font-family: inherit;
  font-size: 0.95rem;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.lt-modal-search input::placeholder {
  color: var(--lt-ink-soft, #7a7090);
  font-variant-numeric: normal;
}
/* แถวเลขในบิล */
.lt-bd-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.25rem;
}
.lt-bd-row + .lt-bd-row { border-top: 2px dashed rgba(43, 33, 64, 0.12); }
.lt-bd-numwrap { flex: none; text-align: center; min-width: 68px; }
.lt-bd-num {
  background: #2b2140;
  color: #fff;
  border-radius: 10px;
  padding: 0.2rem 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.lt-bd-row.is-win .lt-bd-num { background: #0e9f6e; }
.lt-bd-type {
  display: block;
  margin-top: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #7a7090;
}
.lt-bd-stats {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  min-width: 0;
}
.lt-bd-stat {
  font-size: 0.7rem;
  color: #7a7090;
  line-height: 1.25;
}
.lt-bd-stat b {
  display: block;
  font-size: 0.9rem;
  color: #2b2140;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.lt-bd-net { flex: none; text-align: end; }
.lt-bd-net b { font-size: 1rem; }
.lt-bd-net.neg b { color: var(--lt-chili); }
.lt-bd-net.pos b { color: var(--lt-leaf); }
/* สรุปท้ายบิล */
.lt-bd-sum {
  margin-top: 0.5rem;
  border-top: 2px dashed rgba(43, 33, 64, 0.2);
  padding-top: 0.7rem;
}
.lt-bd-sum-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  background: #f5f2f8;
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
}
.lt-bd-sum-item { font-size: 0.72rem; color: #7a7090; }
.lt-bd-sum-item b {
  display: block;
  font-size: 1rem;
  color: #2b2140;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════
   หน้ารายการโพย (/lottery/bill) — การ์ดสรุป, ชิปตัวกรอง, แถวโพย
   ═══════════════════════════════════════════════════════════════ */

/* การ์ดสรุปยอด */
.lt-summary-card { overflow: hidden; }
.lt-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}
.lt-summary-item {
  padding-inline-start: 0.75rem;
  border-inline-start: 3px solid var(--lt-line);
}
.lt-summary-item-net { border-inline-start-color: var(--lt-accent, var(--lt-chili)); }
.lt-summary-label {
  display: block;
  font-size: 0.75rem;
  color: var(--lt-ink-soft);
  margin-bottom: 2px;
}
.lt-summary-grid h4 {
  font-size: 1.25rem;
  font-weight: 700;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
@media (min-width: 768px) {
  .lt-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ชิปตัวกรอง — ใช้ร่วมกับปุ่มเดิมของ bill.js (active = btn-outline-success / btn-primary) */
.lt-filter-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.lt-body .btn-status,
.lt-body .btn-date-range,
.lt-body .lottery-category-item,
.lt-body .btn-clear-all-lottery-category-item,
.lt-body .btn-group-lottery-category {
  border-radius: 999px !important;
  font-weight: 600;
  padding: 0.32rem 0.85rem;
  border-width: 1.5px;
  box-shadow: none !important;
}
/* ยังไม่เลือก */
.lt-body .btn-status.btn-outline-secondary,
.lt-body .btn-date-range.btn-outline-secondary,
.lt-body .lottery-category-item.btn-outline-secondary,
.lt-body .btn-group-lottery-category.btn-label-secondary {
  background: #fff !important;
  border-color: rgba(43, 33, 64, 0.15) !important;
  color: var(--lt-ink) !important;
}
.lt-body .btn-status.btn-outline-secondary:hover,
.lt-body .btn-date-range.btn-outline-secondary:hover,
.lt-body .lottery-category-item.btn-outline-secondary:hover,
.lt-body .btn-group-lottery-category.btn-label-secondary:hover {
  border-color: var(--lt-ink) !important;
  color: var(--lt-ink) !important;
}
/* ที่เลือกอยู่ */
.lt-body .btn-status.btn-outline-success,
.lt-body .btn-date-range.btn-outline-success,
.lt-body .lottery-category-item.btn-outline-success,
.lt-body .btn-group-lottery-category.btn-primary {
  background: var(--lt-ink) !important;
  border-color: var(--lt-ink) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(43, 33, 64, 0.22) !important;
}
.lt-body .lottery-category-item .text-black { color: inherit !important; }

/* แถวรายการโพย */
.lt-bp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem 0.75rem;
  padding: 0.8rem 0.25rem;
}
.lt-bp-row + .lt-bp-row { border-top: 2px dashed rgba(43, 33, 64, 0.12); }
.lt-bp-row.is-win { background: rgba(14, 159, 110, 0.06); border-radius: 12px; }
.lt-bp-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 210px;
}
.lt-bp-flag {
  flex: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lt-canvas);
  border-radius: 11px;
}
.lt-bp-flag img { max-width: 28px; height: auto; }
.lt-bp-info { min-width: 0; }
.lt-bp-title { font-weight: 700; color: var(--lt-ink); line-height: 1.25; }
.lt-bp-code {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--lt-ink-soft);
  font-feature-settings: "tnum";
}
.lt-bp-meta { font-size: 0.72rem; color: var(--lt-ink-soft); margin-top: 1px; }
.lt-bp-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  margin-inline-start: auto;
}
.lt-bp-status .badge { font-size: 0.68rem; }
.lt-bp-status br { display: none; }
.lt-bp-actions { flex: none; }
.lt-bp-stats {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.1rem;
  padding-top: 0.15rem;
}
.lt-bp-note {
  display: inline-block;
  margin-top: 3px;
  font-size: 0.72rem;
  background: var(--lt-canvas);
  color: #5a5170;
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* หัวคอลัมน์ของรายการ — โชว์เฉพาะจอกว้าง */
.lt-bp-head { display: none; }

/* จัดลำดับ chrome ของ DataTable: "แสดง N รายการ / ค้นหา" ขึ้นบนรายการ, ตัวแบ่งหน้าอยู่ล่าง
   (DataTables 2.x วาง 3 แถวใน wrapper: [บน] [ตาราง] [ล่าง] — ตารางถูกซ่อนอยู่แล้ว) */
.lt-list-body { display: flex; flex-direction: column; }
.lt-list-body .lt-bill-source,
.lt-list-body .lt-bill-source > div { display: contents; }
/* เนื้อหาหลักของหน้า (รายการ/หัวคอลัมน์/กริดการ์ด) อยู่ลำดับ 2 เสมอ
   — ต้องเป็นกฎกลาง ไม่ผูกกับชื่อ container ของแต่ละหน้า ไม่งั้นช่องค้นหาจะตกไปอยู่ล่างรายการ */
.lt-list-body > * { order: 2; }
.lt-list-body .lt-bill-source > div > div:nth-child(1) { order: 1; }
.lt-list-body .lt-bill-source > div > div:nth-child(3) { order: 4; }
.lt-list-body .lt-bill-source > div > div:nth-child(2) { order: 5; }

/* ── skeleton ตอน DataTable โหลด (กัน "หน้าขาว") ──
   hook กลางใน main2.ejs (ผูก preXhr/xhr/draw/dt-error ที่ document) ใส่ .lt-dt-loading ต่อจาก container ของ renderer ก่อน data source
   ใน .lt-list-body ได้ order 2 ตามกฎกลางด้านบนอยู่แล้ว; ในโมดัลรายละเอียด (.lt-detail-modal ที่ search=1/list=2/sum=3/source=4) ต้องตั้ง order 2 เอง
   ดีไซน์: แถวเป็น "การ์ดตั๋ว" ขอบมน 14px + แถบสี chili→marigold ซ้าย, กล่องธง 40px, 2 บรรทัด, ป้ายสถานะโทน marigold, ชิปตัวเลข 3 ช่อง;
   แถวจางลงทีละแถว (--o) และเข้าฉากไล่กันด้วย --i; แสงวิ่ง (::after) กวาดทั้งแถวไล่หน่วงต่อแถวเป็นคลื่น; ป้ายลูกบอล 3 สีกระดอน
   component กลาง 3 สำเนา member/company/agent — แก้ต้องซิงก์ทั้งสาม */
.lt-dt-loading { padding: 0.35rem 0 0.25rem; }
.lt-detail-modal .lt-dt-loading { order: 2; }
.lt-ld-rows { display: flex; flex-direction: column; gap: 0.6rem; }
.lt-ld-row {
  --d: calc(var(--i, 0) * 0.09s);
  --o: 1;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 0.9rem 0.75rem 1.05rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  opacity: 0;
  animation: lt-ld-in 0.45s ease-out forwards;
  animation-delay: var(--d);
}
.lt-ld-row:nth-child(2) { --o: 0.85; }
.lt-ld-row:nth-child(3) { --o: 0.7; }
.lt-ld-row:nth-child(4) { --o: 0.55; }
.lt-ld-row:nth-child(5) { --o: 0.42; }
.lt-ld-row:nth-child(n + 6) { --o: 0.3; }
.lt-ld-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, rgba(240, 62, 82, 0.45), rgba(255, 176, 32, 0.45));
}
/* แสงวิ่งกวาดทั้งแถว (สว่างขึ้นเฉพาะบนบล็อกที่มีสี) ไล่หน่วงต่อแถวให้เห็นเป็นคลื่น */
.lt-ld-row::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.85) 50%, rgba(255, 255, 255, 0) 70%);
  transform: translateX(-100%);
  animation: lt-ld-sheen 1.7s ease-in-out infinite;
  animation-delay: var(--d);
  pointer-events: none;
}
.lt-skel { display: block; background: #ece8f3; border-radius: 8px; }
.lt-ld-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; }
.lt-ld-lines { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.lt-ld-line { height: 12px; max-width: 100%; border-radius: 6px; }
.lt-ld-line.is-sub { height: 9px; opacity: 0.65; }
.lt-ld-pill { flex: none; width: 76px; height: 24px; border-radius: 999px; background: rgba(255, 176, 32, 0.22); }
.lt-ld-nums { flex: none; display: flex; gap: 0.4rem; }
.lt-ld-num { width: 54px; height: 26px; border-radius: 9px; background: rgba(43, 33, 64, 0.07); }
/* ป้ายสถานะ: ลูกบอล 3 สีของธีม (chili/tangerine/marigold) กระดอนไล่กัน + ข้อความ */
.lt-ld-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: max-content;
  max-width: 100%;
  margin: 0.9rem auto 0;
  padding: 0.45rem 1rem 0.45rem 0.8rem;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--lt-line);
  box-shadow: var(--lt-shadow);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--lt-ink-soft);
}
.lt-ld-balls { display: inline-flex; align-items: center; gap: 0.3rem; }
.lt-ld-balls i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lt-chili);
  box-shadow: inset -2px -2px 3px rgba(0, 0, 0, 0.14);
  animation: lt-ld-bounce 1s ease-in-out infinite;
}
.lt-ld-balls i:nth-child(2) { background: var(--lt-tangerine); animation-delay: 0.15s; }
.lt-ld-balls i:nth-child(3) { background: var(--lt-marigold); animation-delay: 0.3s; }
@keyframes lt-ld-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: var(--o, 1); transform: none; }
}
@keyframes lt-ld-sheen {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}
@keyframes lt-ld-bounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
}
/* กล่อง error ในตำแหน่งเดียวกับ skeleton ไม่ต้องสูงเท่าหน้าว่าง */
.lt-dt-loading .lt-empty { padding: 2rem 1rem; }
/* ระหว่างโหลด: บรรทัดนับ "แสดง 0 ถึง 0 จาก 0 รายการ" ยังไม่ใช่ข้อมูลจริง ซ่อนไว้แต่คงพื้นที่ไม่ให้แถวล่างขยับ */
.is-loading .dt-info { visibility: hidden; }
/* container ที่ค้างกล่อง "ไม่พบข้อมูล" ของรอบก่อน ซ่อนชั่วคราวระหว่างโหลดรอบใหม่ (hook ถอดคลาสตอน xhr/draw) */
.lt-dt-wait { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  .lt-ld-row { animation: none; opacity: var(--o, 1); }
  .lt-ld-row::after,
  .lt-ld-balls i { animation: none; }
}
@media (max-width: 575.98px) {
  .lt-ld-row { gap: 0.6rem; padding: 0.65rem 0.7rem 0.65rem 0.85rem; }
  .lt-ld-ico { width: 34px; height: 34px; border-radius: 10px; }
  .lt-ld-pill { width: 56px; height: 20px; }
  .lt-ld-num { width: 40px; height: 22px; }
  .lt-ld-num:nth-child(n + 2) { display: none; }
}
/* ช่องค้นหา + ตัวเลือกจำนวนแถวให้เข้าธีม
   (DataTables 2.x วาง <label> กับ <input> เป็นพี่น้องกันใน .dt-search จึงต้องทำ .dt-search เป็น flex) */
.lt-bill-source .dt-search {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
}
.lt-bill-source .dt-search label {
  margin: 0 !important;
  white-space: nowrap;
  width: auto !important;
  flex: none;
}
.lt-bill-source .dt-search input { flex: 1 1 auto; min-width: 0; width: auto; }
.lt-bill-source .dt-search label,
.lt-bill-source .dt-length label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
  font-size: 0.85rem;
  color: var(--lt-ink-soft);
}
/* ล็อกขนาดทั้งสถานะปกติและ focus — ไม่งั้น .form-control:focus ของ template เปลี่ยน padding
   ทำให้ช่องยุบลงตอนคลิก */
.lt-bill-source .dt-search input,
.lt-bill-source .dt-search input:focus,
.lt-bill-source .dt-length select,
.lt-bill-source .dt-length select:focus {
  height: 36px !important;
  min-height: 36px !important;
  padding: 0.35rem 0.9rem !important;
  font-size: 0.85rem !important;
  line-height: 1.4 !important;
  border-width: 1.5px !important;
  border-style: solid !important;
  border-radius: 999px !important;
  margin: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}
.lt-bill-source .dt-search input,
.lt-bill-source .dt-length select { border-color: rgba(43, 33, 64, 0.15) !important; }
.lt-bill-source .dt-search input:focus,
.lt-bill-source .dt-length select:focus { border-color: var(--lt-accent, var(--lt-chili)) !important; }
/* select มีลูกศรของเบราว์เซอร์เอง — เผื่อที่ทางขวาไม่ให้ทับตัวเลข
   ต้องใส่ :focus ด้วย เพราะกฎ padding ด้านบนของสถานะ focus จำเพาะกว่า (มี :focus) แล้วไปล้างค่านี้ทิ้ง
   ผลคือกล่องแคบลงทันทีที่คลิก (UI ขยับ) */
.lt-bill-source .dt-length select,
.lt-bill-source .dt-length select:focus { padding-inline-end: 2rem !important; }
/* จอกว้าง: กระจายเป็นคอลัมน์เดียวกันทุกแถว ใช้พื้นที่เต็มความกว้าง (อ่านเทียบกันได้เหมือนตาราง) */
@media (min-width: 992px) {
  /* หัวคอลัมน์กับแถวข้อมูลต้องใช้ "กริดเดียวกัน" ไม่งั้นความกว้างคอลัมน์คำนวณแยกกันแล้วไม่ตรง */
  .lt-bp-table {
    display: grid;
    grid-template-columns: minmax(280px, 2.2fr) minmax(104px, max-content) repeat(4, minmax(88px, 0.85fr)) max-content;
    column-gap: 1.25rem;
    /* ระยะขอบอยู่ที่กริดแม่ ไม่ใส่ที่หัว/แถว ไม่งั้น subgrid จะเลื่อนไม่ตรงกัน */
    padding-inline: 0.5rem;
  }
  .lt-bp-table > .lt-result-list { display: contents; }
  .lt-bp-head,
  .lt-bp-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    align-items: center;
    /* ต้องเท่ากับ gap ของกริดแม่ — subgrid ใช้ gap ของตัวเองถ้ากำหนดไว้ (แถวมี 0.75rem ติดจากกฎมือถือ) */
    column-gap: 1.25rem;
  }
  .lt-bp-row {
    row-gap: 0;
    padding-inline: 0;
  }
  .lt-bp-status { margin-inline-start: 0; justify-content: flex-start; }
  /* ให้ตัวเลข 4 ช่องกลายเป็น grid item เอง จะได้ตรงคอลัมน์กันทุกแถว */
  .lt-bp-stats { display: contents; }
  .lt-bp-stats .lt-bd-stat { text-align: end; }
  .lt-bp-actions { justify-self: end; }
  /* หัวคอลัมน์ของรายการ */
  .lt-bp-head {
    /* padding แนวนอนต้องเป็น 0 เสมอ ไม่งั้น subgrid เลื่อนไม่ตรงกับแถวข้อมูล
       — พื้นหลังจึงใช้ ::before ยืดออกนอกแทน */
    position: relative;
    padding: 0.75rem 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 0;
    margin-bottom: 0.4rem;
  }
  .lt-bp-head::before {
    content: "";
    position: absolute;
    inset: 0 -0.55rem;
    border-radius: 10px;
    background-image: linear-gradient(90deg, var(--lt-chili), #f0602c 55%, #d97706);
    box-shadow: 0 2px 8px rgba(240, 62, 82, 0.25);
  }
  .lt-bp-head > span {
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(43, 33, 64, 0.25);
  }
  .lt-bp-head span:nth-child(n + 3) { text-align: end; }
  .lt-bp-head span:last-child { text-align: center; }
  /* บนจอกว้างซ่อน label ในแต่ละแถว เพราะมีหัวคอลัมน์แล้ว */
  .lt-bp-row .lt-bd-stat { font-size: 0; line-height: 1; }
  .lt-bp-row .lt-bd-stat b { font-size: 0.95rem; }
  /* เบราว์เซอร์ที่ยังไม่รองรับ subgrid — ใช้กริดแยกที่นิยามคอลัมน์เหมือนกัน */
  @supports not (grid-template-columns: subgrid) {
    .lt-bp-table { display: block; }
    .lt-bp-head,
    .lt-bp-row {
      grid-template-columns: minmax(280px, 2.2fr) minmax(104px, max-content) repeat(4, minmax(88px, 0.85fr)) max-content;
      column-gap: 1.25rem;
    }
  }
}

/* ── การ์ด "รายละเอียดหวย" (ตัวกรองหวยที่มีโพย) ─────────────────── */
.lt-body .ui-lottery-group-category .card-body { padding-block: 0.25rem 1rem; }
.lt-body .ui-lottery-group-category .card-header { padding-bottom: 0.5rem; }
.lt-body #lotteryCategoryWithBill {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 !important;
}
.lt-body #lotteryCategoryWithBill > * { margin: 0 !important; }
/* ปุ่มเลือกทั้งหมด / ไม่เลือกทั้งหมด — วงกลมโปร่ง ไม่แย่งสายตาไปจากชิปหวย */
.lt-body #btnAll,
.lt-body #btnClear,
.lt-body .btn-lottery-category-all,
.lt-body .btn-lottery-category-clear-all {
  width: 34px !important;
  height: 34px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  border-radius: 50% !important;
  background: #fff !important;
  border: 1.5px solid rgba(43, 33, 64, 0.15) !important;
  box-shadow: none !important;
}
.lt-body #btnAll i,
.lt-body .btn-lottery-category-all i { color: var(--lt-leaf); }
.lt-body #btnClear i,
.lt-body .btn-lottery-category-clear-all i { color: var(--lt-chili); }
.lt-body #btnAll:hover,
.lt-body .btn-lottery-category-all:hover {
  background: var(--lt-leaf) !important;
  border-color: var(--lt-leaf) !important;
}
.lt-body #btnClear:hover,
.lt-body .btn-lottery-category-clear-all:hover {
  background: var(--lt-chili) !important;
  border-color: var(--lt-chili) !important;
}
.lt-body #btnAll:hover i,
.lt-body #btnClear:hover i,
.lt-body .btn-lottery-category-all:hover i,
.lt-body .btn-lottery-category-clear-all:hover i { color: #fff; }
/* เว้นช่องระหว่างปุ่มจัดการกับกลุ่มชิป */
.lt-body #btnClear { margin-inline-end: 0.5rem !important; }

/* ชิปหวยที่มีโพย */
.lt-body .btn-lottery-category {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px !important;
  padding: 0.3rem 0.9rem 0.3rem 0.45rem !important;
  font-weight: 600;
  border: 1.5px solid transparent !important;
  box-shadow: none !important;
}
.lt-body .btn-lottery-category img {
  width: 22px !important;
  height: auto;
  border-radius: 4px;
  margin: 0 !important;
}
.lt-body .btn-lottery-category.btn-label-secondary {
  background: #fff !important;
  color: var(--lt-ink) !important;
  border-color: rgba(43, 33, 64, 0.15) !important;
}
.lt-body .btn-lottery-category.btn-label-secondary:hover { border-color: var(--lt-ink) !important; }
.lt-body .btn-lottery-category.btn-primary {
  background: var(--lt-ink) !important;
  color: #fff !important;
  border-color: var(--lt-ink) !important;
  box-shadow: 0 2px 8px rgba(43, 33, 64, 0.22) !important;
}

/* ── ตารางปุ่มเลขที่เลือกไว้ (หน้าแทงหวย) ────────────────────────
   custom.css ใช้ repeat(N, 1fr) ซึ่ง 1fr ย่อไม่ต่ำกว่าเนื้อหา+margin ของปุ่ม
   ทำให้ล้นขอบการ์ดบนจอแคบ → ใช้ minmax(0, 1fr) และคุมระยะด้วย gap แทน m-1 */
.lt-body .bet-lottery-number-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
}
.lt-body .bet-lottery-number-grid > .btn-number {
  margin: 0 !important;
  width: 100%;
  min-width: 0;
  padding-inline: 0.25rem;
  font-weight: 600;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
@media (min-width: 768px) and (max-width: 1024px) {
  .lt-body .bet-lottery-number-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (min-width: 1025px) {
  .lt-body .bet-lottery-number-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}

/* ป้ายบอกคีย์ลัด — ตัวเล็กใต้ปุ่ม โชว์เฉพาะจอที่มีคีย์บอร์ดจริง */
.lt-kbd-hint {
  display: none;
  margin-top: 0.35rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--lt-ink-soft);
}
.lt-kbd-hint kbd {
  display: inline-block;
  padding: 0 0.35rem;
  border: 1px solid rgba(43, 33, 64, 0.18);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  color: var(--lt-ink);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: none;
}
@media (min-width: 992px) {
  .lt-kbd-hint { display: block; }
}

/* มือถือ: บีบระยะของ chrome ตาราง (แสดง N รายการ / ค้นหา) ให้ชิดกัน ไม่ห่างเว่อร์ */
@media (max-width: 991.98px) {
  .lt-bill-source .row { margin: 0 !important; row-gap: 0.4rem !important; }
  .lt-bill-source .dt-layout-start,
  .lt-bill-source .dt-layout-end,
  .lt-bill-source .dt-layout-full {
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: flex-start !important;
  }
  .lt-bill-source .dt-length,
  .lt-bill-source .dt-search,
  .lt-bill-source .dt-info,
  .lt-bill-source .dt-paging {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
  }
  /* DataTables จัดกลางบนจอเล็ก — บังคับชิดซ้าย และให้ label+ช่องอยู่บรรทัดเดียวกัน */
  .lt-bill-source .dt-length,
  .lt-bill-source .dt-search { text-align: start !important; }
  .lt-bill-source .dt-length label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
  }
  .lt-bill-source .dt-paging { justify-content: center; display: flex; }
}

/* มือถือ: ย้ายปุ่ม "จัดการ" ขึ้นไปเป็นไอคอน ⋮ มุมขวาบนของแถว (เดสก์ท็อปคงเดิม) */
@media (max-width: 991.98px) {
  .lt-bp-row { align-items: flex-start; }
  .lt-bp-main { order: 1; }
  .lt-bp-status { order: 2; margin-inline-start: auto; }
  .lt-bp-actions { order: 3; }
  .lt-bp-stats { order: 4; }
  .lt-bp-actions .dropdown-toggle {
    width: 34px;
    height: 34px;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0 !important;
    background: #fff !important;
    border: 1.5px solid rgba(43, 33, 64, 0.15) !important;
    color: var(--lt-ink) !important;
    box-shadow: none !important;
  }
  .lt-bp-actions .dropdown-toggle::after { display: none !important; }
  .lt-bp-actions .dropdown-toggle::before {
    content: "\f142";
    font-family: "Font Awesome 6 Pro", "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 15px;
    line-height: 1;
  }
  .lt-bp-actions .dropdown-toggle:hover,
  .lt-bp-actions .dropdown-toggle.show {
    background: var(--lt-ink) !important;
    border-color: var(--lt-ink) !important;
    color: #fff !important;
  }
  .lt-bp-actions .dropdown-menu { min-width: 190px; }
}

/* ── หน้าโพยตามชนิดหวย (/lottery/bill/category) ───────────────────
   บล็อกต่อหวยถูกสร้างโดย billCategory.js (h5.card-header + ชิปสถานะ + ตาราง)
   จึงจัดสไตล์จากภายนอกอย่างเดียว */
.lt-body #allTable > div[id^="div"] {
  margin-top: 1.25rem !important;
  padding-top: 1rem;
  border-top: 2px dashed rgba(43, 33, 64, 0.12);
}
.lt-body #allTable > div[id^="div"]:first-child {
  margin-top: 0 !important;
  padding-top: 0;
  border-top: 0;
}
.lt-body #allTable .card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0 0.5rem 0 !important;
  font-size: 1rem;
  font-weight: 700;
  color: var(--lt-ink);
}
.lt-body #allTable .card-header img {
  width: 26px !important;
  height: auto;
  border-radius: 5px;
  margin: 0 !important;
}
/* แถวชิปสถานะของแต่ละหวย — ชิดซ้าย ใต้ชื่อหวย */
.lt-body #allTable .row.px-2 { margin: 0 0 0.25rem 0 !important; }
.lt-body #allTable .row.px-2 .col-12 {
  padding: 0 !important;
  text-align: start !important;
}
.lt-body #allTable .row.px-2 .mt-2 { margin-top: 0 !important; }
.lt-body #allTable .row.px-2 [role="group"] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.lt-body #allTable .btn-status { margin-top: 0 !important; }
/* ที่วางรายการแบบแถบของแต่ละหวย */
.lt-cat-host { margin-bottom: 0.5rem; }
.lt-cat-host .lt-bd-sum { margin-top: 0.75rem; }



/* ── หน้าตรวจรางวัล (/lottery/round/check) — การ์ดผลรางวัลต่อรอบ ──── */
.lt-rc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.85rem;
}
.lt-rc-empty-state { grid-column: 1 / -1; }
.lt-rc-card {
  display: flex;
  flex-direction: column;
  background: var(--lt-card);
  border: 1px solid var(--lt-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--lt-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lt-rc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(43, 33, 64, 0.14);
}
.lt-rc-head {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem 0.4rem;
}
.lt-rc-head .lt-bp-flag {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.lt-rc-head .lt-bp-flag img { max-width: 24px; }
.lt-rc-headinfo {
  flex: 1;
  min-width: 0;
  /* กันชื่อหวยยาว 2 บรรทัด ทำให้ตัวเลขของแต่ละการ์ดไม่อยู่ระดับเดียวกัน */
  min-height: 2.75rem;
}
.lt-rc-name {
  font-weight: 700;
  line-height: 1.2;
  color: var(--lt-ink);
}
.lt-rc-round {
  font-size: 0.7rem;
  color: var(--lt-ink-soft);
  margin-top: 2px;
}
.lt-rc-badge .badge { font-size: 0.62rem; }
/* โซนผลรางวัล — เลข 3 ตัวบนเป็นพระเอก */
.lt-rc-results {
  text-align: center;
  padding: 0.35rem 0.75rem 0.7rem;
}
.lt-rc-main-label {
  display: block;
  font-size: 0.68rem;
  color: var(--lt-ink-soft);
}
.lt-rc-main-num {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.12em;
  color: var(--lt-ink);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.lt-rc-sub {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.lt-rc-sub-item { text-align: center; }
.lt-rc-sub-label {
  display: block;
  font-size: 0.64rem;
  color: var(--lt-ink-soft);
  margin-bottom: 2px;
}
.lt-rc-sub-num {
  display: inline-block;
  min-width: 46px;
  background: var(--lt-canvas);
  border-radius: 8px;
  padding: 0.1rem 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--lt-ink);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
/* รอบที่ยังไม่ออกผล — ตัวเลขจาง */
.lt-rc-card.is-pending .lt-rc-main-num,
.lt-rc-card.is-pending .lt-rc-sub-num { color: #b9b2c9; }
/* ท้ายการ์ด */
.lt-rc-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem 0.6rem;
  border-top: 2px dashed rgba(43, 33, 64, 0.12);
}
.lt-rc-bills { font-size: 0.78rem; color: var(--lt-ink-soft); }
.lt-rc-bills b {
  color: var(--lt-ink);
  font-feature-settings: "tnum";
}
.lt-rc-action .btn {
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 999px;
}
.lt-rc-action .btn i { margin-inline-end: 0.3rem !important; }

/* ปุ่มสลับรูปแบบการแสดงผล (ตาราง / การ์ด) */
.lt-view-toggle {
  display: inline-flex;
  background: var(--lt-canvas);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.lt-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--lt-ink-soft);
}
.lt-view-btn:hover { color: var(--lt-ink); }
.lt-view-btn.active {
  background: var(--lt-ink);
  color: #fff;
  box-shadow: 0 2px 8px rgba(43, 33, 64, 0.22);
}

/* โหมดตารางของหน้าตรวจรางวัล — ชิปผลรางวัล + hover ทั้งแถว */
.lt-rc-num-main {
  display: inline-block;
  min-width: 64px;
  background: var(--lt-ink);
  color: var(--lt-marigold);
  border-radius: 8px;
  padding: 0.15rem 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.lt-rc-num {
  display: inline-block;
  min-width: 64px;
  background: var(--lt-canvas);
  color: var(--lt-ink);
  border-radius: 8px;
  padding: 0.15rem 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.lt-rc-num-empty { color: #b9b2c9; font-weight: 700; }
.lt-rc-table .lt-bp-row { border-radius: 10px; transition: background-color 0.12s ease; }
.lt-rc-table .lt-bp-row:hover { background: rgba(43, 33, 64, 0.035); }
@media (min-width: 992px) {
  /* คอลัมน์: หวย/งวด | สถานะ | 3 ผล | จำนวนบิล | จัดการ */
  .lt-rc-table {
    display: grid;
    /* คอลัมน์ผลรางวัลแคบและอยู่กลาง เพื่อให้ชิปทั้งสามอยู่เป็นกลุ่มเดียวกัน ระยะห่างเท่ากัน
       ส่วนที่เหลือให้คอลัมน์ชื่อหวยดูดไป */
    grid-template-columns: minmax(240px, 3fr) max-content repeat(3, minmax(84px, 0.5fr)) minmax(70px, max-content) max-content;
    column-gap: 1rem;
    padding-inline: 0.5rem;
  }
  .lt-rc-table > .lt-result-list { display: contents; }
  .lt-rc-table .lt-bp-stats .lt-bd-stat { text-align: center; }
  .lt-rc-table .lt-bp-head span:nth-child(3),
  .lt-rc-table .lt-bp-head span:nth-child(4),
  .lt-rc-table .lt-bp-head span:nth-child(5),
  .lt-rc-table .lt-bp-head span:nth-child(6) { text-align: center; }
}
@media (max-width: 991.98px) {
  .lt-rc-table .lt-bp-main { min-width: 150px; }
  /* ผลรางวัล 4 ช่องกว้างเท่ากันเป็นกริด — ชิปกับ label จึงอยู่ตรงกลางตรงกันทุกช่อง */
  .lt-rc-table .lt-bp-stats {
    order: 4;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    padding-top: 0.35rem;
  }
  .lt-rc-table .lt-bp-stats .lt-bd-stat { text-align: center; }
  .lt-rc-table .lt-rc-num-main,
  .lt-rc-table .lt-rc-num {
    display: block;
    width: 100%;
    min-width: 0;
    padding-inline: 0.2rem;
  }
  /* ปุ่มตรวจบิลเต็มความกว้างใต้ตัวเลข */
  .lt-rc-table .lt-bp-actions {
    order: 5;
    width: 100%;
    margin-top: 0.5rem;
  }
  .lt-rc-table .lt-bp-actions .btn {
    width: 100%;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 10px;
  }
}

/* ── การ์ดโพย (โหมด "การ์ด" ของหน้า /lottery/bill และ /lottery/bill/category) ── */
.lt-bill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 0.85rem;
}
.lt-bill-grid-empty { grid-column: 1 / -1; }
.lt-bill-card {
  display: flex;
  flex-direction: column;
  background: var(--lt-card);
  border: 1px solid var(--lt-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--lt-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lt-bill-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(43, 33, 64, 0.14);
}
.lt-bill-card.is-win { background: rgba(14, 159, 110, 0.05); }
.lt-bill-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem 0.5rem;
}
.lt-bill-card-head .lt-bp-flag {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.lt-bill-card-head .lt-bp-flag img { max-width: 24px; }
.lt-bill-card-info { flex: 1; min-width: 0; }
.lt-bill-card-title { font-weight: 700; line-height: 1.2; color: var(--lt-ink); }
.lt-bill-card-code {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--lt-ink-soft);
  font-feature-settings: "tnum";
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lt-bill-card-meta {
  font-size: 0.7rem;
  color: var(--lt-ink-soft);
  margin-top: 2px;
  line-height: 1.35;
}
.lt-bill-card-badge { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.lt-bill-card-badge .badge { font-size: 0.62rem; }
.lt-bill-card-badge br { display: none; }
.lt-bill-card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.6rem;
  padding: 0.35rem 0.75rem 0.6rem;
  border-top: 2px dashed rgba(43, 33, 64, 0.12);
  margin-top: 0.1rem;
}
.lt-bill-card-stats .lt-bd-stat { font-size: 0.68rem; }
.lt-bill-card-stats .lt-bd-stat b { font-size: 0.95rem; }
.lt-bill-card-stats .lt-bd-stat.is-net b { font-size: 1.1rem; }
.lt-bill-card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.75rem 0.65rem;
}
.lt-bill-card-foot .lt-bp-note { margin-top: 0; }
.lt-bill-card-foot .btn { padding: 0.28rem 0.75rem; font-size: 0.8rem; border-radius: 999px; }

/* ── ชิปกรองสถานะ: ให้สีตามความหมายของแต่ละสถานะ ─────────────────
   (ใช้ทั้งหน้า /lottery/bill และชิปรายหวยใน /lottery/bill/category) */
.lt-body .btn-status[data-category] { --chip: var(--lt-ink); }
.lt-body .btn-status[data-category="pending"] { --chip: #2ba7c9; }
.lt-body .btn-status[data-category="win"] { --chip: var(--lt-leaf); }
.lt-body .btn-status[data-category="notWin"] { --chip: #7a7090; }
.lt-body .btn-status[data-category="cancelled"] { --chip: var(--lt-chili); }
/* ยังไม่เลือก — ขอบ/ตัวหนังสือเป็นสีของสถานะ */
.lt-body .btn-status[data-category].btn-outline-secondary {
  background: #fff !important;
  border-color: color-mix(in sRGB, var(--chip) 40%, #fff) !important;
  color: var(--chip) !important;
}
.lt-body .btn-status[data-category].btn-outline-secondary:hover {
  background: color-mix(in sRGB, var(--chip) 8%, #fff) !important;
  border-color: var(--chip) !important;
  color: var(--chip) !important;
}
/* ที่เลือกอยู่ — ทึบสีของสถานะ */
.lt-body .btn-status[data-category].btn-outline-success {
  background: var(--chip) !important;
  border-color: var(--chip) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px color-mix(in sRGB, var(--chip) 38%, transparent) !important;
}

/* บรรทัดข้อมูลย่อของแถว/การ์ด (จำนวนเลข · งวด · เวลาบันทึก) — ตัวใหญ่ขึ้นและเข้มขึ้นให้อ่านง่าย */
.lt-bp-meta {
  font-size: 0.82rem;
  color: #5f5675;
}
.lt-bill-card-meta { font-size: 0.78rem; }

/* ── มือถือ: ล็อกตำแหน่งของแต่ละส่วนในแถวด้วย grid areas ─────────
   (เดิมใช้ flex-wrap ทำให้ปุ่ม ⋮ ตกบรรทัดบ้าง/อยู่บนบรรทัดเดียวกับป้ายบ้าง แล้วแต่ความยาวข้อความ) */
@media (max-width: 991.98px) {
  .lt-bp-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "main status action"
      "stats stats stats";
    align-items: start;
    column-gap: 0.5rem;
    row-gap: 0.35rem;
  }
  .lt-bp-main { grid-area: main; min-width: 0; }
  .lt-bp-status {
    grid-area: status;
    margin-inline-start: 0;
    justify-content: flex-end;
  }
  .lt-bp-actions { grid-area: action; }
  .lt-bp-stats { grid-area: stats; width: auto; padding-top: 0; }
  /* หน้าตรวจรางวัล: ปุ่ม "ตรวจบิล" เต็มความกว้างใต้ตัวเลข */
  .lt-rc-table .lt-bp-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main status"
      "stats stats"
      "action action";
  }
}

/* ── เมนูย่อยของ tab bar มือถือ (bottom sheet) ─────────────────── */
/* แท็บที่เป็นปุ่ม (มีเมนูย่อย) ต้องหน้าตาเหมือนแท็บที่เป็นลิงก์ทุกอย่าง
   — ห้ามใส่ `font: inherit` เพราะ shorthand จะทับ font-size/weight ของ .lt-tab ทำให้ตัวหนังสือใหญ่กว่าแท็บอื่น */
button.lt-tab {
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.lt-sheet { position: fixed; inset: 0; z-index: 1040; pointer-events: none; }
.lt-sheet-backdrop,
.lt-sheet-panel { pointer-events: auto; }
.lt-sheet-backdrop {
  position: absolute;
  /* เว้นแถบ tab bar ไว้ให้กดข้ามเมนูได้เลย ไม่ต้องปิดก่อน */
  inset: 0 0 var(--lt-tabbar-h, calc(72px + env(safe-area-inset-bottom)));
  background: rgba(43, 33, 64, 0.42);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.lt-sheet.show .lt-sheet-backdrop { opacity: 1; }
.lt-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--lt-tabbar-h, calc(72px + env(safe-area-inset-bottom)));
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 32px rgba(43, 33, 64, 0.22);
  padding: 0.5rem 0.75rem 0.85rem;
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.18s ease;
}
.lt-sheet.show .lt-sheet-panel { transform: translateY(0); opacity: 1; }
.lt-sheet-grip {
  width: 38px;
  height: 4px;
  border-radius: 4px;
  background: #e3dfec;
  margin: 0.15rem auto 0.5rem;
}
.lt-sheet-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #8a80a0;
  padding: 0 0.35rem 0.4rem;
}
.lt-sheet-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.55rem;
  border-radius: 14px;
  color: var(--lt-ink);
  font-weight: 600;
}
.lt-sheet-item + .lt-sheet-item { margin-top: 0.15rem; }
.lt-sheet-item:active { background: #f6f4fa; }
.lt-sheet-item.active { background: rgba(240, 62, 82, 0.08); color: var(--lt-chili); }
.lt-sheet-ico {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--lt-ink);
  color: #fff;
  font-size: 0.95rem;
}
.lt-sheet-item.active .lt-sheet-ico { background: var(--lt-chrome); }
.lt-sheet-text { display: flex; flex-direction: column; line-height: 1.25; flex: 1 1 auto; min-width: 0; }
.lt-sheet-text small { font-size: 0.72rem; font-weight: 400; color: #7a7090; }
.lt-sheet-item.active .lt-sheet-text small { color: rgba(240, 62, 82, 0.75); }
.lt-sheet-go { color: #b8b0c8; font-size: 1rem; }
@media (prefers-reduced-motion: reduce) {
  .lt-sheet-backdrop,
  .lt-sheet-panel { transition: none; }
}

/* ── หน้า /report (รายงานสรุปบัญชี) ────────────────────────────── */
.lt-rp-daterange {
  font-size: 0.82rem;
  color: #5f5675;
  margin-top: 0.15rem;
}
.lt-rp-daterange:empty { display: none; }

/* บรรทัดนับของ DataTable ซ้ำกับแถบรวมท้ายรายการ (บอกจำนวนรอบ/บิลอยู่แล้ว) */
.lt-rp-body .dt-info { display: none; }

/* แถบรวมท้ายรายการ */
.lt-rp-total {
  margin-top: 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  background: var(--lt-ink);
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
}
.lt-rp-total-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.72);
}
.lt-rp-total-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-inline-start: auto;
}
.lt-rp-total .lt-bd-stat {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.72rem;
  text-align: end;
}
.lt-rp-total .lt-bd-stat b {
  display: block;
  font-size: 1rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.lt-rp-total .lt-bd-stat.is-net b { font-size: 1.15rem; }
.lt-rp-total .text-success { color: var(--lt-pos-dark) !important; }
.lt-rp-total .text-warning { color: #ffd166 !important; }
.lt-rp-total .text-danger { color: var(--lt-neg-dark) !important; }

@media (max-width: 575.98px) {
  .lt-rp-total { gap: 0.4rem; }
  .lt-rp-total-label { width: 100%; }
  .lt-rp-total-stats {
    width: 100%;
    margin-inline-start: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
  }
  .lt-rp-total .lt-bd-stat { text-align: center; }
}

/* ตารางหน้ารายงาน — ไม่มีคอลัมน์ "จัดการ" จึงเหลือ 6 คอลัมน์ */
@media (min-width: 992px) {
  .lt-bp-table.lt-rp-table {
    grid-template-columns: minmax(280px, 2.2fr) minmax(104px, max-content) repeat(4, minmax(96px, 0.9fr));
  }
  .lt-rp-table .lt-bp-head span:last-child { text-align: end; }
  @supports not (grid-template-columns: subgrid) {
    .lt-rp-table .lt-bp-head,
    .lt-rp-table .lt-bp-row {
      grid-template-columns: minmax(280px, 2.2fr) minmax(104px, max-content) repeat(4, minmax(96px, 0.9fr));
    }
  }
}
@media (max-width: 991.98px) {
  /* ไม่มีปุ่มจัดการ — ป้ายสถานะอยู่ขวาบน ตัวเลขเรียงเต็มความกว้างด้านล่าง */
  .lt-rp-table .lt-bp-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main status"
      "stats stats";
  }
  /* 4 ช่องกว้างเท่ากัน คอลัมน์ตรงกันทุกแถว (แบบเดียวกับหน้าตรวจรางวัล) */
  .lt-rp-table .lt-bp-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    padding-top: 0.35rem;
  }
  .lt-rp-table .lt-bp-stats .lt-bd-stat { text-align: center; }
}

/* ── ตัวเลือกหวย (lotteryGroupCategoryUi3) ─────────────────────── */
.lt-lot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
}
.lt-lot-count {
  font-size: 0.82rem;
  color: #7a7090;
  background: #f3f0f8;
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-variant-numeric: tabular-nums;
}
.lt-lot-count b { color: var(--lt-chili); }

.lt-lot-picker .accordion-item {
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.lt-lot-picker .accordion-button {
  font-weight: 600;
  color: var(--lt-ink);
  background: #fbfafd;
  padding-block: 0.7rem;
}
.lt-lot-picker .accordion-button:not(.collapsed) {
  background: rgba(240, 62, 82, 0.06);
  color: var(--lt-chili);
  box-shadow: none;
}
.lt-lot-badge {
  margin-inline-start: 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: var(--lt-ink);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-variant-numeric: tabular-nums;
}

/* แถบเครื่องมือ (ค้นหา + เลือกทั้งหมด/ล้าง) — ติดบนสุดของกล่องเสมอ */
.lt-lot-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0 0.65rem;
  background: #fff;
}
.lt-lot-toolbar .lt-modal-search {
  flex: 1 1 220px;
  margin: 0;
}
.lt-lot-actions { display: flex; gap: 0.4rem; }
.lt-lot-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border: 1.5px solid transparent;
}
.lt-lot-btn-all { background: var(--lt-ink); color: #fff; }
.lt-lot-btn-all:hover { background: #3b2f57; color: #fff; }
.lt-lot-btn-clear { background: #fff; color: var(--lt-chili); border-color: rgba(240, 62, 82, 0.4); }
.lt-lot-btn-clear:hover { background: rgba(240, 62, 82, 0.08); color: var(--lt-chili); }

/* กลุ่มหวย */
.lt-lot-group + .lt-lot-group { margin-top: 0.9rem; }
.lt-lot-group[hidden] { display: none !important; }
.lt-lot-group-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.3rem 0.1rem 0.45rem;
  user-select: none;
}
.lt-lot-group-name { font-weight: 700; color: var(--lt-ink); }
.lt-lot-group-count {
  font-size: 0.72rem;
  color: #8a80a0;
  background: #f3f0f8;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  font-variant-numeric: tabular-nums;
}
.lt-lot-group.is-all .lt-lot-group-count { background: rgba(14, 159, 110, 0.12); color: var(--lt-leaf); }
.lt-lot-group.is-none .lt-lot-group-count { background: rgba(240, 62, 82, 0.1); color: var(--lt-chili); }
.lt-lot-group-toggle {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: #8a80a0;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.lt-lot-group-head:hover .lt-lot-group-toggle { opacity: 1; }
.lt-lot-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
/* รายการยาวมาก — ให้เลื่อนในกล่อง แถบค้นหา/ปุ่มจึงอยู่ให้เห็นตลอด */
.lt-lot-groups {
  max-height: min(58vh, 520px);
  overflow-y: auto;
  padding-inline-end: 0.35rem;
}

/* ชิปหวยแต่ละตัว — กดที่ไหนก็ได้ทั้งชิป */
.lt-lot-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem 0.35rem 0.4rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 999px;
  background: #fff;
  color: #7a7090;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  margin: 0;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.lt-lot-chip[hidden] { display: none !important; }
.lt-lot-chip:hover { border-color: rgba(240, 62, 82, 0.45); }
.lt-lot-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.lt-lot-tick {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eeeaf4;
  color: transparent;
  font-size: 0.6rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.lt-lot-chip img {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 3px;
  flex: none;
}
.lt-lot-chip.is-on {
  border-color: rgba(14, 159, 110, 0.55);
  background: rgba(14, 159, 110, 0.08);
  color: var(--lt-ink);
  font-weight: 600;
}
.lt-lot-chip.is-on .lt-lot-tick { background: var(--lt-leaf, #0e9f6e); color: #fff; }
.lt-lot-chip input:focus-visible + .lt-lot-tick { outline: 2px solid var(--lt-chili); outline-offset: 2px; }

/* แถวเลือกทั้งกลุ่มแบบเร็ว */
.lt-lot-groupbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.lt-lot-groupbar-label { font-size: 0.8rem; color: #8a80a0; }
.lt-lot-groupchips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.lt-lot-groupchips .btn-lottery-category {
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  margin: 0;
}

@media (max-width: 767.98px) {
  .lt-lot-group-toggle { opacity: 1; }
  .lt-lot-actions { width: 100%; }
  .lt-lot-actions .lt-lot-btn { flex: 1 1 0; justify-content: center; }
  .lt-lot-chip { font-size: 0.82rem; }
}

/* ── หน้า /report/transaction (ประวัติการเงิน) ─────────────────── */
.lt-tx-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.lt-tx-icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.9rem;
  background: var(--lt-ink);
}
[data-kind="lottery"] .lt-tx-icon { background: var(--lt-chrome); }
[data-kind="money"] .lt-tx-icon { background: linear-gradient(135deg, #0e9f6e, #12b981); }
[data-kind="summary"] .lt-tx-icon { background: linear-gradient(135deg, #d97706, var(--lt-marigold)); }
.lt-tx-headinfo { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.lt-tx-type { font-weight: 700; color: var(--lt-ink); font-size: 0.92rem; }
.lt-tx-time {
  font-size: 0.78rem;
  color: #7a7090;
  font-variant-numeric: tabular-nums;
}
.lt-tx-detail {
  font-size: 0.85rem;
  color: #5f5675;
  line-height: 1.45;
  margin-top: 0.3rem;
}
.lt-tx-detail .lt-tx-flag {
  width: 24px;
  height: 17px;
  object-fit: cover;
  border-radius: 3px;
  vertical-align: -3px;
  margin-inline-end: 0.2rem;
}
.lt-tx-row .lt-bd-stat b,
.lt-tx-card .lt-bd-stat b { font-variant-numeric: tabular-nums; }
/* ช่อง "ทำรายการ" ของบิลหวยมี 3 บรรทัด (ยอด/คอม/สุทธิ) */
.lt-tx-change b { line-height: 1.35; font-size: 1rem; }
.lt-tx-row .lt-bd-stat.is-net b { font-weight: 700; }

/* โหมดการ์ด */
.lt-tx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
}
.lt-tx-card {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  padding: 0.85rem 0.9rem;
  overflow: hidden;
}
.lt-tx-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--lt-ink);
}
.lt-tx-card[data-kind="lottery"]::before { background: var(--lt-chrome); }
.lt-tx-card[data-kind="money"]::before { background: #0e9f6e; }
.lt-tx-card[data-kind="summary"]::before { background: var(--lt-marigold); }
.lt-tx-card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(43, 33, 64, 0.14);
}
.lt-tx-card-stats .lt-bd-stat { text-align: center; }

/* ตาราง: รายการ | ก่อน | ทำรายการ | หลัง */
@media (min-width: 992px) {
  .lt-bp-table.lt-tx-table {
    grid-template-columns: minmax(320px, 2.4fr) minmax(104px, 0.8fr) minmax(130px, 1fr) minmax(104px, 0.8fr);
  }
  .lt-tx-table .lt-bp-head span:last-child { text-align: end; }
  .lt-tx-table .lt-bp-row { align-items: start; padding-block: 0.7rem; }
  .lt-tx-table .lt-bp-stats .lt-bd-stat { padding-top: 0.15rem; }
  @supports not (grid-template-columns: subgrid) {
    .lt-tx-table .lt-bp-head,
    .lt-tx-table .lt-bp-row {
      grid-template-columns: minmax(320px, 2.4fr) minmax(104px, 0.8fr) minmax(130px, 1fr) minmax(104px, 0.8fr);
    }
  }
}
@media (max-width: 991.98px) {
  .lt-tx-table .lt-bp-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "main"
      "stats";
  }
  /* จอแคบ: รายละเอียดลงบรรทัดใหม่เต็มความกว้าง (ไม่เบียดข้างชื่อประเภท) */
  .lt-tx-row .lt-bp-main { display: block; }
  .lt-tx-row .lt-tx-detail { margin-top: 0.4rem; }
  .lt-tx-table .lt-bp-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    padding-top: 0.5rem;
    margin-top: 0.15rem;
    border-top: 1px dashed rgba(43, 33, 64, 0.14);
  }
  .lt-tx-table .lt-bp-stats .lt-bd-stat { text-align: center; }
}

/* ── กล่อง "ไม่พบข้อมูล" (ใช้ทุกหน้าใน theme2 ผ่าน window.ltEmptyHtml) ── */
.lt-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 2rem 1rem;
  margin: 0.25rem 0;
  border: 1.5px dashed rgba(43, 33, 64, 0.16);
  border-radius: 16px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(43, 33, 64, 0.014),
    rgba(43, 33, 64, 0.014) 10px,
    transparent 10px,
    transparent 20px
  );
  text-align: center;
}
.lt-empty-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #f3f0f8;
  color: #b0a7c4;
  font-size: 1.15rem;
  margin-bottom: 0.15rem;
}
.lt-empty-title {
  font-weight: 700;
  color: var(--lt-ink);
  font-size: 0.98rem;
}
.lt-empty-text {
  font-size: 0.83rem;
  color: #8a80a0;
  max-width: 34ch;
}
/* ในโมดัล/การ์ดเล็ก ใช้ขนาดกระชับลง */
.modal .lt-empty,
.lt-info-tabs .lt-empty {
  padding: 1.25rem 0.75rem;
  border-radius: 12px;
}
.modal .lt-empty-icon,
.lt-info-tabs .lt-empty-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 1rem;
}

/* ── หน้า /lottery/link/check (ลิงก์ดูผล) ──────────────────────── */
.lt-lk-sub { font-size: 0.82rem; margin-top: 0.1rem; }
.lt-lk-group {
  font-size: 0.78rem;
  color: #8a80a0;
}
.lt-lk-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff !important;
  background: var(--lt-ink);
  border: 0;
  white-space: nowrap;
}
.lt-lk-btn:hover { background: #3b2f57; color: #fff !important; }
.lt-lk-btn i { font-size: 0.75rem; }
.lt-lk-nolink { font-size: 0.8rem; color: #b0a7c4; }
.lt-lk-open b { color: var(--lt-leaf); }
.lt-lk-close b { color: var(--lt-chili); }
.lt-lk-row .lt-bd-stat b { font-variant-numeric: tabular-nums; }

/* โหมดการ์ด */
.lt-lk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}
.lt-lk-card {
  background: #fff;
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  padding: 0.85rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.lt-lk-head { display: flex; align-items: center; gap: 0.55rem; }
.lt-lk-headinfo { min-width: 0; }
.lt-lk-name { font-weight: 700; color: var(--lt-ink); line-height: 1.25; }
.lt-lk-times {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  background: #f7f5fb;
}
.lt-lk-time { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; }
.lt-lk-time-label { font-size: 0.7rem; color: #8a80a0; }
.lt-lk-time-num {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--lt-ink);
  font-variant-numeric: tabular-nums;
}
.lt-lk-times .lt-lk-time:first-child .lt-lk-time-num { color: var(--lt-leaf); }
.lt-lk-times .lt-lk-time:last-child .lt-lk-time-num { color: var(--lt-chili); }
.lt-lk-arrow { color: #c4bcd4; font-size: 0.8rem; }
.lt-lk-foot { margin-top: auto; text-align: center; }
.lt-lk-foot .lt-lk-btn { width: 100%; justify-content: center; }

/* ตาราง: หวย/กลุ่ม | เปิดรับ | ปิดรับ | ลิงก์ */
@media (min-width: 992px) {
  .lt-bp-table.lt-lk-table {
    grid-template-columns: minmax(260px, 2.4fr) minmax(96px, 0.7fr) minmax(96px, 0.7fr) max-content;
  }
  /* คอลัมน์ที่ 2 ของหน้านี้เป็นตัวเลขเวลา (ไม่ใช่ป้ายสถานะ) หัวคอลัมน์จึงชิดขวาให้ตรงกับค่า */
  .lt-lk-table .lt-bp-head span:nth-child(2) { text-align: end; }
  .lt-lk-table .lt-bp-head span:last-child { text-align: end; }
  @supports not (grid-template-columns: subgrid) {
    .lt-lk-table .lt-bp-head,
    .lt-lk-table .lt-bp-row {
      grid-template-columns: minmax(260px, 2.4fr) minmax(96px, 0.7fr) minmax(96px, 0.7fr) max-content;
    }
  }
}
@media (max-width: 991.98px) {
  /* จอแคบ: ชื่อหวยบรรทัดบน เวลาสองช่องกว้างเท่ากัน ปุ่มเต็มความกว้างด้านล่าง */
  .lt-lk-table .lt-bp-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "main"
      "stats"
      "action";
  }
  .lt-lk-table .lt-bp-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    padding-top: 0.4rem;
  }
  .lt-lk-table .lt-bp-stats .lt-bd-stat { text-align: center; }
  .lt-lk-table .lt-bp-actions { width: 100%; margin-top: 0.5rem; text-align: center; }
  .lt-lk-table .lt-bp-actions .lt-lk-btn { width: 100%; justify-content: center; }
}

/* ── หน้า /news (ประกาศ) ───────────────────────────────────────── */
.lt-news-sub { font-size: 0.82rem; margin-top: 0.1rem; }
.lt-news-count {
  font-size: 0.8rem;
  color: #7a7090;
  background: #f3f0f8;
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
}
.lt-news-count:empty { display: none; }

.lt-news-list { display: flex; flex-direction: column; gap: 0.85rem; }
.lt-news-card {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  padding: 0.95rem 1.05rem 1.05rem;
  overflow: hidden;
}
.lt-news-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--lt-ink);
}
.lt-news-card.is-pin {
  border-color: rgba(255, 176, 32, 0.55);
  background: linear-gradient(180deg, rgba(255, 176, 32, 0.07), rgba(255, 176, 32, 0) 90px), #fff;
}
.lt-news-card.is-pin::before { background: linear-gradient(180deg, var(--lt-marigold), #d97706); }

.lt-news-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding-bottom: 0.6rem;
  margin-bottom: 0.7rem;
  border-bottom: 2px dashed rgba(43, 33, 64, 0.12);
}
.lt-news-icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--lt-ink);
  color: #fff;
  font-size: 0.9rem;
}
.lt-news-card.is-pin .lt-news-icon { background: linear-gradient(135deg, var(--lt-marigold), #d97706); }
.lt-news-headinfo { min-width: 0; flex: 1 1 auto; }
.lt-news-title {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--lt-ink);
  line-height: 1.35;
}
.lt-news-date {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #8a80a0;
  font-variant-numeric: tabular-nums;
}
.lt-news-pin {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #9a6207;
  background: rgba(255, 176, 32, 0.18);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}
.lt-news-body {
  font-size: 0.92rem;
  line-height: 1.65;
  color: #4a4160;
  word-break: break-word;
}
.lt-news-body img { max-width: 100%; height: auto; border-radius: 10px; }
.lt-news-body a { color: var(--lt-chili); text-decoration: underline; }
.lt-news-body :last-child { margin-bottom: 0; }
.lt-news-body table { max-width: 100%; }

@media (max-width: 575.98px) {
  .lt-news-card { padding: 0.85rem 0.85rem 0.9rem; border-radius: 14px; }
  .lt-news-title { font-size: 0.98rem; }
  .lt-news-head { flex-wrap: wrap; }
  .lt-news-pin { order: 3; }
}

/* DataTable ที่ตั้ง dom แบบไม่มี row wrapper (เช่น "lrtip" ในหน้าประกาศ)
   — chrome เป็นลูกตรง ๆ ของ .dt-container กฎ nth-child ด้านบนจึงจับสลับกัน ต้องระบุตามคลาส */
.lt-list-body .lt-bill-source > div > div.dt-length,
.lt-list-body .lt-bill-source > div > div.dt-search { order: 1; }
.lt-list-body .lt-bill-source > div > div.dt-info { order: 4; }
.lt-list-body .lt-bill-source > div > div.dt-paging { order: 5; }
.lt-list-body .lt-bill-source > div > table { order: 6; }

/* ── หน้า /user/detail (ส่วนแบ่งที่ได้รับ) ─────────────────────── */
.lt-my-sub { font-size: 0.82rem; margin-top: 0.1rem; }

/* ส่วนแบ่งหุ้น: การ์ดต่อหวย */
.lt-share-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.6rem;
}
.lt-share-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.8rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  background: #fff;
}
.lt-share-name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  color: var(--lt-ink);
  font-size: 0.9rem;
  line-height: 1.25;
}
.lt-share-val {
  flex: none;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--lt-leaf);
  font-variant-numeric: tabular-nums;
}
.lt-share-val span { font-size: 0.8rem; font-weight: 600; margin-inline-start: 0.1rem; }
.lt-share-card.is-zero .lt-share-val { color: #b0a7c4; }

/* การ์ดต่อหวย (อัตราจ่าย / แทงสูงสุด) */
.lt-my-lots { display: flex; flex-direction: column; gap: 0.75rem; }
.lt-my-lot {
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  background: #fff;
  padding: 0.75rem 0.85rem 0.85rem;
}
.lt-my-lot-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-bottom: 0.6rem;
  margin-bottom: 0.65rem;
  border-bottom: 2px dashed rgba(43, 33, 64, 0.12);
}
.lt-my-lot-name { font-weight: 700; color: var(--lt-ink); }
.lt-my-more {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1.5px solid var(--lt-line);
  background: #fff;
  color: #7a7090;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.lt-my-more:hover { border-color: rgba(240, 62, 82, 0.4); color: var(--lt-chili); }
.lt-my-more i { font-size: 0.65rem; transition: transform 0.18s ease; }
.lt-my-more:not(.collapsed) i { transform: rotate(180deg); }
.lt-my-more-count {
  background: var(--lt-ink);
  color: #fff;
  border-radius: 999px;
  padding: 0 0.4rem;
  font-size: 0.7rem;
}

/* 6-7 ช่องต่อหวย */
.lt-my-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.4rem;
}
.lt-my-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.5rem 0.35rem;
  border-radius: 12px;
  background: #f7f5fb;
  text-align: center;
}
.lt-my-type-label { font-size: 0.72rem; color: #8a80a0; }
.lt-my-type-pay {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--lt-ink);
  font-variant-numeric: tabular-nums;
}
.lt-my-type-com {
  font-size: 0.72rem;
  font-weight: 600;
  color: #d97706;
  background: rgba(255, 176, 32, 0.16);
  border-radius: 999px;
  padding: 0 0.4rem;
}

/* อัตราเพิ่มเติม (tier อื่น) */
.lt-my-extra { margin-top: 0.7rem; }
.lt-my-extra-row {
  border-top: 2px dashed rgba(43, 33, 64, 0.12);
  padding-top: 0.6rem;
  margin-top: 0.6rem;
}
.lt-my-extra-row:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.lt-my-extra-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--lt-chili);
  margin-bottom: 0.35rem;
}
.lt-my-types.is-sm .lt-my-type { padding: 0.35rem 0.3rem; background: #fbf9fd; }
.lt-my-types.is-sm .lt-my-type-pay { font-size: 0.9rem; }

@media (max-width: 575.98px) {
  .lt-my-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lt-share-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .lt-my-lot-head { flex-wrap: wrap; }
  .lt-my-more { margin-inline-start: 0; width: 100%; justify-content: center; }
}

/* สีแท็บย่อย — ใช้สีจากหลังบ้านถ้าหน้านั้นตั้ง --lt-accent ไว้ (เช่นหน้า bet) ไม่งั้นใช้สีหมึกของธีม
   (ไม่ตั้งสีไว้ก่อนหน้านี้ หน้าที่ไม่ได้ override เลยได้สีม่วงของ Vuexy ติดมา) */
.lt-subtabs .nav-link {
  color: #7a7090;
  font-weight: 600;
  border-radius: 16px;
  background: transparent;
}
.lt-subtabs .nav-link:hover { color: var(--lt-ink); }
.lt-subtabs .nav-link.active,
.lt-subtabs .nav-link.active:hover,
.lt-subtabs .nav-link.active:focus {
  background: var(--lt-accent, var(--lt-ink));
  color: var(--lt-accent-contrast, #fff);
  box-shadow: 0 2px 8px rgba(43, 33, 64, 0.18);
}
.lt-my-search { margin-bottom: 0.75rem; }

/* แท็บย่อยยาวเกินจอ (เช่น กลุ่มหวยหลายกลุ่มบนมือถือ) — ให้เลื่อนแนวนอนในแถบ ไม่ล้นออกนอกการ์ด
   หน้าไหนที่อยากให้ตัดบรรทัดแทน ใส่คลาส .flex-wrap ของ Bootstrap ได้ (มี !important จะชนะกฎนี้) */
.lt-subtabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.lt-subtabs::-webkit-scrollbar { display: none; }
.lt-subtabs .nav-item { flex: 0 0 auto; }
.lt-subtabs .nav-link { white-space: nowrap; }

/* ── โมดัลตั้งค่า (theme2) ─────────────────────────────────────── */
.lt-set-dialog { max-width: 560px; }
.lt-set-sub { font-size: 0.8rem; color: #8a80a0; margin-top: 0.1rem; }

.lt-set-group + .lt-set-group { margin-top: 1rem; }
.lt-set-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #8a80a0;
  padding: 0 0.15rem 0.4rem;
}
.lt-set-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  background: #fff;
}
.lt-set-row + .lt-set-row { margin-top: 0.4rem; }
.lt-set-icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.95rem;
  background: var(--lt-ink);
}
.lt-set-icon-sound { background: linear-gradient(135deg, var(--lt-chili), #f0602c); }
.lt-set-icon-view { background: linear-gradient(135deg, #2ba7c9, #38b6d9); }
.lt-set-icon-clock { background: linear-gradient(135deg, #d97706, var(--lt-marigold)); }
.lt-set-icon-pin { background: linear-gradient(135deg, #0e9f6e, #12b981); }
.lt-set-icon-bank { background: linear-gradient(135deg, #6d5bd0, #8b7ae8); }
.lt-set-text { flex: 1 1 auto; min-width: 0; }
.lt-set-name { font-weight: 600; color: var(--lt-ink); line-height: 1.3; }
.lt-set-desc { font-size: 0.76rem; color: #8a80a0; line-height: 1.35; }
.lt-set-switch { flex: none; margin: 0; }

/* โหมดการแสดงผล: segmented */
.lt-set-seg {
  flex: none;
  display: inline-flex;
  background: #f1eef5;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.lt-set-seg-btn {
  border: 0;
  background: transparent;
  color: #7a7090;
  font-weight: 600;
  font-size: 0.82rem;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
}
.lt-set-seg-btn.active {
  background: var(--lt-ink);
  color: #fff;
  box-shadow: 0 2px 6px rgba(43, 33, 64, 0.2);
}

.lt-set-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1.5px solid var(--lt-line);
  background: #fff;
  color: var(--lt-ink);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
}
.lt-set-btn:hover { border-color: var(--lt-chili); color: var(--lt-chili); }
.lt-set-btn i { font-size: 0.78rem; }

/* ท้ายโมดัล — .modal-footer ของ Bootstrap ใส่ margin ซ้าย/ขวาให้ลูกไม่เท่ากัน
   ตอนเรียงเป็นคอลัมน์บนมือถือจะเห็นปุ่มเยื้องกัน จึงล้าง margin แล้วคุมระยะด้วย gap อย่างเดียว */
.lt-set-foot { gap: 0.5rem; align-items: center; }
.lt-set-foot > .lt-set-cancel,
.lt-set-foot > .lt-set-save { margin: 0 !important; }
.lt-set-cancel,
.lt-set-save {
  border-radius: 999px;
  font-weight: 600;
  padding: 0.55rem 1.2rem;
  border: 1.5px solid transparent;
  cursor: pointer;
}
.lt-set-cancel { background: #fff; border-color: var(--lt-line); color: #7a7090; }
.lt-set-cancel:hover { color: var(--lt-ink); border-color: #c9c2d6; }
.lt-set-save {
  background: var(--lt-chrome);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 12px rgba(240, 62, 82, 0.28);
}
.lt-set-save:hover { filter: brightness(1.05); color: #fff; }
.lt-set-save i { font-size: 0.8rem; }

@media (max-width: 575.98px) {
  .lt-set-row { flex-wrap: wrap; }
  .lt-set-row-stack .lt-set-seg { width: 100%; justify-content: center; margin-top: 0.15rem; }
  .lt-set-row-stack .lt-set-seg-btn { flex: 1 1 0; }
  .lt-set-foot { flex-direction: column-reverse; align-items: stretch; }
  .lt-set-foot .lt-set-cancel,
  .lt-set-foot .lt-set-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    font-size: 0.95rem;
  }
}

/* สวิตช์ของธีม (ใช้ในโมดัลตั้งค่า) — ไม่พึ่งคลาส .switch ของ Vuexy ที่วาง slider แบบ absolute แล้ว label กว้าง 0 */
.lt-tgl {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 27px;
  flex: none;
  margin: 0;
  cursor: pointer;
}
.lt-tgl input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.lt-tgl-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #ddd8e6;
  transition: background 0.18s ease;
}
.lt-tgl-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(43, 33, 64, 0.25);
  transition: transform 0.18s ease;
}
.lt-tgl input:checked + .lt-tgl-track { background: var(--lt-leaf); }
.lt-tgl input:checked + .lt-tgl-track::after { transform: translateX(21px); }
.lt-tgl input:focus-visible + .lt-tgl-track {
  outline: 2px solid var(--lt-chili);
  outline-offset: 2px;
}

/* ── หน้า /lottery/history/:name (ประวัติ/สถิติของหวย) ─────────── */
.lt-hist-hero { overflow: hidden; }
.lt-hist-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.lt-hist-back {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #f3f0f8;
  color: var(--lt-ink);
}
.lt-hist-back:hover { background: var(--lt-ink); color: #fff; }
.lt-hist-flag {
  flex: none;
  width: 46px;
  height: 32px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(43, 33, 64, 0.2);
}
.lt-hist-flag img { width: 100%; height: 100%; object-fit: cover; }
.lt-hist-title { flex: 1 1 auto; min-width: 0; }
.lt-hist-group { font-size: 0.8rem; color: #8a80a0; }
.lt-hist-next {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: end;
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  background: #f7f5fb;
}
.lt-hist-next-label { font-size: 0.7rem; color: #8a80a0; }
.lt-hist-next-date { font-weight: 700; color: var(--lt-ink); }
.lt-hist-next-time { font-size: 0.72rem; color: #7a7090; font-variant-numeric: tabular-nums; }
.lt-hist-next.is-wait .lt-hist-next-date { color: var(--lt-chili); }

.lt-hist-latest {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 2px dashed rgba(43, 33, 64, 0.14);
}
.lt-hist-latest-label { font-size: 0.8rem; color: #8a80a0; margin-bottom: 0.5rem; }
.lt-hist-latest-nums { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.lt-hist-num {
  flex: 1 1 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.6rem 0.5rem;
  border-radius: 14px;
  background: #f7f5fb;
}
.lt-hist-num-label { font-size: 0.72rem; color: #8a80a0; }
.lt-hist-num-val {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  color: var(--lt-ink);
  font-variant-numeric: tabular-nums;
}
.lt-hist-num.is-main { background: var(--lt-ink); }
.lt-hist-num.is-main .lt-hist-num-label { color: rgba(255, 255, 255, 0.65); }
.lt-hist-num.is-main .lt-hist-num-val { color: var(--lt-marigold); font-size: 1.85rem; }

/* ตัวเลือกจำนวนงวด */
.lt-hist-sub { font-size: 0.8rem; margin-top: 0.1rem; }
.lt-hist-scope {
  display: inline-flex;
  background: #f1eef5;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.lt-hist-scope::-webkit-scrollbar { display: none; }
.lt-hist-scope-btn {
  border: 0;
  background: transparent;
  color: #7a7090;
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  white-space: nowrap;
  cursor: pointer;
}
.lt-hist-scope-btn.active {
  background: var(--lt-ink);
  color: #fff;
  box-shadow: 0 2px 6px rgba(43, 33, 64, 0.2);
}

/* แผงสถิติ */
.lt-hist-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
}
.lt-hist-panel {
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  padding: 0.8rem 0.85rem 0.9rem;
  background: #fff;
}
.lt-hist-panel-wide { grid-column: 1 / -1; }
.lt-hist-panel-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #8a80a0;
  margin-bottom: 0.6rem;
}
.lt-hist-none { font-size: 0.85rem; color: #b0a7c4; text-align: center; padding: 0.6rem 0; }

/* อันดับเลขที่ออกบ่อย */
.lt-hist-toprow {
  display: grid;
  grid-template-columns: 22px auto auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
}
.lt-hist-toprow + .lt-hist-toprow { border-top: 1px dashed rgba(43, 33, 64, 0.1); }
.lt-hist-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f1eef5;
  color: #8a80a0;
  font-size: 0.7rem;
  font-weight: 700;
}
.lt-hist-toprow.is-first .lt-hist-rank { background: var(--lt-chrome); color: #fff; }
.lt-hist-topnum {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--lt-ink);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  min-width: 2.2rem;
}
.lt-hist-topcount { font-size: 0.76rem; color: #7a7090; white-space: nowrap; }
.lt-hist-topbar {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: #f1eef5;
  overflow: hidden;
}
.lt-hist-topbar i { display: block; height: 100%; background: var(--lt-chrome); }

/* กราฟแท่งเลขโดด */
.lt-hist-bars {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 0.25rem;
  align-items: end;
}
.lt-hist-bar { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.lt-hist-bar-track {
  width: 100%;
  height: 64px;
  border-radius: 6px;
  background: #f4f1f8;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.lt-hist-bar-track i {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, #f0602c, var(--lt-chili));
  border-radius: 6px 6px 0 0;
  min-height: 2px;
}
.lt-hist-bar.is-max .lt-hist-bar-track i { background: linear-gradient(180deg, var(--lt-marigold), #d97706); }
.lt-hist-bar.is-zero .lt-hist-bar-track i { background: #ddd8e6; }
.lt-hist-bar-count { font-size: 0.7rem; font-weight: 700; color: var(--lt-ink); font-variant-numeric: tabular-nums; }
.lt-hist-bar-digit { font-size: 0.72rem; color: #8a80a0; }

/* เลขที่ไม่ออกนาน */
.lt-hist-drylist { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.lt-hist-dry {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem 0.35rem 0.35rem;
  border-radius: 999px;
  background: #f7f5fb;
  font-size: 0.8rem;
  color: #5f5675;
}
.lt-hist-dry-digit {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--lt-ink);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ตารางผลย้อนหลัง */
.lt-hist-thead,
.lt-hist-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) repeat(3, minmax(70px, 1fr));
  align-items: center;
  gap: 0.5rem;
}
.lt-hist-thead {
  position: relative;
  padding: 0.6rem 0;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}
.lt-hist-thead::before {
  content: "";
  position: absolute;
  inset: 0 -0.55rem;
  border-radius: 10px;
  background-image: linear-gradient(90deg, var(--lt-chili), #f0602c 55%, #d97706);
  box-shadow: 0 2px 8px rgba(240, 62, 82, 0.25);
}
.lt-hist-thead > span {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(43, 33, 64, 0.25);
}
.lt-hist-thead span:not(:first-child) { text-align: center; }
.lt-hist-row { padding: 0.55rem 0; }
.lt-hist-row + .lt-hist-row { border-top: 2px dashed rgba(43, 33, 64, 0.12); }
.lt-hist-row.is-latest { background: rgba(255, 176, 32, 0.09); border-radius: 12px; }
.lt-hist-date { font-size: 0.88rem; color: #5f5675; padding-inline-start: 0.15rem; }
.lt-hist-cell {
  text-align: center;
  font-weight: 700;
  color: var(--lt-ink);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}
.lt-hist-cell.is-main { font-size: 1.05rem; color: var(--lt-chili); }
.lt-hist-count { font-size: 0.8rem; color: #7a7090; }

@media (max-width: 575.98px) {
  .lt-hist-next { width: 100%; align-items: flex-start; text-align: start; }
  .lt-hist-num-val { font-size: 1.3rem; }
  .lt-hist-num.is-main .lt-hist-num-val { font-size: 1.55rem; }
  .lt-hist-bar-track { height: 52px; }
  .lt-hist-bars { gap: 0.15rem; }
  .lt-hist-thead,
  .lt-hist-row { grid-template-columns: minmax(84px, 1.2fr) repeat(3, minmax(0, 1fr)); gap: 0.3rem; }
  .lt-hist-date { font-size: 0.8rem; }
}

/* ป้ายบอกว่ากดดูสถิติย้อนหลังได้ — โชว์เฉพาะการ์ดหวยที่ปิดรับ/ยังไม่เปิด (index.js ใส่ .bg-light ให้)
   .lt-ticket ที่เปิดรับอยู่จะไม่มี .bg-light จึงไม่แสดง */
.lt-stats-hint { display: none; }
.lt-ticket.bg-light .lt-stats-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--lt-chili);
}
.lt-ticket.bg-light .lt-stats-hint i { font-size: 0.62rem; }
.lt-ticket-link:hover .lt-ticket.bg-light .lt-stats-hint { text-decoration: underline; }
.lt-hist-next.is-open { background: rgba(14, 159, 110, 0.1); }
.lt-hist-next.is-open .lt-hist-next-label { color: var(--lt-leaf); font-weight: 700; }
.lt-hist-next.is-waiting-result .lt-hist-next-date { color: #2ba7c9; }
.lt-hist-next-btn {
  margin-top: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--lt-chrome);
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(240, 62, 82, 0.28);
}
.lt-hist-next-btn i { font-size: 0.72rem; }

/* ── โมดัลเปลี่ยนรหัสผ่าน (theme2) ─────────────────────────────── */
.lt-pw-dialog { max-width: 460px; }
.lt-pw-sub { font-size: 0.8rem; color: #8a80a0; margin-top: 0.1rem; }
.lt-pw-form { display: flex; flex-direction: column; gap: 0.85rem; }
.lt-pw-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--lt-ink);
  margin-bottom: 0.3rem;
}
.lt-pw-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 46px;
  padding: 0 0.6rem 0 0.75rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lt-pw-input:focus-within {
  border-color: var(--lt-chili);
  box-shadow: 0 0 0 3px rgba(240, 62, 82, 0.12);
}
.lt-pw-ico { color: #b0a7c4; font-size: 0.85rem; flex: none; }
.lt-pw-input input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.95rem;
  color: var(--lt-ink);
  letter-spacing: 0.02em;
}
.lt-pw-input input::placeholder { color: #b8b0c8; letter-spacing: 0; }
.lt-pw-eye {
  flex: none;
  border: 0;
  background: transparent;
  color: #b0a7c4;
  padding: 0.3rem 0.35rem;
  border-radius: 8px;
  cursor: pointer;
}
.lt-pw-eye:hover { color: var(--lt-ink); background: #f3f0f8; }
.lt-pw-eye.is-on { color: var(--lt-chili); }

/* แถบวัดความปลอดภัย */
.lt-pw-meter {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.45rem;
}
.lt-pw-meter span {
  height: 4px;
  flex: 1 1 0;
  border-radius: 999px;
  background: #eeeaf4;
  transition: background 0.18s ease;
}
.lt-pw-meter em {
  flex: none;
  font-style: normal;
  font-size: 0.72rem;
  color: #8a80a0;
  margin-inline-start: 0.35rem;
  min-width: 4.2rem;
  text-align: end;
}
.lt-pw-meter[data-score="1"] span:nth-child(1) { background: var(--lt-chili); }
.lt-pw-meter[data-score="2"] span:nth-child(-n + 2) { background: var(--lt-marigold); }
.lt-pw-meter[data-score="3"] span { background: var(--lt-leaf); }
.lt-pw-meter[data-score="1"] em { color: var(--lt-chili); }
.lt-pw-meter[data-score="2"] em { color: #d97706; }
.lt-pw-meter[data-score="3"] em { color: var(--lt-leaf); }

/* เงื่อนไขรหัสผ่าน */
.lt-pw-rules {
  list-style: none;
  margin: 0;
  padding: 0.65rem 0.8rem;
  border-radius: 14px;
  background: #f7f5fb;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.lt-pw-rules li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: #8a80a0;
}
.lt-pw-rules li i { font-size: 0.5rem; }
.lt-pw-rules li.is-ok { color: var(--lt-leaf); font-weight: 600; }
.lt-pw-rules li.is-ok i::before { content: "\f00c"; font-size: 0.7rem; }

.lt-pw-pin { margin-top: 0.1rem; }
.lt-set-save:disabled,
.lt-set-save[disabled] {
  background: #ddd8e6;
  color: #fff;
  box-shadow: none;
  cursor: not-allowed;
  filter: none;
}

/* ปุ่มปิดของโมดัลธีม — Vuexy วางไว้ absolute ชิดมุมเกินไป (ทับแถบด้านบน/มุมโค้ง) */
.lt-body .modal .btn-close {
  /* Bootstrap ตั้ง .btn-close เป็น content-box + padding ทำให้กล่องบานเป็น ~40px
     และไอคอนกากบาทเล็กจ๋อยอยู่กลางวงใหญ่ — บังคับเป็น border-box ขนาดคงที่ */
  box-sizing: border-box !important;
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  inset-inline-start: auto !important;
  z-index: 5;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 50%;
  background-color: rgba(43, 33, 64, 0.06);
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.8;
  transform: none !important;
}
.lt-body .modal .btn-close:hover {
  opacity: 1;
  background-color: rgba(43, 33, 64, 0.12);
}

/* ── เมนูผู้ใช้ (dropdown มุมขวาบน) ─────────────────────────────── */
.lt-user-dropdown {
  min-width: 268px;
  padding: 0.5rem;
  overflow: hidden;
}
.lt-ud-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.5rem 0.7rem;
}
.lt-ud-avatar {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--lt-chrome);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  box-shadow: 0 3px 10px rgba(240, 62, 82, 0.3);
}
.lt-ud-id { display: flex; flex-direction: column; min-width: 0; gap: 0.15rem; }
.lt-ud-name {
  font-weight: 700;
  color: var(--lt-ink);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lt-ud-role {
  align-self: flex-start;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7a7090;
  background: #f1eef5;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

/* ยอดเงินในเมนู (กดเพื่อรีเฟรชได้เหมือนบนแถบ header) */
.lt-ud-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.35rem;
  border-radius: 12px;
  background: var(--lt-ink);
  color: #fff !important;
}
.lt-ud-balance:hover { background: #3b2f57; }
.lt-ud-balance-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
}
.lt-ud-balance-val {
  font-weight: 700;
  color: var(--lt-marigold);
  font-variant-numeric: tabular-nums;
}

/* รายการเมนู */
.lt-user-dropdown .lt-ud-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.55rem;
  border-radius: 12px;
  white-space: normal;
}
.lt-user-dropdown .lt-ud-item:hover,
.lt-user-dropdown .lt-ud-item:focus {
  background: #f7f5fb;
  color: var(--lt-ink);
}
.lt-ud-ico {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.85rem;
  background: var(--lt-ink);
}
.lt-ud-ico-user { background: linear-gradient(135deg, #6d5bd0, #8b7ae8); }
.lt-ud-ico-set { background: linear-gradient(135deg, #2ba7c9, #38b6d9); }
.lt-ud-ico-pw { background: linear-gradient(135deg, #0e9f6e, #12b981); }
.lt-ud-ico-link { background: linear-gradient(135deg, #d97706, var(--lt-marigold)); }
.lt-ud-ico-tx { background: linear-gradient(135deg, var(--lt-chili), #f0602c); }
.lt-ud-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  font-weight: 600;
  color: var(--lt-ink);
}
.lt-ud-text small { font-size: 0.7rem; font-weight: 400; color: #8a80a0; }
.lt-ud-go { color: #c4bcd4; font-size: 0.9rem; }

/* ออกจากระบบ */
.lt-ud-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.4rem;
  padding: 0.55rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--lt-chili) !important;
  background: rgba(240, 62, 82, 0.08);
  border: 1.5px solid rgba(240, 62, 82, 0.25);
}
.lt-ud-logout:hover {
  background: var(--lt-chili);
  border-color: var(--lt-chili);
  color: #fff !important;
}
.lt-ud-logout i { font-size: 0.8rem; }

/* ══════════════════════════════════════════════════════════════════
   ส่วนเฉพาะฝั่ง company (layout เมนูซ้าย) — ใช้คลาสของ Vuexy เดิม
   (#layout-menu, .menu-item/.menu-link/.menu-toggle/.menu-sub) เพื่อให้ menu.js
   ทำงานเหมือนเดิม แล้วทับสไตล์ด้วยธีม theme2
   ══════════════════════════════════════════════════════════════════ */
.lt-admin { background: var(--lt-canvas); }
.lt-admin .layout-page { background: transparent; }
.lt-admin .content-wrapper { background: transparent; }

/* ── เมนูซ้าย ──────────────────────────────────────────────────── */
.lt-admin #layout-menu.layout-menu {
  background: var(--lt-ink);
  border: 0;
  box-shadow: 4px 0 20px rgba(43, 33, 64, 0.16);
  /* Vuexy คุมสีเมนูด้วยตัวแปรพวกนี้ (เช่น .menu-vertical .menu-item:not(.active):not(.open) .menu-link:hover
     ที่ specificity สูงกว่ากฎของเรา) — ต้องตั้งค่าตัวแปรให้เข้าธีมมืด ไม่งั้น hover จะเป็นพื้นขาวจนอ่านตัวหนังสือไม่ออก */
  --bs-menu-bg: var(--lt-ink);
  --bs-menu-color: rgba(255, 255, 255, 0.72);
  --bs-menu-hover-bg: rgba(255, 255, 255, 0.1);
  --bs-menu-hover-color: #fff;
  --bs-menu-active-color: #fff;
  --bs-menu-active-bg: rgba(255, 255, 255, 0.12);
  --bs-menu-sub-active-bg: rgba(255, 255, 255, 0.12);
  --bs-menu-sub-active-color: #fff;
  --bs-menu-header-color: rgba(255, 255, 255, 0.45);
  --bs-menu-divider-color: rgba(255, 255, 255, 0.12);
  --bs-menu-box-shadow: none;
}
.lt-admin #layout-menu .app-brand {
  padding: 0.6rem 0.75rem; /* โลโก้เริ่ม 12px = แนวเดียวกับแผ่นไอคอนเมนู (ดูหัวข้อ "ระยะซ้ายของเมนู"); บน-ล่างลดจาก 0.9rem ตอนขยายโลโก้ 34→44px ให้แถบหัวสูงเท่าเดิม (~63px) */
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.lt-admin #layout-menu .app-brand-text {
  color: #fff;
  font-family: var(--lt-font-display, var(--lt-font-body));
  font-size: 1.02rem;
  letter-spacing: 0.02em;
}
/* โลโก้ 44px (เดิม 34px + padding 3px เหลือรูป 28px และรูปที่อัปโหลดมีขอบโปร่งอีกชั้น ทำให้ดูจิ๋ว)
   ถ้าแก้ขนาดต้องแก้ค่ากึ่งกลางของเมนูย่อด้านล่างตาม ((70 - ขนาดโลโก้) / 2) */
.lt-admin #layout-menu .side-bar-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px;
}
.lt-admin #layout-menu .layout-menu-toggle { color: rgba(255, 255, 255, 0.7); }
.lt-admin #layout-menu .menu-inner-shadow { display: none; }
/* ระยะซ้ายของเมนู (รอบแรกลดจาก ~30px เหลือ 18px ตามโลโก้ ยังห่างไป):
   โลโก้และแผ่นไอคอนเริ่มที่ 12px เท่ากัน = padding ข้าง .menu-inner 6px + padding ซ้ายของปุ่ม 6px (โลโก้คุมที่กฎ .app-brand)
   ถ้าจะขยับอีกให้แก้สามค่านี้พร้อมกัน (.app-brand / .menu-inner / .menu-link) ไม่งั้นโลโก้กับแผ่นจะไม่ตรงแนว */
.lt-admin .menu-inner { padding: 0.5rem 0.375rem 1.5rem; }
/* Vuexy: .menu-vertical .menu-inner > .menu-item .menu-link { margin-inline: 0.75rem } ดันปุ่ม (ทั้งเมนูหลักและเมนูย่อย) เข้าอีก 12px — ตัดออก
   item กว้างเท่าเมนู (16.25rem) จึงล้นขวา 6px → เว้นขวา 0.75rem ให้ปุ่มห่างขอบขวา 6px เท่าซ้าย */
.lt-admin .menu-vertical .menu-inner > .menu-item .menu-link { margin-inline: 0 0.75rem; }
/* เมนูย่อ (icon-only) — จำกัดจอ ≥1200px เหมือนเงื่อนไขของ Vuexy (จอเล็กเมนูกางเต็มความกว้างเสมอ แม้ html ยังมีคลาส layout-menu-collapsed):
   โลโก้ 44px และแผ่น 30px ต้องอยู่กึ่งกลางแถบ 70px ทั้งคู่ (กึ่งกลาง 35px) → โลโก้เริ่ม 13px แผ่นเริ่ม 20px
   ต้องซ่อนข้อความในปุ่มด้วย ไม่งั้นแผ่นไม่มีที่ว่างให้จัดกึ่งกลาง (วัดแล้วแผ่นไปอยู่ที่ 10px ขณะโลโก้อยู่ 18px)
   ใส่ #layout-menu ในตัวเลือกเพราะกฎ collapsed ของ Vuexy (padding-inline-end ของปุ่ม) มี specificity 8 คลาส */
@media (min-width: 1200px) {
  html.layout-menu-collapsed:not(.layout-menu-hover) .lt-admin #layout-menu .app-brand { padding-inline-start: 13px; }
  html.layout-menu-collapsed:not(.layout-menu-hover) .lt-admin #layout-menu .menu-inner { padding-inline: 0; }
  html.layout-menu-collapsed:not(.layout-menu-hover) .lt-admin #layout-menu .menu-inner > .menu-item > .menu-link {
    margin-inline: 0;
    padding-inline: 0;
    justify-content: center;
  }
  html.layout-menu-collapsed:not(.layout-menu-hover) .lt-admin #layout-menu .menu-inner > .menu-item > .menu-link > div { display: none; }
}

.lt-admin .menu-inner > .menu-item { margin: 0.12rem 0; }
.lt-admin .menu-inner .menu-link {
  color: rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  padding: 0.55rem 0.625rem 0.55rem 0.375rem;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.lt-admin .menu-inner .menu-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.lt-admin .menu-inner .menu-icon {
  color: rgba(255, 255, 255, 0.55);
  margin-inline-end: 0.6rem;
  width: 1.3rem;
  font-size: 1rem;
}
.lt-admin .menu-inner > .menu-item.active > .menu-link {
  background: var(--lt-chrome);
  color: #fff;
  box-shadow: 0 4px 12px rgba(240, 62, 82, 0.35);
}
.lt-admin .menu-inner > .menu-item.active > .menu-link .menu-icon { color: #fff; }
.lt-admin .menu-inner > .menu-item.open > .menu-toggle {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
/* ลูกศรของเมนูที่กางได้ */
.lt-admin .menu-inner .menu-toggle::after { border-color: rgba(255, 255, 255, 0.5); }

/* เมนูย่อย */
.lt-admin .menu-sub {
  margin: 0.15rem 0 0.35rem;
  padding-inline-start: 0.55rem;
  border-inline-start: 2px solid rgba(255, 255, 255, 0.12);
  margin-inline-start: 1.25rem; /* เส้นไกด์ที่ 6+20 = 26px ใต้กึ่งกลางแผ่นไอคอน (12–42px) */
}
.lt-admin .menu-sub .menu-link {
  /* padding/font-size ถูกทับด้วยกฎ "ขนาดตัวอักษรเมนู" ด้านล่าง (.lt-admin .menu-sub .menu-link { padding: 0.45rem 0.75rem 0.45rem 1rem }) — แก้ที่นั่น */
  color: rgba(255, 255, 255, 0.62);
}
.lt-admin .menu-sub .menu-item.active > .menu-link {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
}
.lt-admin .menu-sub .menu-link::before { display: none; }

/* ── แถบบน ─────────────────────────────────────────────────────── */
/* แถบบนของ template ตั้ง z-index: 2000 ไว้ ทำให้มันทับหัวโมดัลตอนจอแคบ (โมดัล z=1090)
   — ลดลงมาให้ต่ำกว่าโมดัล แต่ยังสูงกว่าเนื้อหาหน้า */
.lt-admin .layout-navbar { z-index: 1030 !important; }
/* จอใหญ่: core.css ให้ sidebar (.layout-menu) z-index 11 ต่ำกว่าแถบบน 1030 → ตอนกดพับ/กางเมนู แถบบนที่ animate inset-inline-start เลื่อนทับ sidebar
   ยก sidebar ขึ้นเหนือแถบบนหนึ่งขั้น (ยังต่ำกว่า swal 1060 / โมดัล 1090; ตอนพับแล้ว hover core ให้ 1085 !important อยู่แล้ว) แถบบนจึงเลื่อนออกมาจากหลัง sidebar */
@media (min-width: 1200px) {
  .lt-admin #layout-menu.layout-menu { z-index: 1031; }
}
/* แถบปัดเปิดเมนูของ template (.drag-target: fixed, กว้าง 40px ชิดซ้าย, z-index 1036) อยู่เหนือแถบบนที่ลดเหลือ 1030 ข้างบน
   → บนมือถือมันทับปุ่ม ☰ (x 14–50px) ไปราว 70% แตะเยื้องซ้ายจึงโดนแถบล่องหนแทน (วัดด้วย elementFromPoint: x 15–39 = drag-target, 42–48 = ปุ่ม)
   ดันแถบปัดลงใต้แถบบน (ยังอยู่เหนือเนื้อหาหน้าที่ไม่มี z-index) — ปัดเปิดเมนูจากขอบซ้ายยังใช้ได้ยกเว้นช่วงความสูงแถบบน */
.lt-admin .drag-target { z-index: 1029; }
/* กัน content กระโดดตอนโหลด: Vuexy helpers.js (Helpers.init ใน <head>) ฉีด <style> .layout-page{padding-top:0 !important}
   ตั้งแต่ก่อน body ถูก parse แล้วค่อยแก้เป็นความสูงแถบบนตอน DOMContentLoaded → เฟรมแรกการ์ดถูกแถบบน (fixed) ทับ แล้วขยับลง 58px
   แถบบน (.lt-topbar) สูงคงที่ 58px ทุกจอ จึงล็อกไว้ตรงนี้ด้วย !important + specificity สูงกว่ากฎที่ JS ฉีด (ถ้าแก้ความสูงแถบบนต้องแก้ค่านี้ตาม) */
html.layout-navbar-fixed .lt-admin .layout-page { padding-top: 58px !important; }
/* กันจอกระพริบตอนเลื่อนหน้า: core.css ใส่ backdrop-filter blur ให้ชั้น position:fixed 2 ชั้นที่ซ้อนกันบนสุดของจอ
   (.layout-page::before = แถบเบลอสูง 4.75rem เต็มความกว้างใต้แถบบน และ .layout-navbar ตอน .window-scrolled ที่ main.js สลับคลาสตาม scrollY)
   Chrome ต้อง rasterize backdrop root ใหม่ทุกเฟรมที่เลื่อน และตอนคลาสสลับ compositing layer ถูกสร้าง/ทิ้ง → sidebar+แถบบนวาบทั้งจอ
   แถบบนของเราพื้นทึบอยู่แล้ว (background !important) เบลอจึงไม่มีผลทางสายตา — ถอดเฉพาะ blur คง gradient จาง ๆ ใต้แถบบนไว้ */
.lt-admin .layout-page::before,
.lt-admin .lt-topbar.layout-navbar {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.lt-admin .lt-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--lt-chrome) !important;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(240, 62, 82, 0.22);
  padding: 0.55rem 0.9rem;
  min-height: 58px;
}
/* แถบบนเว้นซ้าย/ขวา 0.75rem จาก sidebar/ขอบจอ (บน/ล่างคงเดิม) — เดิมชิดขอบ sidebar (inset-inline-start = ความกว้างเมนู) มุมโค้งของแถบเลยชนขอบตรงของ sidebar
   กฎตอน modal/swal เปิดอยู่ท้ายไฟล์ต้องบวกระยะเดียวกัน */
.lt-admin .lt-topbar.layout-navbar {
  inset-inline-start: 0.75rem !important;
  inset-inline-end: 0.75rem !important;
}
@media (min-width: 1200px) {
  .lt-admin .lt-topbar.layout-navbar {
    inset-inline-start: calc(var(--bs-menu-width) + 0.75rem) !important;
    inset-inline-end: 0.75rem !important;
  }
  html.layout-menu-collapsed .lt-admin .lt-topbar.layout-navbar {
    inset-inline-start: calc(var(--bs-menu-collapsed-width) + 0.75rem) !important;
  }
}
.lt-topbar-burger {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  color: #fff !important;
}
.lt-topbar-title { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.lt-topbar-brand {
  font-family: var(--lt-font-display, var(--lt-font-body));
  font-weight: 600;
  color: #fff;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lt-topbar-role { font-size: 0.72rem; color: rgba(255, 255, 255, 0.75); }
.lt-topbar-tools {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.lt-admin .lt-balance {
  background: rgba(255, 255, 255, 0.92);
  color: var(--lt-ink) !important;
}
.lt-admin .lt-avatar-btn {
  background: rgba(43, 33, 64, 0.92);
  color: #fff;
}

/* ข้อมูลบนแถบบน (6–7 ก.ย. 2026): แถบเดียวพื้นเข้ม .lt-topbar-info (≥992px) = นาฬิกา + ออนไลน์ คั่นด้วยเส้นบาง
   — รอบแรกเป็นชิปพื้นขาวโปร่งแยกกัน (มี ชื่อผู้ใช้ / จำนวนสมาชิก ด้วย) มองยากเพราะขาวบนส่วนสีส้มของไล่เฉดกลืนกัน
   จึงใช้พื้นเข้ม 45% แบบเดียวกับนาฬิกาที่อ่านออกทุกช่วงสี แล้วสั่งเอา ชื่อผู้ใช้ / จำนวนสมาชิก ออก; จอ <992px ซ่อนทั้งแถบแล้วโชว์ในเมนูอวตาร (.lt-ud-stats) */
.lt-topbar-info {
  align-items: center;
  background: rgba(43, 33, 64, 0.45);
  border-radius: 999px;
  padding: 0.2rem 0.3rem;
  color: #fff;
}
.lt-admin .lt-topbar-clock {
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: transparent;
  color: #fff;
  font-size: 0.86rem;
  padding: 0.22rem 0.8rem;
}
.lt-admin .lt-topbar-clock i { font-size: 0.8rem; opacity: 0.9; }
/* กันแถบขยับตอน spinner → ข้อความ:
   ช่องนาฬิกาจองความกว้างเท่าข้อความที่ยาวที่สุดด้วย ::after ที่ซ่อน (สูง 0) จึงกว้างคงที่ทุกเดือน/ทุกฟอนต์ ไม่ต้องเดา rem;
   ช่องตัวเลข (.lt-topbar-stat-num) จองขั้นต่ำ 2.4rem (ถึง 4 หลัก) และสคริปต์ห้ามใส่ spinner ซ้ำตอนรีเฟรช (agent getTotalUserDownline) */
.lt-topbar-clock .user-info-clock { display: inline-block; text-align: center; }
.lt-topbar-clock .user-info-clock::after {
  content: "27 พฤศจิกายน 2569, 00:00:00";
  display: block;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}
.lt-topbar-stat-num { min-width: 2.4rem; text-align: center; }
.lt-topbar-stats { display: flex; align-items: center; }
.lt-topbar-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.8rem;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff !important;
  font-size: 0.86rem;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
}
.lt-topbar-stat i { font-size: 0.8rem; opacity: 0.9; }
.lt-topbar-stat-label { color: rgba(255, 255, 255, 0.8); }
.lt-topbar-stat-val {
  font-family: var(--lt-font-digit);
  font-weight: 700;
  font-size: 0.92rem;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lt-topbar-stat-online i { color: #4ade80; font-size: 0.55rem; opacity: 1; }
/* agent ปิดสวิตช์นาฬิกา → ชิปแรกไม่ต้องมีเส้นคั่นซ้าย */
.lt-topbar-info > .lt-topbar-stats:first-child .lt-topbar-stat:first-child { border-inline-start: 0; }

/* เมนูอวตาร: เวลาระบบ / ออนไลน์ (โชว์เฉพาะจอ <992px ที่แถบบนซ่อนแถบข้อมูลไว้) */
.lt-ud-stats {
  display: flex; /* จอ ≥992px ถูก .d-lg-none (!important) ซ่อนทับ */
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.3rem 0.6rem 0.55rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--lt-line);
}
.lt-ud-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
}
.lt-ud-stat-label { display: inline-flex; align-items: center; gap: 0.45rem; color: #6f6689; white-space: nowrap; }
.lt-ud-stat-label i { width: 1rem; text-align: center; color: #8a80a0; font-size: 0.75rem; }
.lt-ud-stat-val {
  font-family: var(--lt-font-digit);
  font-weight: 700;
  color: var(--lt-ink);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* เมนูอวตารของ company/agent กว้างกว่า member (230px) เพราะมีแถวเวลาระบบ "6 กันยายน 2569, 23:30:41" ที่ห้ามตัดบรรทัด */
.lt-admin .lt-user-dropdown { min-width: 280px; }
.lt-ud-stat-dot { color: #22c55e !important; font-size: 0.5rem !important; }

/* เนื้อหา */
.lt-admin .lt-main { padding-top: 1.25rem; padding-bottom: 2rem; min-height: auto; }
/* จอใหญ่ (≥1200px) เนื้อหาและแถบบนขยายเต็มความกว้างเสมอ ทั้งตอนเมนูกางและพับ
   - เนื้อหา: container-xxl ของ Vuexy ล็อก 1440px และ custom.css (ธีมเก่า โหลดก่อนไฟล์นี้) ยกเป็น 1500/1600/1700px ตามจอ แล้วจัดกึ่งกลาง → ว่างสองข้าง
   - แถบบน: custom.css ล็อก .layout-navbar ด้วย max-width ชุดเดียวกันตอนเมนูกาง (selector 6 คลาส) จึงต้อง !important */
@media (min-width: 1200px) {
  .lt-admin .lt-main { max-width: none; }
  .lt-admin .lt-topbar.layout-navbar { max-width: none !important; }
}

@media (max-width: 1199.98px) {
  .lt-admin .lt-topbar { border-radius: 14px; }
  .lt-topbar-role { display: none; }
}

/* ── company: การ์ดสรุปยอด (dashboard) ─────────────────────────── */
.lt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.lt-kpi {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: #fff;
  border: 1.5px solid var(--lt-line);
  overflow: hidden;
}
.lt-kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--lt-ink);
}
.lt-kpi-ico {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.05rem;
  background: var(--lt-ink);
}
.lt-kpi-body { min-width: 0; }
.lt-kpi-label { font-size: 0.8rem; color: #8a80a0; }
/* บรรทัดเสริมใต้ตัวเลข KPI (การ์ด "สมาชิกในสาย": ใช้งานใน 30 วัน นับจาก loggedAt — 7 ก.ย. 2026) */
.lt-kpi-sub { margin-top: 0.2rem; font-size: 0.72rem; color: #8a80a0; white-space: nowrap; line-height: 1.3; }
.lt-kpi-sub-v { color: var(--lt-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.lt-kpi-val {
  margin: 0.1rem 0 0;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--lt-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  word-break: break-word;
}
/* กล่องตัวเลขต้องสูงเท่าเดิมเสมอ ไม่ว่าจะใส่สปินเนอร์ (ตอนรีเฟรชค่า) หรือตัวเลข — Vuexy .icon-base/.icon-20px/.icon-28px
   ตั้ง font-size/width/height ของไอคอนเอง ทำให้บรรทัดสูงไม่เท่ากับตัวเลข (20px / 28px vs 24px) แล้วข้อความในการ์ดขยับทุกครั้งที่หมุน */
.lt-kpi-val { min-height: 1.15em; }
.lt-kpi-val .fa-spinner,
.lt-kpi-val .icon-base,
.lt-kpi-val .fa-spinner::before,
.lt-kpi-val .icon-base::before {
  font-size: 1em !important;
  width: auto !important;
  height: auto !important;
  line-height: inherit !important;
}
.lt-kpi-val .fa-spinner,
.lt-kpi-val .icon-base {
  display: inline-block;
  vertical-align: baseline;
}
/* สปินเนอร์ที่เป็นลูกเดียวของกล่องตัวเลข (ตอนรอโหลด/รีเฟรช) ให้ลอยออกจาก flow — กล่องสูงเท่า min-height (= บรรทัดตัวเลข) เสมอ
   ไม่ว่าฟอนต์ไอคอนจะวัดบรรทัดต่างจากฟอนต์ตัวเลขแค่ไหน การ์ดจึงไม่ขยับตอนตัวเลขมาแทนที่ */
.lt-kpi-val { position: relative; }
.lt-kpi-val > .fa-spinner:only-child,
.lt-kpi-val > .icon-base:only-child {
  position: absolute;
  left: 0;
  top: 50%;
  margin-top: -0.5em;
  line-height: 1 !important;
}
.lt-kpi-in::before { background: linear-gradient(180deg, #12b981, #0e9f6e); }
.lt-kpi-in .lt-kpi-ico { background: linear-gradient(135deg, #12b981, #0e9f6e); }
.lt-kpi-in .lt-kpi-val { color: var(--lt-leaf); }
.lt-kpi-out::before { background: linear-gradient(180deg, var(--lt-marigold), #d97706); }
.lt-kpi-out .lt-kpi-ico { background: linear-gradient(135deg, var(--lt-marigold), #d97706); }
.lt-kpi-out .lt-kpi-val { color: #d97706; }
.lt-kpi-com::before { background: var(--lt-chrome); }
.lt-kpi-com .lt-kpi-ico { background: var(--lt-chrome); }
.lt-kpi-com .lt-kpi-val { color: var(--lt-chili); }
.lt-kpi-user::before { background: linear-gradient(180deg, #8b7ae8, #6d5bd0); }
.lt-kpi-user .lt-kpi-ico { background: linear-gradient(135deg, #8b7ae8, #6d5bd0); }

.lt-dash-sub { font-size: 0.82rem; margin-top: 0.1rem; }
.lt-dash-sub:empty { display: none; }
.lt-dash-group { font-size: 0.76rem; color: #8a80a0; }

/* ตาราง dashboard: หวย/งวด | สถานะ | 3 ตัวเลข */
@media (min-width: 992px) {
  .lt-bp-table.lt-dash-table {
    grid-template-columns: minmax(260px, 2.2fr) minmax(104px, max-content) repeat(3, minmax(96px, 0.8fr));
  }
  .lt-dash-table .lt-bp-head span:last-child { text-align: end; }
  @supports not (grid-template-columns: subgrid) {
    .lt-dash-table .lt-bp-head,
    .lt-dash-table .lt-bp-row {
      grid-template-columns: minmax(260px, 2.2fr) minmax(104px, max-content) repeat(3, minmax(96px, 0.8fr));
    }
  }
}
@media (max-width: 991.98px) {
  .lt-dash-table .lt-bp-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main status"
      "stats stats";
  }
  .lt-dash-table .lt-bp-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    padding-top: 0.4rem;
  }
  .lt-dash-table .lt-bp-stats .lt-bd-stat { text-align: center; }
}

/* ชิปตัวเลขในตาราง dashboard — จัดกึ่งกลางคอลัมน์และกว้างเท่ากันทุกช่อง
   (ของเดิมชิดขวา ทำให้ช่องว่างซ้าย-ขวาของแต่ละชิปไม่เท่ากัน ดูไม่สมดุล) */
@media (min-width: 992px) {
  .lt-dash-table .lt-bp-head span:nth-child(n + 3),
  .lt-dash-table .lt-bp-head span:last-child { text-align: center; }
  .lt-dash-table .lt-bp-stats .lt-bd-stat { text-align: center; }
  /* คอลัมน์สถานะ: ป้ายอยู่กึ่งกลางคอลัมน์เหมือนหัวคอลัมน์ (เหมือนหน้า /lottery/bill) */
  .lt-dash-table .lt-bp-head span:nth-child(2) { text-align: center; }
  .lt-dash-table .lt-bp-status { justify-content: center; }
}
.lt-dash-row .lt-rc-num-main,
.lt-dash-row .lt-rc-num,
.lt-dash-row .lt-rc-num-empty {
  display: inline-block;
  min-width: 4.5rem;
  text-align: center;
}
/* ช่องที่ยังไม่ออกผล ให้มีกล่องขนาดเท่ากัน แถวจะได้ไม่ยุบ */
.lt-dash-row .lt-rc-num-empty {
  background: rgba(43, 33, 64, 0.04);
  border: 1px dashed rgba(43, 33, 64, 0.14);
  border-radius: 8px;
  padding: 0.1rem 0.55rem;
}

/* hover/focus ของเมนู (กันกฎ specificity สูงของ Vuexy ทุกกรณี) */
.lt-admin #layout-menu .menu-inner .menu-link:hover,
.lt-admin #layout-menu .menu-inner .menu-link:focus,
.lt-admin #layout-menu .menu-sub .menu-link:hover,
.lt-admin #layout-menu .menu-sub .menu-link:focus {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.lt-admin #layout-menu .menu-inner > .menu-item.active > .menu-link:hover {
  background: var(--lt-chrome);
  color: #fff;
}
.lt-admin #layout-menu .menu-sub .menu-item.active > .menu-link,
.lt-admin #layout-menu .menu-sub .menu-item.active > .menu-link:hover {
  background-color: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* ── company /lottery/round (รายงานยอดเดิมพัน) ─────────────────── */
.lt-kpi-total::before { background: linear-gradient(180deg, #8b7ae8, #6d5bd0); }
.lt-kpi-total .lt-kpi-ico { background: linear-gradient(135deg, #8b7ae8, #6d5bd0); }

/* ปุ่มเลือกหวยของหน้านี้ (round.js สร้าง <button> เอง — ใช้ .btn-outline-success = ถูกเลือก) */
.lt-round-lots { margin: 0; }
.lt-round-lots > .col-12 { padding: 0; }
.lt-admin .lt-round-lots .lottery-category-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 !important;
  padding: 0.35rem 0.75rem !important;
  border-radius: 999px !important;
  border: 1.5px solid var(--lt-line) !important;
  background: #fff !important;
  color: #7a7090 !important;
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: none !important;
}
.lt-admin .lt-round-lots .lottery-category-item img {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 3px;
  margin: 0 !important;
}
.lt-admin .lt-round-lots .lottery-category-item span { color: inherit !important; }
.lt-admin .lt-round-lots .lottery-category-item:hover { border-color: rgba(240, 62, 82, 0.45) !important; }
.lt-admin .lt-round-lots .lottery-category-item.btn-outline-success {
  border-color: rgba(14, 159, 110, 0.55) !important;
  background: rgba(14, 159, 110, 0.08) !important;
  color: var(--lt-ink) !important;
  font-weight: 600;
}
.lt-admin .lt-round-lots .lottery-category-item .lt-lot-tick-i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 0.6rem;
  background: #eeeaf4;
  color: transparent;
  flex: none;
}
.lt-admin .lt-round-lots .lottery-category-item.btn-outline-success .lt-lot-tick-i {
  background: var(--lt-leaf);
  color: #fff;
}

/* จัดกลุ่มหวยแบบเดียวกับฝั่ง member */
.lt-round-lots .lt-lot-groups {
  max-height: min(52vh, 460px);
  overflow-y: auto;
  padding-inline-end: 0.35rem;
  width: 100%;
}
.lt-round-lots .lt-lot-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.lt-round-lots .lt-lot-group.d-none { display: none !important; }

/* ตารางรอบหวย: หวย/งวด | ยอดรวม | ยอดเข้า | ส่งออก | จัดการ */
.lt-cr-row .lt-bd-stat b { font-variant-numeric: tabular-nums; }
.lt-cr-row .lt-bd-stat.is-in b { color: var(--lt-leaf); }
.lt-cr-row .lt-bd-stat.is-out b { color: #d97706; }
@media (min-width: 992px) {
  .lt-bp-table.lt-cr-table {
    grid-template-columns: minmax(260px, 2.2fr) repeat(3, minmax(104px, 0.9fr)) max-content;
  }
  .lt-cr-table .lt-bp-head span:nth-child(n + 2) { text-align: end; }
  .lt-cr-table .lt-bp-head span:last-child { text-align: center; }
  @supports not (grid-template-columns: subgrid) {
    .lt-cr-table .lt-bp-head,
    .lt-cr-table .lt-bp-row {
      grid-template-columns: minmax(260px, 2.2fr) repeat(3, minmax(104px, 0.9fr)) max-content;
    }
  }
}
@media (max-width: 991.98px) {
  .lt-cr-table .lt-bp-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "main"
      "stats"
      "action";
  }
  .lt-cr-table .lt-bp-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    padding-top: 0.4rem;
  }
  .lt-cr-table .lt-bp-stats .lt-bd-stat { text-align: center; }
  .lt-cr-table .lt-bp-actions { width: 100%; margin-top: 0.5rem; }
  .lt-cr-table .lt-bp-actions .btn { width: 100%; }
}

/* โหมดการ์ด */
.lt-cr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.75rem;
}
.lt-cr-card {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  padding: 0.85rem 0.9rem;
  overflow: hidden;
}
.lt-cr-card .lt-bp-main { padding: 0; }
.lt-cr-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.65rem;
  padding-top: 0.6rem;
  border-top: 2px dashed rgba(43, 33, 64, 0.12);
}
.lt-cr-stats .lt-bd-stat { text-align: center; }
.lt-cr-stats .lt-bd-stat b { font-variant-numeric: tabular-nums; }
.lt-cr-stats .lt-bd-stat.is-in b { color: var(--lt-leaf); }
.lt-cr-stats .lt-bd-stat.is-out b { color: #d97706; }
.lt-cr-foot { margin-top: 0.7rem; }
.lt-cr-foot .btn { width: 100%; }
/* ค่าที่ clone มาถูกห่อด้วย <span class="text-custom-dark"> ซึ่งกำหนดสีเอง — ต้องไล่สีถึงลูกด้วย */
.lt-cr-row .lt-bd-stat.is-in b,
.lt-cr-row .lt-bd-stat.is-in b *,
.lt-cr-stats .lt-bd-stat.is-in b,
.lt-cr-stats .lt-bd-stat.is-in b * { color: var(--lt-leaf) !important; }
.lt-cr-row .lt-bd-stat.is-out b,
.lt-cr-row .lt-bd-stat.is-out b *,
.lt-cr-stats .lt-bd-stat.is-out b,
.lt-cr-stats .lt-bd-stat.is-out b * { color: #d97706 !important; }

/* จอแคบของหน้า /lottery/round: ปุ่ม "รายงาน" ควรเป็นปุ่มเต็มความกว้างมีข้อความ
   (กฎกลางของ theme2 ย่อปุ่มจัดการเป็นวงกลม ⋮ ซึ่งเหมาะกับหน้าโพย แต่ไม่เหมาะกับหน้านี้) */
@media (max-width: 991.98px) {
  .lt-cr-table .lt-bp-actions .dropdown-toggle,
  .lt-cr-card .lt-cr-foot .dropdown-toggle {
    width: 100% !important;
    height: auto !important;
    padding: 0.45rem 0.9rem !important;
    border-radius: 12px !important;
    font-size: 0.88rem !important;
    font-weight: 600;
    background: var(--lt-leaf) !important;
    border-color: var(--lt-leaf) !important;
    color: #fff !important;
  }
  .lt-cr-table .lt-bp-actions .dropdown-toggle::before,
  .lt-cr-card .lt-cr-foot .dropdown-toggle::before { content: none !important; }
  .lt-cr-table .lt-bp-actions .dropdown-toggle::after,
  .lt-cr-card .lt-cr-foot .dropdown-toggle::after { display: inline-block !important; margin-inline-start: 0.35rem; }
  .lt-cr-table .lt-bp-actions .dropdown-toggle:hover,
  .lt-cr-table .lt-bp-actions .dropdown-toggle.show {
    background: #0b8a5f !important;
    border-color: #0b8a5f !important;
    color: #fff !important;
  }
  .lt-cr-table .lt-bp-actions .dropdown { width: 100%; }
}

/* ── เมนูซ้าย: สถานะ active ให้เด่นขึ้น + ตัวหนังสือใหญ่ขึ้นอีกนิด ──── */
.lt-admin .menu-inner .menu-link { font-size: 0.98rem; }
.lt-admin .menu-inner .menu-icon { font-size: 1.05rem; }
.lt-admin .menu-sub .menu-link { font-size: 0.92rem; padding: 0.45rem 0.75rem 0.45rem 1rem; } /* ซ้าย 1rem: ปุ่มเริ่มถัดจากเส้นไกด์ (~37px) → ข้อความที่ ~53px ตรงแนวข้อความเมนูหลัก */

/* เมนูย่อยที่เลือกอยู่: ใช้สีแบรนด์เต็มปุ่ม (ของเดิมเป็นขาวโปร่ง ๆ แทบมองไม่ออกว่า active) */
.lt-admin #layout-menu .menu-sub .menu-item.active > .menu-link,
.lt-admin #layout-menu .menu-sub .menu-item.active > .menu-link:hover,
.lt-admin #layout-menu .menu-sub .menu-item.active > .menu-link:focus {
  background: var(--lt-chrome) !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(240, 62, 82, 0.35);
}
/* ขีดบอกตำแหน่งบนเส้นไกด์ของเมนูย่อย */
.lt-admin #layout-menu .menu-sub .menu-item.active {
  position: relative;
}
.lt-admin #layout-menu .menu-sub .menu-item.active::before {
  content: "";
  position: absolute;
  left: -0.62rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  border-radius: 3px;
  background: var(--lt-marigold);
}
/* เมนูหลักที่กางอยู่ (มีลูกที่ active) — ให้เห็นว่าเป็นกลุ่มที่ใช้งานอยู่ */
.lt-admin #layout-menu .menu-inner > .menu-item.active.open > .menu-toggle {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
}
.lt-admin #layout-menu .menu-inner > .menu-item.active.open > .menu-toggle .menu-icon { color: var(--lt-marigold); }

/* ── ไอคอนเมนูหลักเป็นแผ่นสี ─────────
   คลาส .lt-mi-* ใส่เพิ่มที่ <i class="menu-icon"> ใน main2.ejs (ไม่แตะคลาสของ Vuexy) — สีต่อเมนู 1 สี
   ตอน active (พื้นปุ่มเป็น chrome) แผ่นเปลี่ยนเป็นขาวโปร่งเพื่อไม่ให้สีตีกัน; เมนูกลุ่มที่กางอยู่คงสีของตัวเอง */
.lt-admin .menu-inner > .menu-item > .menu-link .menu-icon.lt-mi {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  margin-inline-end: 0.7rem;
  border-radius: 9px;
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 2px 6px rgba(0, 0, 0, 0.22);
  transition: transform 0.12s ease, filter 0.12s ease;
}
/* glyph ข้างใน (FA วาดผ่าน ::before) — คุมขนาดเองเพราะ .icon-18px ของ Vuexy ถูกถอดออกจากไอคอนเหล่านี้ใน main2.ejs */
.lt-admin .menu-inner > .menu-item > .menu-link .menu-icon.lt-mi::before { font-size: 0.85rem; line-height: 1; }
.lt-admin .menu-inner > .menu-item > .menu-link:hover .menu-icon.lt-mi { filter: brightness(1.08); transform: translateY(-1px); }
/* สีต่อเมนู — กฎ specificity ต่ำ (0,2,0) จึงต้องไม่ใส่ background ในกฎแผ่นพื้นฐานด้านบน; ค่าเริ่มต้นอยู่บรรทัดแรก */
.lt-admin .lt-mi { background: linear-gradient(135deg, #6f6685, #8a80a0); }
.lt-admin .lt-mi-home { background: linear-gradient(135deg, #6d5bd0, #8b7ae8); }
.lt-admin .lt-mi-lottery { background: linear-gradient(135deg, var(--lt-chili), var(--lt-tangerine)); }
.lt-admin .lt-mi-report { background: linear-gradient(135deg, #0e9f6e, #12b981); }
.lt-admin .lt-mi-result { background: linear-gradient(135deg, #d97706, var(--lt-marigold)); }
.lt-admin .lt-mi-member { background: linear-gradient(135deg, #2b7de9, #4f9cf5); }
.lt-admin .lt-mi-member-setting { background: linear-gradient(135deg, #2ba7c9, #38b6d9); }
.lt-admin .lt-mi-assistant { background: linear-gradient(135deg, #d63384, #f06aa5); }
.lt-admin .lt-mi-transaction { background: linear-gradient(135deg, #16a34a, #4ade80); }
.lt-admin .lt-mi-news { background: linear-gradient(135deg, #9333ea, #b56cf6); }
.lt-admin .lt-mi-log { background: linear-gradient(135deg, #64748b, #94a3b8); }
.lt-admin .lt-mi-setting { background: linear-gradient(135deg, #475569, #6b7a90); }
/* active: พื้นปุ่มเป็น chrome อยู่แล้ว → แผ่นขาวโปร่ง ไอคอนขาว */
.lt-admin .menu-inner > .menu-item.active > .menu-link .menu-icon.lt-mi,
.lt-admin .menu-inner > .menu-item.active > .menu-link:hover .menu-icon.lt-mi {
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  color: #fff;
}
/* กลุ่มที่กางอยู่และมีลูก active: คงสีของแผ่น (ทับกฎเดิมที่ย้อมไอคอนเป็นทอง) */
.lt-admin #layout-menu .menu-inner > .menu-item.active.open > .menu-toggle .menu-icon.lt-mi { color: #fff; }
/* เมนูย่อลง (icon-only): ปุ่มจัดกึ่งกลางเอง (กฎในหัวข้อ "ระยะซ้ายของเมนู") — ตัด margin ขวาของแผ่นออกให้กึ่งกลางพอดี */
@media (min-width: 1200px) {
  html.layout-menu-collapsed:not(.layout-menu-hover) .lt-admin #layout-menu .menu-inner > .menu-item > .menu-link .menu-icon.lt-mi { margin-inline: 0; }
}

/* ── โมดัล "ยอดเดิมพันตามสมาชิก" (#modalReportUser) ────────────────
   ตารางถูกสร้างใหม่โดย round.js ทุกครั้ง — จัดสไตล์ผ่านคลาสที่มันสร้าง
   (.table-custom-color, .td-right-bordered, .td-top-bordered) เท่านั้น */
/* จอใหญ่ (27") ให้ใช้พื้นที่คุ้มขึ้น — ตารางมี 12 คอลัมน์ ยิ่งกว้างยิ่งไม่ต้องเลื่อนแนวนอน */
.lt-rpt-modal .modal-dialog { max-width: min(1680px, 94vw); }
.lt-rpt-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  color: #5f5675;
}
.lt-rpt-meta img { border-radius: 3px; }
.lt-rpt-meta .d-flex { gap: 0.35rem; }

/* breadcrumb เป็นชิปเส้นทางการไล่ดูสายงาน */
.lt-rpt-crumb { margin-bottom: 0.6rem; }
.lt-rpt-crumb .breadcrumb {
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0;
  background: transparent;
}
.lt-rpt-crumb .breadcrumb:empty { display: none; }
/* ชิป breadcrumb: ตัว <a> เป็นตัวชิปเอง (พื้นที่กดเต็มชิป)
   — ของเดิม <li> เป็นชิปแต่ handler อยู่ที่ <a> ข้างใน กดขอบชิปแล้วไม่ติด */
.lt-rpt-crumb .breadcrumb-item {
  display: inline-flex;
  align-items: center;
  padding: 0;
  background: transparent;
}
.lt-rpt-crumb .breadcrumb-item + .breadcrumb-item::before {
  content: "\203a";
  padding: 0 0.35rem;
  color: #b0a7c4;
  font-size: 1rem;
}
.lt-rpt-crumb .breadcrumb-item > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 3.4rem;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  background: #f3f0f8;
  color: #7a7090;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.lt-rpt-crumb .breadcrumb-item > a:hover { background: #e9e4f1; color: var(--lt-ink); }
.lt-rpt-crumb .breadcrumb-item.active > a {
  background: var(--lt-ink);
  color: #fff;
  cursor: default;
}


/* ตาราง */
.lt-rpt-table {
  max-height: min(62vh, 560px);
  overflow: auto;
  border-radius: 14px;
  border: 1.5px solid var(--lt-line);
}
.lt-rpt-table table {
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.lt-rpt-table thead th {
  position: sticky;
  z-index: 3;
  border: 0 !important;
  color: #fff !important;
  font-weight: 700;
  white-space: nowrap;
  padding: 0.5rem 0.65rem !important;
}
/* แถวบน = ชื่อกลุ่ม (เข้ม) แถวล่าง = หัวคอลัมน์ย่อย (อ่อนกว่า) */
.lt-rpt-table thead tr:first-child th {
  top: 0;
  background: var(--lt-ink) !important;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}
/* หัวคอลัมน์ย่อย: พื้นอ่อน ตัวหนังสือเข้ม อ่านง่ายกว่าพื้นส้มเข้ม + ไล่สีอ่อน ๆ ตามกลุ่ม */
.lt-rpt-table thead tr:nth-child(2) th {
  top: 38px;
  background: #f1eef5 !important;
  color: var(--lt-ink) !important;
  font-size: 0.82rem;
  font-weight: 600;
  border-bottom: 2px solid rgba(43, 33, 64, 0.12) !important;
}
.lt-rpt-table thead tr:nth-child(2) th:nth-child(-n + 3) {
  background: rgba(43, 167, 201, 0.14) !important;
  color: #14748f !important;
}
.lt-rpt-table thead tr:nth-child(2) th:nth-child(n + 4):nth-child(-n + 6) {
  background: rgba(240, 62, 82, 0.12) !important;
  color: #c02a3c !important;
}
.lt-rpt-table thead tr:nth-child(2) th:nth-child(n + 7) {
  background: rgba(109, 91, 208, 0.14) !important;
  color: #5344a8 !important;
}
.lt-rpt-table thead tr:first-child th[rowspan] {
  background: linear-gradient(180deg, var(--lt-ink), #3b2f57) !important;
  vertical-align: middle;
}
/* ชื่อกลุ่มแถวบน ใช้สีเดียวกับหัวคอลัมน์ย่อยของกลุ่มนั้น (เข้มขึ้นเพื่อให้ตัวหนังสือขาวอ่านได้) */
.lt-rpt-table thead tr:first-child th[colspan]:nth-child(4) { background: #2ba7c9 !important; }
.lt-rpt-table thead tr:first-child th[colspan]:nth-child(5) { background: var(--lt-chili) !important; }
.lt-rpt-table thead tr:first-child th[colspan]:nth-child(6) { background: #6d5bd0 !important; }

.lt-rpt-table tbody td,
.lt-rpt-table tfoot td {
  border: 0 !important;
  border-bottom: 1px solid rgba(43, 33, 64, 0.08) !important;
  padding: 0.6rem 0.7rem !important;
  font-size: 0.98rem;
  font-weight: 600;
  background: #fff;
}
/* ตัวเลขในตาราง — ใหญ่และหนาขึ้นให้อ่านง่าย */
.lt-rpt-table tbody td.text-end,
.lt-rpt-table tfoot td.text-end {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.lt-rpt-table tfoot td.text-end { font-size: 1.06rem; font-weight: 800; }
.lt-rpt-table tbody tr:hover td { background: #faf8fc; }
/* เส้นแบ่งกลุ่มคอลัมน์ */
.lt-rpt-table .td-right-bordered { border-right: 2px solid rgba(43, 33, 64, 0.14) !important; }
/* แถวรวม — แถบสรุปสีเข้ม ตรึงไว้ล่างสุด ให้แยกจากแถวข้อมูลชัดเจน */
.lt-rpt-table tfoot td,
.lt-rpt-table .td-top-bordered td {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--lt-ink) !important;
  color: #fff !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.08);
  font-weight: 800;
}
/* สีตัวเลขบนพื้นเข้ม (คลาสของสคริปต์เป็นสีสำหรับพื้นขาว จึงต้องย้อมใหม่) */
.lt-rpt-table tfoot td.text-custom-dark,
.lt-rpt-table tfoot td.text-custom-dark * { color: #fff !important; }
.lt-rpt-table tfoot td.text-success,
.lt-rpt-table tfoot td.text-success * { color: var(--lt-pos-dark) !important; }
/* แดงบนแถบรวมใช้เฉดเดียวกับ --lt-chili (สว่างขึ้นพอให้อ่านบนพื้นเข้ม)
   ของเดิม var(--lt-neg-dark) ออกชมพู ดูคนละสีกับตัวเลขแดงในแถวข้อมูล */
.lt-rpt-table tfoot td.text-danger,
.lt-rpt-table tfoot td.text-danger * { color: var(--lt-neg-dark) !important; }
/* แถวข้อมูล: คลาส text-success/text-danger ของเทมเพลตเป็นคนละเฉดกับธีม
   บังคับให้ทั้งตารางและการ์ดใช้แดง/เขียวชุดเดียวกัน */
.lt-rpt-table tbody td.text-danger,
.lt-rpt-table tbody td.text-danger * { color: var(--lt-chili) !important; }
.lt-rpt-table tbody td.text-success,
.lt-rpt-table tbody td.text-success * { color: var(--lt-leaf) !important; }
.lt-rpt-table tfoot td:first-child {
  border-start-start-radius: 0;
  letter-spacing: 0.03em;
}
.lt-rpt-table tfoot .td-right-bordered { border-right-color: rgba(255, 255, 255, 0.16) !important; }
/* คอลัมน์ชื่อผู้ใช้ตรึงไว้ตอนเลื่อนแนวนอน
   ระวัง: `thead th:first-child` จะจับ "ยอดส่งออก" ของหัวแถวที่ 2 ด้วย (มันเป็นลูกคนแรกของแถวนั้น)
   ทำให้ไปติดซ้ายซ้อนทับคอลัมน์ชื่อผู้ใช้ — ต้องเจาะจงเฉพาะแถวแรกเท่านั้น */
.lt-rpt-table thead tr:first-child th:first-child,
.lt-rpt-table tbody td:first-child,
.lt-rpt-table tfoot td:first-child {
  position: sticky;
  left: 0;
  box-shadow: 2px 0 6px rgba(43, 33, 64, 0.06);
}
.lt-rpt-table thead tr:first-child th:first-child { z-index: 6; }
.lt-rpt-table thead tr:nth-child(2) th {
  left: auto;
  box-shadow: none;
  z-index: 4;
}
.lt-rpt-table tbody td:first-child { background: #fff; z-index: 2; }
.lt-rpt-table tfoot td:first-child { z-index: 3; }
/* ชื่อผู้ใช้ + ป้าย role */
.lt-rpt-table tbody td:first-child .badge {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}
.lt-rpt-table tbody td:first-child .text-info {
  color: var(--lt-ink) !important;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(43, 33, 64, 0.25);
  text-underline-offset: 2px;
}
.lt-rpt-table tbody td:first-child .small { color: #8a80a0; }

@media (max-width: 767.98px) {
  .lt-rpt-table { max-height: 66vh; }
  .lt-rpt-table thead tr:nth-child(2) th { top: 34px; }
  .lt-rpt-table tbody td,
  .lt-rpt-table tfoot td { font-size: 0.82rem; padding: 0.45rem 0.5rem !important; }
}

/* ── โมดัลยอดเดิมพันตามสมาชิก: โหมดการ์ด (ค่าเริ่มต้น) ───────────── */
.lt-rpt-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}
.lt-rpt-toggle { flex: none; }

#ltRptList { display: flex; flex-direction: column; gap: 0.6rem; }

/* แถบรวมทั้งหมด */
.lt-rpt-total {
  background: var(--lt-ink);
  border-radius: 16px;
  padding: 0.8rem 0.9rem;
  color: #fff;
}
.lt-rpt-total-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding-bottom: 0.6rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.18);
}
.lt-rpt-total-label { font-weight: 700; letter-spacing: 0.02em; }
.lt-rpt-total .lt-rpt-stat-label { color: rgba(255, 255, 255, 0.6); }
.lt-rpt-total .lt-rpt-stat-val { color: #fff; }
.lt-rpt-total .lt-rpt-stat.is-pos .lt-rpt-stat-val { color: var(--lt-pos-dark); }
/* แดงบนแถบรวม (พื้นเข้ม) ใช้เฉดเดียวกับ --lt-chili แค่สว่างขึ้นพอให้อ่านได้
   ของเดิม var(--lt-neg-dark) ออกชมพู ดูคนละสีกับตัวเลขแดงในการ์ดพื้นขาว */
.lt-rpt-total .lt-rpt-stat.is-neg .lt-rpt-stat-val { color: var(--lt-neg-dark); }
.lt-rpt-total .lt-rpt-block {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}
.lt-rpt-total .lt-rpt-block-title { color: rgba(255, 255, 255, 0.72); }

/* การ์ดต่อสมาชิก */
.lt-rpt-card {
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  background: #fff;
  padding: 0.8rem 0.9rem;
}
.lt-rpt-card-head,
.lt-rpt-total-head { justify-content: space-between; }
.lt-rpt-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding-bottom: 0.6rem;
  margin-bottom: 0.6rem;
  border-bottom: 2px dashed rgba(43, 33, 64, 0.12);
}
.lt-rpt-who {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  min-width: 0;
}
.lt-rpt-who .badge {
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
}
.lt-rpt-who .text-info {
  color: var(--lt-ink) !important;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(43, 33, 64, 0.25);
  text-underline-offset: 3px;
}
.lt-rpt-username { font-size: 0.78rem; color: #8a80a0; }

.lt-rpt-head-stats { display: flex; align-items: center; gap: 1.1rem; }
.lt-rpt-stat { display: flex; flex-direction: column; line-height: 1.2; }
.lt-rpt-stat-label { font-size: 0.72rem; color: #8a80a0; }
.lt-rpt-stat-val {
  font-weight: 700;
  color: var(--lt-ink);
  font-variant-numeric: tabular-nums;
}
.lt-rpt-stat.is-pos .lt-rpt-stat-val { color: var(--lt-leaf); }
.lt-rpt-stat.is-neg .lt-rpt-stat-val { color: var(--lt-chili); }
.lt-rpt-stat.is-total .lt-rpt-stat-val { font-size: 1.15rem; }

/* 3 บล็อก: สมาชิก / ของฉัน / บริษัท */
.lt-rpt-blocks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.lt-rpt-block {
  border: 1.5px solid var(--lt-line);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  background: #fbfafd;
}
.lt-rpt-block-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #7a7090;
  padding-bottom: 0.35rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid rgba(43, 33, 64, 0.08);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lt-rpt-block.is-b0 .lt-rpt-block-title { color: #2ba7c9; }
.lt-rpt-block.is-b1 .lt-rpt-block-title { color: var(--lt-chili); }
.lt-rpt-block.is-b2 .lt-rpt-block-title { color: #6d5bd0; }
.lt-rpt-block-stats { display: flex; flex-direction: column; gap: 0.2rem; }
.lt-rpt-block .lt-rpt-stat {
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.lt-rpt-block .lt-rpt-stat-val { font-size: 0.92rem; }

@media (max-width: 767.98px) {
  .lt-rpt-blocks { grid-template-columns: minmax(0, 1fr); }
  .lt-rpt-head-stats { width: 100%; justify-content: space-between; gap: 0.5rem; }
}

/* การ์ด "รายการบิล" ของสมาชิก (โมดัลเดียวกัน เมื่อกดเข้าไปถึง role member) */
.lt-rpt-bill {
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  background: #fff;
  padding: 0.75rem 0.85rem;
}
.lt-rpt-bill.is-win { background: rgba(14, 159, 110, 0.06); border-color: rgba(14, 159, 110, 0.35); }
.lt-rpt-bill-head { display: flex; align-items: center; gap: 0.6rem; }
.lt-rpt-bill-info { min-width: 0; }
.lt-rpt-bill-code .btn-user-report-bill-detail,
.lt-rpt-bill-code .text-info {
  color: var(--lt-ink) !important;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(43, 33, 64, 0.25);
  text-underline-offset: 3px;
}
.lt-rpt-bill-meta { font-size: 0.78rem; color: #8a80a0; margin-top: 0.1rem; }
.lt-rpt-bill-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 2px dashed rgba(43, 33, 64, 0.12);
}
.lt-rpt-bill-stats .lt-rpt-stat { align-items: center; text-align: center; }
.lt-rpt-bill-note {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #5f5675;
  background: #f7f5fb;
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
}
@media (max-width: 575.98px) {
  .lt-rpt-bill-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* มือถือ: โมดัลกางเกือบเต็มจอ (เดิมเหลือขอบซ้าย-ขวาเยอะ เสียพื้นที่) */
@media (max-width: 767.98px) {
  .lt-body .modal .modal-dialog {
    max-width: none !important;
    width: auto !important;
    margin: 0.5rem;
  }
  .lt-body .modal .modal-content { border-radius: 16px; }
  .lt-body .modal .modal-header,
  .lt-body .modal .modal-body,
  .lt-body .modal .modal-footer { padding-inline: 0.85rem; }
}

/* ไอคอนกากบาทของเทมเพลตวาดด้วย CSS mask ที่ ::before (ขนาด 11px สีเทาอ่อน)
   จึงต้องคุมขนาด/สีที่ pseudo-element ไม่ใช่ background ของปุ่ม */
.lt-body .modal .btn-close {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  opacity: 1;
}
.lt-body .modal .btn-close::before {
  width: 16px !important;
  height: 16px !important;
  background-color: var(--lt-ink) !important;
  transition: background-color 0.15s ease;
}
.lt-body .modal .btn-close:hover {
  background-color: rgba(43, 33, 64, 0.08);
  opacity: 1;
}
.lt-body .modal .btn-close:hover::before { background-color: var(--lt-chili) !important; }

/* โหมดการ์ดของโมดัลรายงาน — ขยายขนาดตัวอักษรให้อ่านง่ายขึ้น */
.lt-rpt-total-label { font-size: 1.05rem; }
.lt-rpt-block-title { font-size: 0.88rem; }
.lt-rpt-stat-label { font-size: 0.82rem; }
.lt-rpt-stat-val { font-size: 1.02rem; }
.lt-rpt-block .lt-rpt-stat-val { font-size: 1.02rem; }
.lt-rpt-block .lt-rpt-stat { padding: 0.05rem 0; }
.lt-rpt-stat.is-total .lt-rpt-stat-val { font-size: 1.3rem; }
.lt-rpt-who .text-info { font-size: 1.1rem; }
.lt-rpt-username { font-size: 0.85rem; }
.lt-rpt-who .badge { font-size: 0.68rem; }
.lt-rpt-bill-code .btn-user-report-bill-detail,
.lt-rpt-bill-code .text-info { font-size: 1.05rem; }
.lt-rpt-bill-meta { font-size: 0.85rem; }
.lt-rpt-bill-note { font-size: 0.88rem; }
.lt-rpt-block { padding: 0.65rem 0.75rem; }



/* การ์ดที่มีเมนู dropdown อยู่ข้างใน ต้องไม่ตัดเนื้อหาที่ล้น ไม่งั้นเมนูจะถูกซ่อน (กดแล้วเหมือนไม่มีอะไรเกิดขึ้น) */
.lt-cr-card,
.lt-rc-card,
.lt-bill-card { overflow: visible; }
.lt-cr-card > .lt-ticket-band,
.lt-rc-card > .lt-ticket-band,
.lt-bill-card > .lt-ticket-band { border-radius: 16px 16px 0 0; }
.lt-cr-card .dropdown-menu { z-index: 1056; }


/* ── โมดัล "ยอดเดิมพันตามประเภท" (#modalReportLotteryType) ─────────
   ตารางถูก round.js เขียนทับทั้งก้อน — จัดสไตล์ผ่านคลาสที่มันสร้างเท่านั้น */
/* ตารางนี้มีคอลัมน์ rowspan 2 ช่อง (ประเภทหวย/ยอดรวม) ไม่ใช่ 3 ช่องเหมือนตารางสมาชิก
   ตำแหน่งหัวกลุ่มจึงเลื่อนมา 1 ช่อง ต้องย้อมสีใหม่ทับกฎกลาง */
.lt-ty-table thead tr:first-child th[colspan]:nth-child(3) { background: #2ba7c9 !important; }
.lt-ty-table thead tr:first-child th[colspan]:nth-child(4) { background: var(--lt-chili) !important; }
.lt-ty-table thead tr:first-child th[colspan]:nth-child(5) { background: #6d5bd0 !important; }
.lt-ty-table tbody td:first-child {
  color: var(--lt-ink) !important;
  font-weight: 700;
}


/* แถวที่ยังไม่มียอดในโหมดตาราง — หรี่ลงให้ประเภทที่มีการแทงจริงเด่นกว่า */
.lt-ty-table tbody tr.is-zero td { color: #b3abc4 !important; font-weight: 600; }
.lt-ty-table tbody tr.is-zero td * { color: #b3abc4 !important; }
.lt-ty-table tbody tr.is-zero:hover td,
.lt-ty-table tbody tr.is-zero:hover td * { color: #8a80a0 !important; }

.lt-ty-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  color: #7a7090;
}
.lt-ty-hint i { color: var(--lt-chili); }

#ltTypeList { display: flex; flex-direction: column; gap: 0.6rem; }
/* การ์ดเต็มความกว้าง (จังหวะเดียวกับแถบรวม) — 3 บล็อกข้างในต้องมีที่พอให้ตัวเลขไม่ตกบรรทัด
   จอกว้างมาก (27") ค่อยแบ่ง 2 คอลัมน์ */
.lt-ty-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6rem;
}
@media (min-width: 1500px) {
  .lt-ty-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* การ์ดต่อประเภทหวย */
.lt-ty-card {
  position: relative;
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  background: #fff;
  padding: 0.8rem 0.9rem;
  overflow: hidden;
}
/* แถบสีประจำประเภทด้านซ้าย — ใช้แทนการย้อมทั้งการ์ด จะได้ไม่แย่งสายตากับตัวเลข */
.lt-ty-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--lt-accent, var(--lt-chili));
}
.lt-ty-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.lt-ty-name {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--lt-ink);
}
.lt-ty-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--lt-accent, var(--lt-chili));
  flex: none;
}
.lt-ty-share {
  margin-left: 0.15rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #f3f0f8;
  font-size: 0.74rem;
  font-weight: 700;
  color: #7a7090;
  white-space: nowrap;
}
.lt-ty-amount { text-align: right; line-height: 1.15; }
.lt-ty-amount-label {
  display: block;
  font-size: 0.78rem;
  color: #8a80a0;
}
.lt-ty-amount-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--lt-ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* แถบสัดส่วนถือสู้เอง vs บริษัท */
.lt-ty-split { margin: 0.65rem 0 0.6rem; }
.lt-ty-bar {
  display: flex;
  height: 15px;
  border-radius: 999px;
  overflow: hidden;
  background: #efecf4;
}
.lt-ty-bar span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 0;
}
/* % กำกับในแถบ (เฉพาะการ์ด — แถบรวมด้านบนใช้คำอธิบายเต็มแทน) */
.lt-ty-bar b {
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1;
}
.lt-ty-bar .is-own { background: var(--lt-chili); }
.lt-ty-bar .is-com { background: #6d5bd0; }
.lt-ty-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #7a7090;
}
.lt-ty-leg {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.lt-ty-leg b {
  font-weight: 600;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lt-ty-leg em {
  font-style: normal;
  font-weight: 800;
  color: var(--lt-ink);
  font-variant-numeric: tabular-nums;
}
.lt-ty-leg.is-own .lt-ty-dot { background: var(--lt-chili); }
.lt-ty-leg.is-com .lt-ty-dot { background: #6d5bd0; }

/* แถบรวมทุกประเภท (สีเข้ม) */
.lt-ty-total .lt-ty-bar { background: rgba(255, 255, 255, 0.14); height: 12px; }
.lt-ty-card .lt-ty-split { margin: 0.6rem 0 0.55rem; }
.lt-ty-total .lt-ty-bar .is-own { background: #ff8a94; }
.lt-ty-total .lt-ty-bar .is-com { background: #a99bff; }
.lt-ty-total .lt-ty-legend { color: rgba(255, 255, 255, 0.68); }
.lt-ty-total .lt-ty-leg em { color: #fff; }
.lt-ty-total .lt-ty-leg.is-own .lt-ty-dot { background: #ff8a94; }
.lt-ty-total .lt-ty-leg.is-com .lt-ty-dot { background: #a99bff; }
.lt-ty-total .lt-ty-split { margin: 0 0 0.7rem; }

/* ประเภทที่ยังไม่มียอด — ยุบเป็นชิปแถวเดียว ไม่กินพื้นที่การ์ด */
.lt-ty-none {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  padding: 0.6rem 0.75rem;
  border: 1.5px dashed var(--lt-line);
  border-radius: 14px;
  background: #fbfafd;
}
.lt-ty-none-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #8a80a0;
  margin-right: 0.15rem;
}
.lt-ty-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--lt-line);
  font-size: 0.82rem;
  color: #7a7090;
}
.lt-ty-chip::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--lt-accent, #c9c2d8);
  opacity: 0.5;
}

@media (max-width: 767.98px) {
  .lt-ty-grid { grid-template-columns: minmax(0, 1fr); }
  
/* แถวที่ยังไม่มียอดในโหมดตาราง — หรี่ลงให้ประเภทที่มีการแทงจริงเด่นกว่า */
.lt-ty-table tbody tr.is-zero td { color: #b3abc4 !important; font-weight: 600; }
.lt-ty-table tbody tr.is-zero td * { color: #b3abc4 !important; }
.lt-ty-table tbody tr.is-zero:hover td,
.lt-ty-table tbody tr.is-zero:hover td * { color: #8a80a0 !important; }

.lt-ty-hint { display: none; }
  .lt-ty-amount-val { font-size: 1.3rem; }
}


/* ── โมดัล "ยอดเดิมพันตามหมายเลข" (#modalReportLotteryNumber) ─────
   ตารางเดิมคือ 7 อันดับแยกประเภทวางเรียงกัน — ที่นี่แยกเป็นการ์ดละประเภท */
.lt-num-bar { align-items: center; }
/* .lt-detail-modal .lt-modal-search ตั้ง order:1 ไว้ (ใช้กับโมดัลรายละเอียดบิล)
   ในแถบนี้ต้องรีเซ็ต ไม่งั้นช่องค้นหาจะไปอยู่หลังปุ่มสลับมุมมอง */
.lt-detail-modal .lt-num-search {
  order: 0;
  flex: 1 1 220px;
  max-width: 340px;
  margin-bottom: 0 !important;
}
#ltNumList { display: flex; flex-direction: column; gap: 0.6rem; }

/* แถบสรุป + เลขเสี่ยงสูงสุด */
.lt-num-risk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.7rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.lt-num-risk-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
}
.lt-num-risk-label i { color: #ffb020; }
.lt-num-risk-num {
  display: inline-flex;
  align-items: center;
  min-width: 2.6rem;
  justify-content: center;
  padding: 0.15rem 0.6rem;
  border-radius: 8px;
  background: var(--lt-accent, var(--lt-chili));
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
.lt-num-risk-type { font-size: 0.84rem; color: rgba(255, 255, 255, 0.72); }
.lt-num-risk-val {
  margin-inline-start: auto;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--lt-neg-dark); /* เฉดเดียวกับ "ส่วนลด" บนแถบพื้นเข้ม (.lt-rpt-total .is-neg) — เดิม var(--lt-neg-dark) ออกชมพู */
  font-variant-numeric: tabular-nums;
}

/* ส่วนตั้งรับ */
.lt-num-hold {
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  background: #fbfafd;
  padding: 0.75rem 0.85rem;
}
.lt-num-hold-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.lt-num-hold-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--lt-ink);
}
.lt-num-hold-caret {
  font-size: 0.72rem;
  color: #a79fba;
  transition: transform 0.15s ease;
}
/* พับส่วนตั้งรับ (ค่าเริ่มต้นบนจอแคบ) */
.lt-num-hold.is-collapsed { padding-bottom: 0.7rem; }
.lt-num-hold.is-collapsed .lt-num-hold-head { margin-bottom: 0; }
.lt-num-hold.is-collapsed .lt-num-hold-grid,
.lt-num-hold.is-collapsed #btnUpdateMaxHoldAmount { display: none !important; }
.lt-num-hold.is-collapsed .lt-num-hold-caret { transform: rotate(-90deg); }
.lt-num-hold-title i { color: var(--lt-chili); }
.lt-num-hold-title em {
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 600;
  color: #8a80a0;
}
/* ปุ่มบันทึกเดิม (btn btn-success ของ template) — ทำเป็นปุ่มเขียวทรงเดียวกับ theme2 */
.lt-num-hold #btnUpdateMaxHoldAmount {
  margin: 0 !important;
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  background: #0e9f6e !important;
  color: #fff !important;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(14, 159, 110, 0.25);
}
.lt-num-hold #btnUpdateMaxHoldAmount:hover { background: #0b8a5f !important; }
.lt-num-hold-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
}
.lt-num-hold-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  background: #fff;
  border: 1.5px solid var(--lt-line);
  margin: 0;
}
.lt-num-hold-item:focus-within { border-color: var(--lt-accent, var(--lt-chili)); }
.lt-num-hold-type {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--lt-ink);
}
.lt-num-hold-item .maxHoldSharesAmount {
  width: 100%;
  border: 0 !important;
  border-bottom: 1.5px solid var(--lt-line) !important;
  border-radius: 0;
  padding: 0.15rem 0 !important;
  height: auto !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--lt-ink) !important;
  font-size: 1.02rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.lt-num-hold-item .maxHoldSharesAmount:focus { border-bottom-color: var(--lt-accent, var(--lt-chili)) !important; }
.lt-num-hold-min { font-size: 0.72rem; color: #a79fba; }

/* การ์ดต่อประเภท */
.lt-num-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0.6rem;
}
@media (min-width: 992px) {
  .lt-num-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1500px) {
  .lt-num-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.lt-num-panel {
  position: relative;
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  background: #fff;
  padding: 0.8rem 0.85rem;
  overflow: hidden;
}
.lt-num-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--lt-accent, var(--lt-chili));
}
.lt-num-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.lt-num-type {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--lt-ink);
}
.lt-num-count {
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: #f3f0f8;
  font-size: 0.76rem;
  font-weight: 700;
  color: #7a7090;
  white-space: nowrap;
}
.lt-num-sum {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); /* 6 ช่อง (ยอดรวม/ส่วนลด/ถูกรางวัล/ส่วนต่างจ่าย/ส่วนต่างค่าคอม/คงเหลือ) = 2 แถว แถวละ 3 */
  gap: 0.35rem;
  padding: 0.5rem 0.55rem;
  margin-bottom: 0.55rem;
  border-radius: 12px;
  background: #fbfafd;
  border: 1px solid var(--lt-line);
}
.lt-num-sum .lt-rpt-stat { gap: 0.1rem; }
.lt-num-sum .lt-rpt-stat-label { font-size: 0.74rem; }
.lt-num-sum .lt-rpt-stat-val { font-size: 0.95rem; }

/* อันดับเลข — พื้นหลังของแต่ละแถวคือแท่งเทียบยอด */
.lt-num-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.lt-num-row {
  position: relative;
  display: grid;
  grid-template-columns: 1.5rem auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.45rem;
  border-radius: 10px;
}
.lt-num-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w, 0%);
  border-radius: 10px;
  background: var(--lt-accent, var(--lt-chili));
  opacity: 0.13;
}
.lt-num-row > * { position: relative; }
.lt-num-row:hover::before { opacity: 0.2; }
.lt-num-rank {
  font-size: 0.78rem;
  font-weight: 700;
  color: #a79fba;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
/* ป้ายเลข (element เดิมของ round.js — .badge.text-bg-primary ใช้ !important จึงต้องทับด้วย !important)
   /lottery/round เป็น .badge.btn-number (กดดูผู้ถือเลขได้) ส่วน /report/round เป็น .badge เฉย ๆ */
.lt-num-row .badge {
  background: var(--lt-accent, var(--lt-chili)) !important;
  color: #fff !important;
  border-radius: 8px !important;
  padding: 0.22rem 0.6rem !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  cursor: default;
}
.lt-num-row .btn-number { cursor: pointer; }
.lt-num-row .btn-number:hover { filter: brightness(0.92); }
.lt-num-amt {
  text-align: right;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--lt-ink);
  font-variant-numeric: tabular-nums;
}
.lt-num-pay {
  min-width: 5.2rem;
  text-align: right;
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.lt-num-pay.is-neg { color: var(--lt-chili); }
.lt-num-pay.is-pos { color: var(--lt-leaf); }
/* ถือถึงเพดานตั้งรับแล้ว */
.lt-num-row.is-full .lt-num-amt::after {
  content: "เต็ม";
  margin-inline-start: 0.35rem;
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
  background: rgba(240, 62, 82, 0.14);
  color: var(--lt-chili);
  font-size: 0.68rem;
  font-weight: 800;
}
.lt-num-more {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.4rem;
  border: 1px dashed var(--lt-line);
  border-radius: 10px;
  background: transparent;
  color: #7a7090;
  font-size: 0.84rem;
  font-weight: 700;
}
.lt-num-more:hover { background: #faf8fc; color: var(--lt-ink); }

@media (max-width: 767.98px) {
  .lt-num-search { max-width: none; }
  .lt-num-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lt-num-risk-val { margin-inline-start: 0; }
}


/* ── โมดัลย่อย "ผู้ถือเลขนี้" (#modalReportLotteryNumberHoldShares) ── */
.lt-hs-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  height: 3rem;
  padding: 0 0.6rem;
  border-radius: 14px;
  background: var(--lt-chrome);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 6px 16px rgba(240, 62, 82, 0.25);
}
#ltHsList { display: flex; flex-direction: column; gap: 0.6rem; }
.lt-hs-list { display: flex; flex-direction: column; gap: 0.3rem; }
.lt-hs-row {
  position: relative;
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.lt-hs-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w, 0%);
  background: var(--lt-chili);
  opacity: 0.1;
}
.lt-hs-row > * { position: relative; }
.lt-hs-rank {
  font-size: 0.8rem;
  font-weight: 700;
  color: #a79fba;
  text-align: center;
}
.lt-hs-who { display: flex; flex-direction: column; min-width: 0; }
.lt-hs-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--lt-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lt-hs-bills { font-size: 0.76rem; color: #8a80a0; }
.lt-hs-amt {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--lt-ink);
  font-variant-numeric: tabular-nums;
}
.lt-hs-pay {
  min-width: 6rem;
  text-align: right;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--lt-chili);
  font-variant-numeric: tabular-nums;
}
/* ตารางเดิม (โหมดตาราง) */
.lt-hs-table table { margin: 0; }
.lt-hs-table thead th {
  background: var(--lt-ink) !important;
  color: #fff !important;
  border: 0 !important;
  font-weight: 700;
  padding: 0.5rem 0.65rem !important;
}
.lt-hs-table tbody td {
  border: 0 !important;
  border-bottom: 1px solid rgba(43, 33, 64, 0.08) !important;
  padding: 0.55rem 0.65rem !important;
  font-size: 0.98rem;
  font-weight: 600;
}


/* ── โหมดตารางของโมดัลยอดเดิมพันตามหมายเลข ─────────────────────────
   ตารางถูก round.js สร้างใหม่ทั้งก้อน — คลาสแถว (lt-numt-sum/keep/rank)
   ติดจาก tagTable() ในวิว จัดสไตล์ผ่านคลาสเหล่านี้เท่านั้น */
.lt-numt-table {
  max-height: min(64vh, 640px);
  overflow: auto;
  border-radius: 14px;
  border: 1.5px solid var(--lt-line);
  white-space: normal !important;
}
.lt-numt-table table {
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}
/* หัวตาราง: พื้นเข้ม + ขีดสีประจำประเภทใต้หัวคอลัมน์ */
.lt-numt-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--lt-ink) !important;
  color: #fff !important;
  border: 0 !important;
  padding: 0.55rem 0.7rem !important;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
}
.lt-numt-table thead th:nth-child(2) { box-shadow: inset 0 -3px 0 #f03e52; }
.lt-numt-table thead th:nth-child(3) { box-shadow: inset 0 -3px 0 #ff8a3d; }
.lt-numt-table thead th:nth-child(4) { box-shadow: inset 0 -3px 0 #0e9f6e; }
.lt-numt-table thead th:nth-child(5) { box-shadow: inset 0 -3px 0 #2ba7c9; }
.lt-numt-table thead th:nth-child(6) { box-shadow: inset 0 -3px 0 #14748f; }
.lt-numt-table thead th:nth-child(7) { box-shadow: inset 0 -3px 0 #6d5bd0; }
.lt-numt-table thead th:nth-child(8) { box-shadow: inset 0 -3px 0 #9b8ce0; }
.lt-numt-table thead th:first-child {
  left: 0;
  z-index: 5;
  background: linear-gradient(180deg, var(--lt-ink), #3b2f57) !important;
}

.lt-numt-table tbody td {
  border: 0 !important;
  border-bottom: 1px solid rgba(43, 33, 64, 0.07) !important;
  padding: 0.45rem 0.6rem !important;
  background: #fff;
  vertical-align: middle;
}
/* คอลัมน์แรกตรึงซ้าย */
.lt-numt-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #faf8fc;
  color: var(--lt-ink) !important;
  font-weight: 700;
  text-align: center;
  box-shadow: 2px 0 6px rgba(43, 33, 64, 0.05);
}

/* 3 แถวสรุปด้านบน — แยกออกจากอันดับเลขให้ชัด */
.lt-numt-table tr.lt-numt-sum td {
  background: #fbfafd;
  font-size: 1rem;
  font-weight: 800;
  text-align: right;
}
.lt-numt-table tr.lt-numt-sum td:first-child {
  background: #f3f0f8;
  text-align: center;
  font-size: 0.9rem;
}
.lt-numt-table tr.lt-numt-sum + tr.lt-numt-keep td { border-top: 2px solid rgba(43, 33, 64, 0.1) !important; }

/* แถวตั้งรับ */
.lt-numt-table tr.lt-numt-keep td {
  background: #fff8f4;
  padding: 0.55rem 0.6rem !important;
}
.lt-numt-table tr.lt-numt-keep td:first-child {
  background: #ffeee6;
  display: table-cell !important;
  text-align: center;
  white-space: nowrap;
}
.lt-numt-table tr.lt-numt-keep #btnUpdateMaxHoldAmount {
  display: inline-flex;
  align-items: center;
  margin-top: 0.4rem !important;
  border: 0;
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  background: #0e9f6e !important;
  color: #fff !important;
  font-size: 0.82rem;
  font-weight: 700;
}
.lt-numt-table tr.lt-numt-keep .maxHoldSharesAmount {
  border: 1.5px solid var(--lt-line) !important;
  border-radius: 10px;
  padding: 0.3rem 0.5rem !important;
  height: auto !important;
  text-align: right;
  font-weight: 800;
  color: var(--lt-ink) !important;
  background: #fff !important;
  box-shadow: none !important;
}
.lt-numt-table tr.lt-numt-keep .maxHoldSharesAmount:focus { border-color: var(--lt-chili) !important; }
.lt-numt-table tr.lt-numt-keep .fs-10 { font-size: 0.7rem !important; color: #a79fba !important; }

/* แถวอันดับเลข */
.lt-numt-table tr.lt-numt-rank td { position: relative; }
/* แท่งเทียบยอดเป็นพื้นหลังช่อง (--w ตั้งจาก tagTable) */
.lt-numt-table tr.lt-numt-rank td::before {
  content: "";
  position: absolute;
  inset: 3px auto 3px 0;
  width: var(--w, 0%);
  border-radius: 0 8px 8px 0;
  opacity: 0.12;
}
.lt-numt-table tr.lt-numt-rank td:nth-child(2)::before { background: #f03e52; }
.lt-numt-table tr.lt-numt-rank td:nth-child(3)::before { background: #ff8a3d; }
.lt-numt-table tr.lt-numt-rank td:nth-child(4)::before { background: #0e9f6e; }
.lt-numt-table tr.lt-numt-rank td:nth-child(5)::before { background: #2ba7c9; }
.lt-numt-table tr.lt-numt-rank td:nth-child(6)::before { background: #14748f; }
.lt-numt-table tr.lt-numt-rank td:nth-child(7)::before { background: #6d5bd0; }
.lt-numt-table tr.lt-numt-rank td:nth-child(8)::before { background: #9b8ce0; }
.lt-numt-table tr.lt-numt-rank td > div { position: relative; }
.lt-numt-table tr.lt-numt-rank td:first-child { color: #a79fba !important; font-size: 0.82rem; }
.lt-numt-table tr.lt-numt-rank td:first-child::before { display: none; }
.lt-numt-table tr.lt-numt-rank:hover td { background: #faf8fc; }
.lt-numt-table tr.lt-numt-rank td.is-blank { background: #f7f6fa; }
.lt-numt-table tr.lt-numt-rank td > div:first-child { gap: 0.6rem !important; }
.lt-numt-table tr.lt-numt-rank td > div:first-child > span:last-child {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--lt-ink);
}
.lt-numt-table tr.lt-numt-rank td > div:last-child { margin-top: 0.1rem; }
.lt-numt-table tr.lt-numt-rank td > div:last-child span { font-size: 0.82rem; font-weight: 700; }
/* ป้ายเลข: ใช้สีประจำคอลัมน์ (.text-bg-primary ใช้ !important จึงต้องทับด้วย !important) */
.lt-numt-table .badge {
  border-radius: 8px !important;
  padding: 0.2rem 0.55rem !important;
  font-size: 0.92rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em;
  color: #fff !important;
  cursor: default;
}
.lt-numt-table .btn-number { cursor: pointer; }
.lt-numt-table tbody td:nth-child(2) .badge { background: #f03e52 !important; }
.lt-numt-table tbody td:nth-child(3) .badge { background: #ff8a3d !important; }
.lt-numt-table tbody td:nth-child(4) .badge { background: #0e9f6e !important; }
.lt-numt-table tbody td:nth-child(5) .badge { background: #2ba7c9 !important; }
.lt-numt-table tbody td:nth-child(6) .badge { background: #14748f !important; }
.lt-numt-table tbody td:nth-child(7) .badge { background: #6d5bd0 !important; }
.lt-numt-table tbody td:nth-child(8) .badge { background: #9b8ce0 !important; }
.lt-numt-table .btn-number:hover { filter: brightness(0.92); }

@media (max-width: 767.98px) {
  .lt-numt-table tbody td,
  .lt-numt-table thead th { padding: 0.4rem 0.45rem !important; font-size: 0.85rem; }
  .lt-numt-table tr.lt-numt-sum td { font-size: 0.88rem; }
}


/* ═══════════════════════════════════════════════════════════════
   หน้ารายการบิล company (/lottery/bill)
   ตัวกรองใช้ partial เดิม (ui/lotteryGroupCategoryUi3 + ui/searchDate)
   จัดสไตล์ผ่านคลาสของ partial เท่านั้น — ห้ามแก้ไฟล์ partial (หน้าเก่ายังใช้อยู่)
   ═══════════════════════════════════════════════════════════════ */
.lt-kpi-grid.lt-kpi-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ── การ์ดตัวกรอง ─────────────────────────────────────────────── */
.lt-filter-wrap .row.g-6 { margin: 0 0 0.9rem; --bs-gutter-x: 0; --bs-gutter-y: 0; }
.lt-filter-wrap .card { height: auto !important; }
.lt-filter-wrap .card-header { padding: 0.85rem 1.1rem 0.35rem; }
.lt-filter-wrap .card-header .card-title,
.lt-filter-wrap .text-heading {
  font-size: 1rem;
  font-weight: 800;
  color: var(--lt-ink);
}
.lt-filter-wrap .card-body { padding: 0.35rem 1.1rem 1rem; }
.lt-filter-wrap .accordion { margin-top: 0 !important; }

/* เลือกหวยแบบ checkbox → ชิป */
.lt-body #lotteryCategoryItem { margin: 0; }
.lt-body #lotteryCategoryItem > .row {
  margin: 0 0 0.5rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.lt-body #lotteryCategoryItem > .row > .col-12 { padding: 0; width: 100%; margin-bottom: 0.15rem !important; }
.lt-body #lotteryCategoryItem > .row > [class*="col-"]:not(.col-12) { padding: 0; width: auto; flex: none; }
/* หัวกลุ่ม = ชิปเลือกทั้งกลุ่ม */
.lt-body .header-lottery-category {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.85rem;
  border-radius: 999px;
  border: 1.5px solid rgba(43, 33, 64, 0.15);
  background: #fff;
  color: var(--lt-ink) !important;
  font-size: 0.85rem !important;
  font-weight: 700;
}
.lt-body .header-lottery-category::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Pro", "Font Awesome 6 Free", "FontAwesome";
  font-weight: 900;
  font-size: 0.7rem;
  opacity: 0.25;
}
.lt-body .header-lottery-category.active {
  background: var(--lt-ink);
  border-color: var(--lt-ink);
  color: #fff !important;
}
.lt-body .header-lottery-category.active::before { opacity: 1; }
/* ตัวเลือกหวย: ซ่อน checkbox จริง แล้วทำ label เป็นชิป */
.lt-body .form-check:has(> .form-check-lottery-category) {
  padding: 0;
  margin: 0;
  min-height: 0;
}
.lt-body .form-check-lottery-category {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  border-radius: 0 !important;
  padding: 0 !important;
}
.lt-body .form-check-label-lottery-category {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1.5px solid var(--lt-line);
  background: #fff;
  color: var(--lt-ink);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.lt-body .form-check-label-lottery-category img { border-radius: 3px; }
.lt-body .form-check-label-lottery-category:hover { border-color: var(--lt-ink); }
.lt-body .form-check-lottery-category:checked + .form-check-label-lottery-category {
  background: rgba(240, 62, 82, 0.1);
  border-color: var(--lt-chili);
  color: var(--lt-chili);
  font-weight: 700;
}
.lt-body .form-check-lottery-category:focus-visible + .form-check-label-lottery-category { outline: 2px solid var(--lt-chili); }
/* ปุ่มเลือกทั้งหมด / ล้าง */
/* ปุ่มเลือกทั้งหมด/ล้างทั้งหมด — ทรงเดียวกับ .lt-lot-btn ของหน้า /lottery/round */
.lt-body #btnCategoryAll,
.lt-body #btnClearCategory {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: auto !important;
  height: auto !important;
  border-radius: 999px !important;
  padding: 0.4rem 0.85rem !important;
  font-size: 0.86rem;
  font-weight: 600;
  border: 1.5px solid transparent !important;
  box-shadow: none !important;
  margin: 0 !important;
}
.lt-body #btnCategoryAll { background: var(--lt-ink) !important; color: #fff !important; }
.lt-body #btnCategoryAll:hover { background: #3b2f57 !important; }
.lt-body #btnClearCategory {
  background: #fff !important;
  border-color: rgba(240, 62, 82, 0.4) !important;
  color: var(--lt-chili) !important;
}
.lt-body #btnClearCategory:hover { background: rgba(240, 62, 82, 0.08) !important; }
.lt-body #btnCategoryAll::after { content: "เลือกทั้งหมด"; }
.lt-body #btnClearCategory::after { content: "ล้างทั้งหมด"; }
/* ชิปประเภทหวย (partial ใช้คลาส btn-lottery-category) */
.lt-body .btn-lottery-category {
  border-radius: 999px !important;
  padding: 0.32rem 0.95rem !important;
  font-size: 0.86rem;
  font-weight: 700;
  border: 1.5px solid rgba(43, 33, 64, 0.15) !important;
  box-shadow: none !important;
}
.lt-body .btn-lottery-category.btn-label-secondary { background: #fff !important; color: var(--lt-ink) !important; }
.lt-body .btn-lottery-category.btn-primary,
.lt-body .btn-lottery-category.btn-label-success {
  background: var(--lt-ink) !important;
  border-color: var(--lt-ink) !important;
  color: #fff !important;
}
/* ช่วงวันที่ */
.lt-filter-wrap #startDate,
.lt-filter-wrap #endDate {
  border: 1.5px solid var(--lt-line) !important;
  border-radius: 12px;
  padding: 0.45rem 0.75rem !important;
  height: auto !important;
  font-weight: 600;
  color: var(--lt-ink) !important;
  background: #fff !important;
  box-shadow: none !important;
}
.lt-filter-wrap #startDate:focus,
.lt-filter-wrap #endDate:focus { border-color: var(--lt-chili) !important; }
.lt-filter-wrap .form-label { font-size: 0.8rem; color: #8a80a0; margin-bottom: 0.2rem; }
.lt-body #btnSearch {
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 1.5rem;
  background: var(--lt-chrome) !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(240, 62, 82, 0.22);
}

/* ── ปุ่มส่งออก ───────────────────────────────────────────────── */
.lt-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  background: #fff;
  color: var(--lt-ink);
  font-size: 0.88rem;
  font-weight: 700;
}
.lt-export-btn:hover { border-color: var(--lt-ink); }
.lt-export-btn::after { margin-inline-start: 0.15rem; }
.lt-export .dropdown-menu {
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  padding: 0.35rem;
  box-shadow: 0 12px 30px rgba(43, 33, 64, 0.12);
}
.lt-export .dropdown-item {
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  color: var(--lt-ink);
}

/* ── แถวรายการบิล (เพิ่มคอลัมน์ผู้ใช้) ───────────────────────── */
.lt-cbill-user { display: flex; flex-direction: column; min-width: 0; }
.lt-cbill-username {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--lt-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lt-cbill-fullname {
  font-size: 0.78rem;
  color: #8a80a0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lt-cbill-fullname:empty { display: none; }
.lt-cbill-owner {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.5rem 0 0.15rem;
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
  background: #faf8fc;
  font-size: 0.85rem;
  color: #7a7090;
}
.lt-cbill-owner i { color: var(--lt-chili); }
.lt-cbill-owner b { color: var(--lt-ink); }
.lt-cbill-owner span:empty { display: none; }

@media (min-width: 992px) {
  /* หวย/บิล | ผู้ใช้ | สถานะ | ยอดรวม | ถูกรางวัล | จัดการ */
  .lt-bp-table.lt-cbill-table {
    grid-template-columns: minmax(260px, 2.2fr) minmax(120px, 1fr) minmax(104px, max-content) repeat(2, minmax(100px, 0.9fr)) max-content;
  }
  .lt-cbill-table .lt-bp-head span:nth-child(4),
  .lt-cbill-table .lt-bp-head span:nth-child(5) { text-align: end; }
  .lt-cbill-table .lt-bp-head span:last-child { text-align: end; }
  /* คอลัมน์สถานะ: หัวคอลัมน์กับป้ายต้องอยู่กึ่งกลางคอลัมน์เหมือนกัน */
  .lt-cbill-table .lt-bp-head span:nth-child(3) { text-align: center; }
  .lt-cbill-row .lt-bp-status { justify-content: center; }
}
@media (max-width: 991.98px) {
  /* จอแคบแถวเป็น GRID (grid-template-areas) ไม่ใช่ flex — ต้องประกาศ area ให้บล็อกผู้ใช้ด้วย
     ไม่งั้นจะถูกวางอัตโนมัติไปท้ายแถว ดูเหมือนเป็นของบิลถัดไป (order ใช้ไม่ได้กับ grid areas) */
  .lt-cbill-row {
    grid-template-areas:
      "main status action"
      "user user user"
      "stats stats stats";
  }
  .lt-cbill-row .lt-cbill-user {
    grid-area: user;
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.1rem;
    padding: 0.3rem 0.55rem;
    border-radius: 10px;
    background: #faf8fc;
  }
  .lt-cbill-row .lt-cbill-user::before {
    content: "\f007";
    font-family: "Font Awesome 6 Pro", "Font Awesome 6 Free", "FontAwesome";
    font-weight: 900;
    font-size: 0.72rem;
    color: var(--lt-chili);
  }
  .lt-cbill-row .lt-cbill-username { font-size: 0.88rem; }
  .lt-cbill-row .lt-cbill-fullname { font-size: 0.76rem; }
}

/* ── แท็บในโมดัลรายละเอียดบิล ─────────────────────────────────── */
.lt-pill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  border: 0;
  margin-bottom: 0.85rem;
}
.lt-pill-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1.5px solid var(--lt-line) !important;
  border-radius: 999px !important;
  padding: 0.4rem 1rem !important;
  background: #fff !important;
  color: #7a7090 !important;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: none !important;
}
.lt-pill-tabs .nav-link:hover { border-color: var(--lt-ink) !important; color: var(--lt-ink) !important; }
.lt-pill-tabs .nav-link.active {
  background: var(--lt-ink) !important;
  border-color: var(--lt-ink) !important;
  color: #fff !important;
}
.lt-pill-tabs .nav-link i { font-size: 0.9rem; }

/* หลักฐาน */
.lt-evidence {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}
.lt-evidence-item {
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  padding: 0.75rem;
  background: #fff;
}
.lt-evidence-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--lt-ink);
  margin-bottom: 0.5rem;
}
.lt-evidence-title i { color: var(--lt-chili); }
.lt-evidence-body { text-align: center; }
.lt-evidence-body img {
  border-radius: 12px;
  border: 1px solid var(--lt-line);
}
.lt-evidence-body:empty::after {
  content: "ไม่มีรูป";
  display: block;
  padding: 1.5rem 0;
  color: #b3abc4;
  font-size: 0.85rem;
}

/* สายงานของบิล */
.lt-path-hint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  color: #8a80a0;
  margin-bottom: 0.6rem;
}
.lt-path-hint i { color: var(--lt-chili); }
#ltPathList { display: flex; flex-direction: column; gap: 0.5rem; }
.lt-path-row {
  position: relative;
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr);
  gap: 0.6rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  padding: 0.7rem 0.85rem;
  background: #fff;
}
.lt-path-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--lt-chrome);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}
.lt-path-main { min-width: 0; }
.lt-path-user { font-size: 1.02rem; font-weight: 800; color: var(--lt-ink); }
.lt-path-share {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
  margin-top: 0.1rem;
  font-size: 0.8rem;
  color: #8a80a0;
}
.lt-path-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 0.4rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(43, 33, 64, 0.12);
}
.lt-path-stat { display: flex; flex-direction: column; min-width: 0; }
.lt-path-stat span { font-size: 0.74rem; color: #8a80a0; }
.lt-path-stat b {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--lt-ink);
  font-variant-numeric: tabular-nums;
}
.lt-path-stat.is-pos b { color: var(--lt-leaf); }
.lt-path-stat.is-warn b { color: var(--lt-marigold); }
.lt-path-stat.is-neg b { color: var(--lt-chili); }
.lt-path-total {
  border-radius: 16px;
  padding: 0.7rem 0.85rem;
  background: var(--lt-ink);
  color: #fff;
}
.lt-path-total-label { font-weight: 800; letter-spacing: 0.02em; }
.lt-path-total .lt-path-stats { border-top-color: rgba(255, 255, 255, 0.18); }
.lt-path-total .lt-path-stat span { color: rgba(255, 255, 255, 0.62); }
.lt-path-total .lt-path-stat b { color: #fff; }
.lt-path-total .lt-path-stat.is-pos b { color: var(--lt-pos-dark); }
.lt-path-total .lt-path-stat.is-warn b { color: #ffd28a; }
.lt-path-total .lt-path-stat.is-neg b { color: var(--lt-neg-dark); } /* เฉดเดียวกับแถบพื้นเข้มอื่น */
/* ตารางสายงานเดิมเป็นแหล่งข้อมูล — ซ่อนไว้ */
.lt-path-table { display: none !important; }

/* หัวกลุ่มในตัวเลือกหวยของหน้า /lottery/bill — h5.header-lottery-category ของ partial
   ถูกย้ายมาเป็น "ชื่อกลุ่ม" ในหัวกลุ่ม จึงต้องล้างสไตล์ชิปออก ให้เหมือนหน้า /lottery/round */
.lt-lot-group-head .header-lottery-category {
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--lt-ink) !important;
  font-size: 0.98rem !important;
  font-weight: 700;
}
.lt-lot-group-head .header-lottery-category::before { display: none; }
.lt-lot-group.is-all .lt-lot-group-head .header-lottery-category { color: var(--lt-ink) !important; }
/* ชิปหวย (label ของ checkbox) — ให้หน้าตาตรงกับชิปปุ่มในหน้า /lottery/round เป๊ะ ๆ */
.lt-lot-list .form-check { margin: 0; }
.lt-admin .lt-round-lots .form-check-label-lottery-category {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 !important;
  padding: 0.35rem 0.75rem !important;
  border-radius: 999px !important;
  border: 1.5px solid var(--lt-line) !important;
  background: #fff !important;
  color: #7a7090 !important;
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: none !important;
  cursor: pointer;
}
.lt-admin .lt-round-lots .form-check-label-lottery-category img {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 3px;
  margin: 0 !important;
}
.lt-admin .lt-round-lots .form-check-label-lottery-category:hover { border-color: rgba(240, 62, 82, 0.45) !important; }
.lt-admin .lt-round-lots .form-check-lottery-category:checked + .form-check-label-lottery-category {
  border-color: rgba(14, 159, 110, 0.55) !important;
  background: rgba(14, 159, 110, 0.08) !important;
  color: var(--lt-ink) !important;
  font-weight: 600;
}
.lt-admin .lt-round-lots .lt-lot-tick-i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 0.6rem;
  background: #eeeaf4;
  color: transparent;
  flex: none;
}
.lt-admin .lt-round-lots .form-check-lottery-category:checked + .form-check-label-lottery-category .lt-lot-tick-i {
  background: var(--lt-leaf);
  color: #fff;
}

/* แถวรายการเลขในโมดัลรายละเอียดบิล: กระจายตัวเลขให้เต็มความกว้าง (คอลัมน์ตรงกันทุกแถว)
   ของเดิมเป็น flex ชิดซ้าย พอโมดัลกว้างจะเหลือที่ว่างกลางแถวเยอะ */
.lt-detail-modal .lt-bd-row { gap: 0.9rem; }
.lt-detail-modal .lt-bd-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 0.3rem 0.6rem;
  align-items: center;
}
.lt-detail-modal .lt-bd-net { min-width: 6.5rem; }
@media (max-width: 767.98px) {
  .lt-detail-modal .lt-bd-stats { grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); }
  .lt-detail-modal .lt-bd-net { min-width: 0; }
}




/* ═══════════════════════════════════════════════════════════════
   หน้าตั้งรับหวย company (/lottery/keepHoldShares)
   checkbox/ปุ่มทั้งหมดเป็น element เดิมของ keepHoldShares.js ที่ถูก "ย้าย" มา
   ═══════════════════════════════════════════════════════════════ */
.lt-keep-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.lt-keep-all-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.35rem 0.8rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 999px;
  background: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--lt-ink);
  cursor: pointer;
}
.lt-keep-all-label:hover { border-color: var(--lt-ink); }
.lt-keep-bar .form-check-input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  border-radius: 6px !important;
  cursor: pointer;
}
.lt-keep-actions #updateAllUser {
  margin: 0 !important;
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 1.2rem;
  background: var(--lt-chrome) !important;
  color: #fff !important;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(240, 62, 82, 0.22);
}
.lt-keep-actions #updateAllUser i { color: #fff !important; }

/* กลุ่มปุ่ม "อัตราจ่ายอื่น: ปิดทั้งหมด / เปิดทั้งหมด" บนแถบเครื่องมือหน้าอัตราจ่าย (segmented ในแคปซูลเดียว) */
.lt-keep-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.lt-prc-others {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.3rem 0.25rem 0.8rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--lt-shadow);
}
.lt-prc-others-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-inline-end: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--lt-ink-soft);
  white-space: nowrap;
}
.lt-prc-others-label i { font-size: 0.72rem; }
.lt-prc-others-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  border-radius: 999px;
  padding: 0.34rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.lt-prc-others-btn i { font-size: 0.8rem; }
.lt-prc-others-btn.is-off { color: var(--lt-chili); background: rgba(240, 62, 82, 0.09); }
.lt-prc-others-btn.is-off:hover { color: #fff; background: var(--lt-chili); }
.lt-prc-others-btn.is-on { color: var(--lt-leaf); background: rgba(14, 159, 110, 0.1); }
.lt-prc-others-btn.is-on:hover { color: #fff; background: var(--lt-leaf); }
.lt-prc-others-btn:active { transform: translateY(1px); }
@media (max-width: 575.98px) {
  .lt-keep-actions { width: 100%; }
  .lt-prc-others { flex: 1 1 auto; justify-content: center; }
}

/* ── รายการหวย: โหมดตาราง ─────────────────────────────────────── */
.lt-keep-check .form-check-input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  border-radius: 6px !important;
  cursor: pointer;
}
.lt-keep-row .lt-bp-title { font-size: 1rem; }
.lt-keep-row .lt-bd-stat b { font-variant-numeric: tabular-nums; }
.lt-keep-row .btn-update,
.lt-keep-card .btn-update {
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 1rem;
  background: var(--lt-leaf) !important;
  color: #fff !important;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: none !important;
}
.lt-keep-row .btn-update:hover,
.lt-keep-card .btn-update:hover { filter: brightness(0.94); }
.lt-keep-row .btn-update i,
.lt-keep-card .btn-update i { color: #fff !important; }

@media (min-width: 992px) {
  /* เลือก | หวย | 6 ตัวเลข | จัดการ */
  .lt-bp-table.lt-keep-table {
    grid-template-columns: 2.2rem minmax(180px, 1.6fr) repeat(6, minmax(84px, 0.8fr)) max-content;
  }
  .lt-keep-table .lt-bp-head span:nth-child(n + 3) { text-align: end; }
  .lt-keep-table .lt-bp-head span:last-child { text-align: center; }
  @supports not (grid-template-columns: subgrid) {
    .lt-keep-table .lt-bp-head,
    .lt-keep-table .lt-bp-row {
      grid-template-columns: 2.2rem minmax(180px, 1.6fr) repeat(6, minmax(84px, 0.8fr)) max-content;
    }
  }
}
@media (max-width: 991.98px) {
  .lt-keep-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "check main action"
      "stats stats stats";
  }
  .lt-keep-row .lt-keep-check { grid-area: check; padding-top: 0.35rem; }
  .lt-keep-row .lt-bp-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    padding-top: 0.4rem;
  }
  .lt-keep-row .lt-bp-stats .lt-bd-stat { text-align: center; }
}

/* ── รายการหวย: โหมดการ์ด ─────────────────────────────────────── */
.lt-keep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.6rem;
}
.lt-keep-card {
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  background: #fff;
  padding: 0.8rem 0.9rem;
}
.lt-keep-card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.lt-keep-card-name {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--lt-ink);
}
.lt-keep-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  background: #fbfafd;
  border: 1px solid var(--lt-line);
}
.lt-keep-card-grid .lt-bd-stat { text-align: center; }
.lt-keep-card-foot { margin-top: 0.6rem; }
.lt-keep-card-foot .btn-update { width: 100%; }

/* ── โมดัลตั้งค่ารับหวย ───────────────────────────────────────── */
.lt-keep-source { display: none !important; }
#ltKeepForm { display: flex; flex-direction: column; gap: 0.6rem; }
.lt-keep-all {
  border: 1.5px dashed rgba(240, 62, 82, 0.35);
  border-radius: 16px;
  background: #fff8f4;
  padding: 0.8rem 0.9rem;
}
.lt-keep-all-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--lt-ink);
}
.lt-keep-all-head i { color: var(--lt-chili); }
.lt-keep-all-head em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 500;
  color: #8a80a0;
}
.lt-keep-form-card {
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  background: #fff;
  padding: 0.8rem 0.9rem;
}
.lt-keep-form-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.lt-keep-form-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--lt-ink);
}
.lt-keep-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
}
.lt-keep-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  background: #fbfafd;
  border: 1.5px solid var(--lt-line);
}
.lt-keep-field:focus-within { border-color: var(--lt-chili); background: #fff; }
.lt-keep-field-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #7a7090;
}
.lt-keep-field input {
  width: 100%;
  border: 0 !important;
  border-bottom: 1.5px solid var(--lt-line) !important;
  border-radius: 0;
  padding: 0.15rem 0 !important;
  height: auto !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--lt-ink) !important;
  font-size: 1.02rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.lt-keep-field input:focus { border-bottom-color: var(--lt-chili) !important; }
.lt-keep-field-min { font-size: 0.72rem; color: #a79fba; }


/* ═══════════════════════════════════════════════════════════════
   หน้าอั้นเลข company (/lottery/round/number/limit)
   ═══════════════════════════════════════════════════════════════ */
/* บล็อกเลขอั้น / ครึ่งราคา ในแต่ละแถว */
.lt-lim-block { min-width: 0; }
.lt-lim-block-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #8a80a0;
  margin-bottom: 0.25rem;
}
.lt-lim-block-title i { font-size: 0.72rem; }
.lt-lim-block .lt-lim-block-title i { color: var(--lt-chili); }
.lt-lim-block:nth-of-type(3) .lt-lim-block-title i { color: var(--lt-marigold); }
.lt-lim-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.4rem;
  margin-bottom: 0.25rem;
}
.lt-lim-type {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--lt-ink);
  min-width: 4.8rem;
}
.lt-lim-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  cursor: pointer;
}
.lt-lim-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  padding: 0.14rem 0.45rem;
  border-radius: 7px;
  font-style: normal;
  font-size: 0.88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.lt-lim-chip.is-close { background: rgba(240, 62, 82, 0.12); color: var(--lt-chili); }
.lt-lim-chip.is-half { background: rgba(255, 176, 32, 0.16); color: #b45309; }
.lt-lim-nums:hover .lt-lim-chip.is-close { background: rgba(240, 62, 82, 0.2); }
.lt-lim-nums:hover .lt-lim-chip.is-half { background: rgba(255, 176, 32, 0.28); }
.lt-lim-none { font-size: 0.86rem; color: #8a80a0; }
/* ชิป "+N" ท้ายรายการเลขอั้น/ครึ่งราคา (เลขเกิน MAX_CHIPS ยุบไว้ กดเพื่อเปิดโมดัลเลขทั้งหมด) */
.lt-lim-chip.lt-lim-more {
  background: transparent;
  border: 1px dashed currentColor;
  font-weight: 600;
  letter-spacing: 0;
}
.lt-lim-nums:hover .lt-lim-chip.lt-lim-more.is-close { background: rgba(240, 62, 82, 0.08); }
.lt-lim-nums:hover .lt-lim-chip.lt-lim-more.is-half { background: rgba(255, 176, 32, 0.12); }

@media (min-width: 992px) {
  /* หวย/งวด | เลขอั้น | ครึ่งราคา | จัดการ */
  .lt-bp-table.lt-lim-table {
    grid-template-columns: minmax(220px, 1.1fr) minmax(220px, 1.4fr) minmax(200px, 1.2fr) max-content;
  }
  .lt-lim-table .lt-bp-row { align-items: start; padding-block: 0.75rem; }
  .lt-lim-table .lt-bp-main { padding-top: 0.15rem; }
  /* หัวคอลัมน์ชิดซ้ายให้ตรงกับเนื้อหา (ค่า default ของแถบหัวคือชิดขวาในบางหน้า) */
  .lt-lim-table .lt-bp-head span { text-align: start; }
  .lt-lim-table .lt-bp-head span:last-child { text-align: center; }
  /* หัวบล็อกในแถวซ้ำกับหัวคอลัมน์ — โชว์เฉพาะจอแคบ */
  .lt-lim-table .lt-lim-block-title { display: none; }
  @supports not (grid-template-columns: subgrid) {
    .lt-lim-table .lt-bp-head,
    .lt-lim-table .lt-bp-row {
      grid-template-columns: minmax(220px, 1.1fr) minmax(220px, 1.4fr) minmax(200px, 1.2fr) max-content;
    }
  }
}
@media (max-width: 991.98px) {
  .lt-lim-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main action"
      "close close"
      "half half";
  }
  .lt-lim-row .lt-bp-main { grid-area: main; }
  .lt-lim-row .lt-bp-actions { grid-area: action; }
  .lt-lim-row .lt-lim-block:nth-of-type(2) { grid-area: close; }
  .lt-lim-row .lt-lim-block:nth-of-type(3) { grid-area: half; }
}

/* โหมดการ์ด */
.lt-lim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.6rem;
  align-items: start;
}
.lt-lim-card {
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  background: #fff;
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow: visible;
}
.lt-lim-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ── โมดัลของหน้านี้ ─────────────────────────────────────────── */
#ltLimitEditList,
#ltLimitAllList,
#ltLimitLogList { display: flex; flex-direction: column; gap: 0.4rem; }
.lt-lim-edit-row,
.lt-lim-all-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  background: #fff;
  padding: 0.55rem 0.75rem;
}
.lt-lim-edit-info {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 8rem;
  flex: 1;
}
.lt-lim-edit-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--lt-ink);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
.lt-lim-edit-type { font-size: 0.8rem; color: #8a80a0; }
/* ช่องค้นหาในโมดัลหน้านี้ต้องอยู่เหนือรายการ (กฎกลางตั้ง order: 1 ไว้สำหรับโมดัลรายละเอียดบิล) */
.lt-detail-modal .lt-lim-search { order: 0; }
.lt-lim-edit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #7a7090;
  white-space: nowrap;
}
.lt-lim-edit-toggle > span { flex: none; }
/* .switch ของเทมเพลตมีความกว้าง 0 แล้ววาด .switch-toggle-slider แบบ absolute (left: -20px)
   ทำให้สวิตช์ไปทับป้ายข้าง ๆ — ต้องล็อกกล่องให้เท่าตัวสไลเดอร์ แล้วรีเซ็ตตำแหน่ง */
.lt-lim-edit-toggle .switch {
  position: relative;
  display: inline-block;
  margin: 0 !important;
  padding: 0 !important;
  flex: none;
  width: 40px !important;
  min-width: 40px !important;
  height: 24px;
}
.lt-lim-edit-toggle .switch .switch-toggle-slider {
  position: absolute !important;
  inset: 0 auto auto 0 !important;
  transform: none !important;
  width: 40px;
  height: 24px;
}
.lt-lim-edit-toggle .switch .switch-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.lt-lim-edit-toggle .switch .switch-label { display: none !important; }

.lt-lim-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.lt-lim-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: #f3f0f8;
  font-size: 0.76rem;
  font-weight: 700;
  color: #8a80a0;
}
.lt-lim-tag.is-close { background: rgba(240, 62, 82, 0.12); color: var(--lt-chili); }
.lt-lim-tag.is-half { background: rgba(255, 176, 32, 0.18); color: #b45309; }

.lt-lim-dates { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; margin-inline-start: auto; }
.lt-lim-date { display: flex; flex-direction: column; }
.lt-lim-date-label { font-size: 0.72rem; color: #a79fba; }
.lt-lim-date .btn-log,
.lt-lim-date > span:last-child {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--lt-ink);
  font-variant-numeric: tabular-nums;
}
.lt-lim-date .btn-log { cursor: pointer; }

.lt-lim-log-row {
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  background: #fff;
  padding: 0.55rem 0.75rem;
}
.lt-lim-log-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: #f3f0f8;
  color: #7a7090;
  font-size: 0.8rem;
  font-weight: 800;
}
.lt-lim-log-main { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; min-width: 0; }
.lt-lim-log-time {
  font-size: 0.82rem;
  color: #8a80a0;
  text-align: end;
  font-variant-numeric: tabular-nums;
}

/* ── โมดัลตั้งค่าอั้นเลขอัตโนมัติ (#autoResultSettingModal) ──
   เดิมเป็นตาราง DataTable 2 คอลัมน์ (หัวดำ + ช่องค้นหาของ DataTable)
   8 ก.ย. 2026 เปลี่ยนเป็น สวิตช์หลัก + แถบค้นหา + การ์ดหวย 2 คอลัมน์ */
/* .switch ของเทมเพลตกว้าง 0 แล้ววาด slider แบบ absolute — ทุกสวิตช์ในโมดัลนี้ต้องล็อกกล่องเท่าตัวสไลเดอร์ */
.lt-auto .switch {
  position: relative;
  display: inline-block;
  flex: none;
  margin: 0 !important;
  padding: 0 !important;
  width: 40px !important;
  min-width: 40px !important;
  height: 24px;
}
.lt-auto .switch .switch-toggle-slider {
  position: absolute !important;
  inset: 0 auto auto 0 !important;
  transform: none !important;
  width: 40px;
  height: 24px;
}
.lt-auto .switch .switch-input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

/* แถบสวิตช์หลัก */
.lt-auto-hero {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  border: 1.5px solid rgba(240, 62, 82, 0.18);
  border-radius: 16px;
  background: linear-gradient(120deg, rgba(240, 62, 82, 0.08), rgba(255, 176, 32, 0.12));
  padding: 0.8rem 1rem;
  cursor: pointer;
}
.lt-auto-hero-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--lt-chrome);
  color: #fff;
  font-size: 1rem;
}
.lt-auto-hero-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.lt-auto-hero-title { font-size: 0.98rem; font-weight: 700; color: var(--lt-ink); }
.lt-auto-hero-sub { font-size: 0.78rem; color: var(--lt-ink-soft); }
.lt-auto-state {
  flex: none;
  border-radius: 999px;
  background: #fff;
  padding: 0.15rem 0.65rem;
  color: var(--lt-ink-soft);
  font-size: 0.76rem;
  font-weight: 700;
}
.lt-auto-hero:has(#settingAutoResult:checked) .lt-auto-state {
  background: rgba(14, 159, 110, 0.14);
  color: var(--lt-leaf);
}

/* แถบเครื่องมือ: ค้นหา + ตัวนับ + เลือกทั้งหมด */
.lt-auto-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
/* .lt-detail-modal .lt-modal-search ตั้ง order:1 ไว้ (โมดัลรายละเอียดบิล) ในแถบนี้ต้องรีเซ็ต */
.lt-auto-bar .lt-modal-search { order: 0; flex: 1 1 220px; margin: 0; }
.lt-auto-tools { display: flex; align-items: center; gap: 0.8rem; margin-inline-start: auto; }
.lt-auto-count { font-size: 0.82rem; font-weight: 600; color: var(--lt-ink-soft); white-space: nowrap; }
.lt-auto-count b { color: var(--lt-ink); font-size: 0.95rem; }
.lt-auto-all {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--lt-ink);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

/* รายการหวย */
.lt-auto-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
/* ปิดสวิตช์หลัก = ยังเลือกหวยได้ แต่หรี่ไว้ให้เห็นว่ายังไม่มีผล */
.lt-auto-grid.is-off { opacity: 0.5; }
.lt-auto-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  background: #fff;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.lt-auto-item:hover { border-color: rgba(240, 62, 82, 0.35); }
.lt-auto-item:has(.switch-input:checked) { border-color: var(--lt-chili); background: rgba(240, 62, 82, 0.05); }
.lt-auto-flag { flex: none; width: 34px; height: 24px; border-radius: 5px; object-fit: contain; }
.lt-auto-name {
  flex: 1;
  min-width: 0;
  color: var(--lt-ink);
  font-size: 0.88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lt-auto .lt-empty { padding: 2rem 1rem; }

@media (max-width: 575.98px) {
  .lt-auto-grid { grid-template-columns: 1fr; }
  .lt-auto-tools { width: 100%; justify-content: space-between; margin-inline-start: 0; }
  /* ซ่อนป้ายสถานะ ไม่ใช่คำอธิบาย — ตัวสวิตช์บอกสถานะอยู่แล้ว และหัวข้อจะได้ไม่ตกบรรทัด */
  .lt-auto-state { display: none; }
}


/* ═══════════════════════════════════════════════════════════════
   เมนู "จัดการ / รายงาน" ในแต่ละแถวของทุกหน้า theme2
   ผูกกับ .lt-list-body (card-body ของการ์ดรายการ) — หน้าใหม่ที่ใช้โครงเดียวกัน
   จะได้หน้าตานี้อัตโนมัติ ไม่ต้องเขียน CSS เพิ่ม
   ═══════════════════════════════════════════════════════════════ */
.lt-list-body .dropdown-menu {
  min-width: 250px;
  padding: 0.4rem;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(43, 33, 64, 0.18);
  z-index: 1056;
}
.lt-list-body .dropdown-item {
  display: grid !important;
  grid-template-columns: 36px 1fr;
  grid-template-areas:
    "ico title"
    "ico sub";
  align-items: center;
  column-gap: 0.65rem;
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  font-weight: 600;
  color: var(--lt-ink);
  white-space: normal;
}
.lt-list-body .dropdown-item + .dropdown-item { margin-top: 0.15rem; }
.lt-list-body .dropdown-item:hover,
.lt-list-body .dropdown-item:focus { background: #f7f5fb; color: var(--lt-ink); }
/* ไอคอน: คลาส icon-14px/icon-base ของเทมเพลตล็อกขนาดด้วย !important ต้องทับให้หมด */
.lt-list-body .dropdown-item > i,
.lt-list-body .dropdown-item > span.fa,
.lt-list-body .dropdown-item > span[class*="fa-"] {
  grid-area: ico;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  border-radius: 12px;
  display: grid !important;
  place-items: center;
  margin: 0 !important;
  font-size: 1rem !important;
  line-height: 1 !important;
  color: #fff !important;
  background: var(--lt-ink);
}
/* คำอธิบายใต้ชื่อเมนู (markup มาจากสคริปต์ จึงใส่ผ่าน ::after) */
.lt-list-body .dropdown-item::after {
  grid-area: sub;
  font-size: 0.75rem;
  font-weight: 400;
  color: #8a80a0;
  line-height: 1.25;
}
.lt-list-body .dropdown-divider { margin: 0.3rem 0.2rem; opacity: 0.5; }
/* ปุ่มเปิดเมนู "จัดการ" คงสไตล์เดิมของเทมเพลตไว้ (ผู้ใช้ชอบแบบเดิม) — ห้าม override */

/* สีไอคอนเมนูแบบทั่วไป — ใช้คลาส text-* ที่เทมเพลตใส่มาให้อยู่แล้ว
   (วางไว้ก่อนบล็อกด้านล่าง เพื่อให้กฎเฉพาะเมนูเขียนทับได้) */
.lt-list-body .dropdown-item > i.text-warning { background: linear-gradient(135deg, #ffc857, var(--lt-marigold)); }
.lt-list-body .dropdown-item > i.text-danger { background: linear-gradient(135deg, var(--lt-neg-dark), var(--lt-chili)); }
.lt-list-body .dropdown-item > i.text-info { background: linear-gradient(135deg, #2ba7c9, #38b6d9); }
.lt-list-body .dropdown-item > i.text-success { background: linear-gradient(135deg, #12b981, #0e9f6e); }
.lt-list-body .dropdown-item > i.text-primary { background: linear-gradient(135deg, #8b7ae8, #6d5bd0); }
.lt-list-body .dropdown-item > i.text-secondary { background: linear-gradient(135deg, #a79fbb, #8a80a0); }

/* สี + คำอธิบายต่อเมนู (เพิ่มหน้าใหม่ให้เติมที่นี่)
   ต้องผูกกับ .dropdown-item เสมอ — คลาสพวกนี้ถูกใช้กับ element อื่นในหน้าด้วย
   (เช่น .btn-report-user ที่ชื่อหวยในการ์ดของ /report/summary) ถ้าไม่จำกัดขอบเขต
   ข้อความ ::after จะไปโผล่ผิดที่ */
.lt-list-body .dropdown-item.btn-report-user > i { background: linear-gradient(135deg, #12b981, #0e9f6e); }
.lt-list-body .dropdown-item.btn-report-user::after { content: "แยกตามสมาชิกในสายงาน"; }
.lt-list-body .dropdown-item.btn-report-lottery-type > i { background: linear-gradient(135deg, #2ba7c9, #38b6d9); }
.lt-list-body .dropdown-item.btn-report-lottery-type::after { content: "แยกตามประเภทการแทง"; }
.lt-list-body .dropdown-item.btn-report-lottery-number > i { background: linear-gradient(135deg, #d97706, var(--lt-marigold)); }
.lt-list-body .dropdown-item.btn-report-lottery-number::after { content: "ยอดรายเลข"; }
.lt-list-body .dropdown-item.btn-detail > i { background: linear-gradient(135deg, #12b981, #0e9f6e); }
.lt-list-body .dropdown-item.btn-detail::after { content: "รายการเลข · หลักฐาน · สายงาน"; }
.lt-list-body .dropdown-item.btn-cancel > i { background: linear-gradient(135deg, var(--lt-neg-dark), var(--lt-chili)); }
.lt-list-body .dropdown-item.btn-cancel::after { content: "ยกเลิกบิลนี้"; }
.lt-list-body .dropdown-item.btn-add-number-limit > i { background: linear-gradient(135deg, #8b7ae8, #6d5bd0); }
.lt-list-body .dropdown-item.btn-add-number-limit::after { content: "เพิ่มเลขอั้น / เลขครึ่งราคา"; }
.lt-list-body .dropdown-item.btn-edit-number-limit > i { background: linear-gradient(135deg, #ffc857, var(--lt-marigold)); }
.lt-list-body .dropdown-item.btn-edit-number-limit::after { content: "เปิด/ปิดเลขที่อั้นไว้แล้ว"; }
.lt-list-body .dropdown-item.lt-mi-edit::after { content: "แก้ไขข้อมูล / ตั้งค่าสมาชิก"; }
.lt-list-body .dropdown-item.btn-reset-password::after { content: "ตั้งรหัสผ่านใหม่ / รีเซ็ต PIN"; }
.lt-list-body .dropdown-item.btn-user-detail::after { content: "ส่วนแบ่งหุ้น / อัตราจ่าย / แทงสูงสุด"; }


/* ── โมดัล "เพิ่มเลขอั้น" (#modalAddLimitNumber) ────────────────────
   จัดใหม่เป็น 3 ขั้น: เลือกประเภท → ใส่เลข/ตำแหน่ง → รายการที่จะบันทึก
   คลาส/id ที่สคริปต์ใช้ (tab-menu, sub-menu, lottery-number, switch-input,
   btn-add-number, btn-remove, total-number, bet-lottery-number-grid,
   #listNumber, #btnUpdate, #pasteNumber) ห้ามเปลี่ยน */
.lt-add { display: flex; flex-direction: column; gap: 0.7rem; }
.lt-add-step {
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  background: #fff;
  padding: 0.75rem 0.85rem;
}
.lt-add-step-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--lt-ink);
}
.lt-add-step-no {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--lt-chrome);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

/* แท็บประเภทเลข */
.lt-add-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  border: 0;
  margin: 0;
  padding: 0;
}
.lt-add-tabs .nav-link {
  border: 1.5px solid var(--lt-line) !important;
  border-radius: 999px !important;
  padding: 0.4rem 1rem !important;
  background: #fff !important;
  color: #7a7090 !important;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: none !important;
}
.lt-add-tabs .nav-link:hover { border-color: var(--lt-ink) !important; color: var(--lt-ink) !important; }
.lt-add-tabs .nav-link.active {
  background: var(--lt-ink) !important;
  border-color: var(--lt-ink) !important;
  color: #fff !important;
}

/* ปุ่มช่วย (กลับเลข / เลขเบิ้ล / รูดหน้า …) */
.lt-add-helpers { margin-bottom: 0.5rem; }
.lt-add-help-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.lt-add-help {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1.5px solid rgba(43, 167, 201, 0.4);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  background: rgba(43, 167, 201, 0.08);
  color: #14748f;
  font-size: 0.85rem;
  font-weight: 700;
}
.lt-add-help:hover { background: rgba(43, 167, 201, 0.16); color: #14748f; }
.lt-add-help.active { background: #2ba7c9; border-color: #2ba7c9; color: #fff; }

/* ช่องใส่เลข */
.lt-add-field { margin-bottom: 0.6rem; }
.lt-add-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #8a80a0;
  margin-bottom: 0.25rem;
}
.lt-add-input,
.lt-add-textarea {
  width: 100%;
  border: 1.5px solid var(--lt-line) !important;
  border-radius: 12px;
  padding: 0.55rem 0.85rem !important;
  height: auto !important;
  background: #fbfafd !important;
  color: var(--lt-ink) !important;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  box-shadow: none !important;
}
.lt-add-textarea { font-size: 0.95rem; letter-spacing: 0; }
.lt-add-input:focus,
.lt-add-textarea:focus { border-color: var(--lt-chili) !important; background: #fff !important; }

/* สวิตช์ตำแหน่งที่จะอั้น */
.lt-add-switches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.4rem;
}
.lt-add-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
  padding: 0.5rem 0.7rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 12px;
  background: #fbfafd;
  cursor: pointer;
}
.lt-add-toggle:has(.switch-input:checked) {
  border-color: rgba(14, 159, 110, 0.5);
  background: rgba(14, 159, 110, 0.08);
}
.lt-add-toggle-text { font-size: 0.86rem; font-weight: 700; color: var(--lt-ink); }
/* .switch ของเทมเพลตกว้าง 0 แล้ววาดสไลเดอร์แบบ absolute — ล็อกกล่องให้พอดี */
.lt-add-toggle .switch {
  position: relative;
  display: inline-block;
  flex: none;
  margin: 0 !important;
  padding: 0 !important;
  width: 46px !important;
  min-width: 46px !important;
  height: 28px;
}
.lt-add-toggle .switch .switch-toggle-slider {
  position: absolute !important;
  inset: 0 auto auto 0 !important;
  transform: none !important;
  width: 46px;
  height: 28px;
}
.lt-add-toggle .switch .switch-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.lt-add-toggle .switch .switch-label { display: none !important; }

/* ปุ่มเพิ่มเข้ารายการ */
.lt-add-submit {
  width: 100%;
  margin-top: 0.7rem;
  border: 0;
  border-radius: 12px;
  padding: 0.6rem;
  background: var(--lt-ink);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
}
.lt-add-submit:hover { background: #3b2f57; color: #fff; }

/* เลขที่พิมพ์ไว้ (staging) */
.lt-add-stage {
  border: 1.5px dashed rgba(43, 33, 64, 0.18);
  border-radius: 16px;
  background: #fbfafd;
  padding: 0.7rem 0.85rem;
}
.lt-add-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.lt-add-stage-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #7a7090;
}
.lt-add-stage-title i { color: var(--lt-chili); }
.lt-add-stage-title b { color: var(--lt-ink); font-size: 1rem; }
.lt-add-clear {
  border: 0;
  border-radius: 10px;
  width: 32px;
  height: 32px;
  background: rgba(240, 62, 82, 0.1);
  color: var(--lt-chili);
}
.lt-add-clear:hover { background: rgba(240, 62, 82, 0.2); color: var(--lt-chili); }
.bet-lottery-number-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-height: 2.2rem;
  align-items: center;
}
.bet-lottery-number-grid:empty::after {
  content: "ยังไม่ได้พิมพ์เลข";
  font-size: 0.84rem;
  color: #b3abc4;
}
/* ชิปเลขที่สคริปต์สร้างในกล่อง staging / รายการที่จะบันทึก */
.bet-lottery-number-grid .btn,
.lt-add-list .btn {
  border-radius: 10px !important;
  padding: 0.2rem 0.6rem !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums;
}
.lt-add-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-height: 2.6rem;
  align-items: center;
  border-radius: 12px;
  background: #fbfafd;
  border: 1px solid var(--lt-line);
  padding: 0.6rem;
}
.lt-add-list > .text-center { width: 100%; color: #b3abc4; font-size: 0.88rem; }

@media (max-width: 575.98px) {
  .lt-add-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.2rem; }
  .lt-add-tabs .nav-link { white-space: nowrap; }
  .lt-add-switches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* ═══════════════════════════════════════════════════════════════
   หน้าตั้งค่ารอบหวย company (/lottery/round/setting)
   ═══════════════════════════════════════════════════════════════ */
.lt-rs-close {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.lt-rs-close-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  color: #8a80a0;
}
.lt-rs-close-label i { color: var(--lt-chili); }
.lt-rs-close b {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--lt-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.lt-rs-close-date { font-size: 0.78rem; color: #8a80a0; }
.lt-rs-close-date:empty { display: none; }

@media (min-width: 992px) {
  /* หวย/งวด | เวลาปิดรับ | สถานะ | จัดการ */
  .lt-bp-table.lt-rs-table {
    grid-template-columns: minmax(240px, 2fr) minmax(140px, 1fr) minmax(120px, max-content) max-content;
  }
  .lt-rs-table .lt-bp-head span { text-align: start; }
  .lt-rs-table .lt-bp-head span:nth-child(3),
  .lt-rs-table .lt-bp-head span:last-child { text-align: center; }
  .lt-rs-table .lt-bp-status { justify-content: center; }
  @supports not (grid-template-columns: subgrid) {
    .lt-rs-table .lt-bp-head,
    .lt-rs-table .lt-bp-row {
      grid-template-columns: minmax(240px, 2fr) minmax(140px, 1fr) minmax(120px, max-content) max-content;
    }
  }
}
@media (max-width: 991.98px) {
  .lt-rs-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main status"
      "close action";
  }
  .lt-rs-row .lt-bp-main { grid-area: main; }
  .lt-rs-row .lt-bp-status { grid-area: status; justify-content: flex-end; }
  .lt-rs-row .lt-rs-close { grid-area: close; flex-direction: row; align-items: baseline; gap: 0.35rem; }
  .lt-rs-row .lt-bp-actions { grid-area: action; justify-self: end; }
}

/* โหมดการ์ด */
.lt-rs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.6rem;
  align-items: start;
}
.lt-rs-card {
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  background: #fff;
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow: visible;
}
.lt-rs-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.lt-rs-card .lt-rs-close {
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  background: #fbfafd;
  border: 1px solid var(--lt-line);
}
.lt-rs-card-foot .dropdown { width: 100%; }
.lt-rs-card-foot .dropdown-toggle { width: 100%; }


/* ── โมดัลแก้ไขรอบหวย (/lottery/round/setting) ───────────────────── */
.lt-re-modal .modal-dialog { max-width: min(760px, 94vw); }
.lt-re-modal .lt-bp-flag { width: 42px; height: 42px; }
.lt-re-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}
.lt-re-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  background: #fbfafd;
  cursor: pointer;
}
.lt-re-field-wide { grid-column: 1 / -1; }
.lt-re-field:focus-within { border-color: var(--lt-chili); background: #fff; }
.lt-re-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #7a7090;
}
.lt-re-label i { color: var(--lt-chili); font-size: 0.8rem; }
.lt-re-input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--lt-ink);
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.lt-re-input:focus { outline: none; }
.lt-re-hint { font-size: 0.74rem; color: #a79fba; }

.lt-re-duration {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  background: rgba(43, 167, 201, 0.1);
  color: #14748f;
  font-size: 0.86rem;
  font-weight: 600;
}
.lt-re-duration:empty { display: none; }
.lt-re-duration.is-bad { background: rgba(240, 62, 82, 0.1); color: var(--lt-chili); }

.lt-re-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.7rem;
  padding: 0.7rem 0.8rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  background: #fff;
}
.lt-re-seg {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: #f3f0f8;
}
.lt-re-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  background: transparent;
  color: #7a7090;
  font-size: 0.88rem;
  font-weight: 700;
}
.lt-re-seg-btn.active { background: #fff; color: var(--lt-ink); box-shadow: 0 2px 8px rgba(43, 33, 64, 0.12); }
.lt-re-seg-btn[data-active="true"].active { color: var(--lt-leaf); }
.lt-re-seg-btn[data-active="false"].active { color: var(--lt-chili); }

@media (max-width: 575.98px) {
  .lt-re-grid { grid-template-columns: minmax(0, 1fr); }
  .lt-re-status { flex-direction: column; align-items: stretch; }
  .lt-re-seg { justify-content: center; }
  .lt-re-seg-btn { flex: 1 1 0; justify-content: center; }
}


/* ปฏิทิน flatpickr ถูก append ไว้ที่ <body> และมี z-index แค่ 999
   ถ้าเปิดจากในโมดัล (โมดัลของเทมเพลตอยู่ที่ 1090) ปฏิทินจะไปอยู่ใต้โมดัล — ยกขึ้นให้อยู่เหนือเสมอ
   (flatpickr.css ของหน้าโหลดหลัง theme2.css จึงต้อง !important) */
.flatpickr-calendar { z-index: 1100 !important; }


/* ── รายงานบิล company (/report/bill) ─────────────────────────────
   ใช้ component ร่วมกับ /lottery/bill (.lt-bp-row / .lt-bill-card / .lt-cbill-*) */
.lt-kpi-grid.lt-kpi-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
@media (min-width: 992px) {
  /* หวย/บิล | ผู้ใช้ | 5 ตัวเลข | จัดการ */
  .lt-bp-table.lt-rb-table {
    grid-template-columns: minmax(230px, 1.9fr) minmax(110px, 0.9fr) repeat(5, minmax(88px, 0.8fr)) max-content;
  }
  .lt-rb-table .lt-bp-head span:nth-child(n + 3) { text-align: end; }
  .lt-rb-table .lt-bp-head span:last-child { text-align: center; }
  @supports not (grid-template-columns: subgrid) {
    .lt-rb-table .lt-bp-head,
    .lt-rb-table .lt-bp-row {
      grid-template-columns: minmax(230px, 1.9fr) minmax(110px, 0.9fr) repeat(5, minmax(88px, 0.8fr)) max-content;
    }
  }
}
@media (max-width: 991.98px) {
  .lt-rb-row {
    grid-template-areas:
      "main action"
      "user user"
      "stats stats";
  }
  .lt-rb-row .lt-cbill-user {
    grid-area: user;
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.1rem;
    padding: 0.3rem 0.55rem;
    border-radius: 10px;
    background: #faf8fc;
  }
  .lt-rb-row .lt-cbill-user::before {
    content: "\f007";
    font-family: "Font Awesome 6 Pro", "Font Awesome 6 Free", "FontAwesome";
    font-weight: 900;
    font-size: 0.72rem;
    color: var(--lt-chili);
  }
  .lt-rb-row .lt-bp-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    padding-top: 0.4rem;
  }
  .lt-rb-row .lt-bp-stats .lt-bd-stat { text-align: center; }
}

/* ===== /report/round: รายงานผล แพ้-ชนะ รอบหวย ===== */
.lt-kpi-win::before { background: linear-gradient(180deg, #f36d7f, var(--lt-chili)); }
.lt-kpi-win .lt-kpi-ico { background: linear-gradient(135deg, #f36d7f, var(--lt-chili)); }
.lt-kpi-win .lt-kpi-val { color: var(--lt-chili); }
.lt-kpi-net::before { background: linear-gradient(180deg, #2ba7c9, #14748f); }
.lt-kpi-net .lt-kpi-ico { background: linear-gradient(135deg, #2ba7c9, #14748f); }
.lt-kpi-net .lt-kpi-val { color: #14748f; }
.lt-kpi-net.is-neg::before { background: linear-gradient(180deg, #f36d7f, var(--lt-chili)); }
.lt-kpi-net.is-neg .lt-kpi-ico { background: linear-gradient(135deg, #f36d7f, var(--lt-chili)); }
.lt-kpi-net.is-neg .lt-kpi-val { color: var(--lt-chili); }

/* แถวรายการมี 5 ตัวเลข (ยอดรวม/ยอดเข้า/ส่งออก/ถูกรางวัล/คงเหลือ) จึงกว้างกว่าหน้ารอบหวยปกติ */
.lt-rr-stats .lt-bd-stat.is-win b,
.lt-rr-stats .lt-bd-stat.is-win b * { color: var(--lt-chili) !important; }
.lt-rr-stats .lt-bd-stat.is-net b { font-weight: 800; }
@media (min-width: 992px) {
  .lt-bp-table.lt-rr-table {
    grid-template-columns: minmax(230px, 1.9fr) repeat(5, minmax(92px, 0.8fr)) max-content;
  }
  .lt-rr-table .lt-bp-head span:nth-child(n + 2) { text-align: end; }
  .lt-rr-table .lt-bp-head span:last-child { text-align: center; }
  @supports not (grid-template-columns: subgrid) {
    .lt-rr-table .lt-bp-head,
    .lt-rr-table .lt-bp-row {
      grid-template-columns: minmax(230px, 1.9fr) repeat(5, minmax(92px, 0.8fr)) max-content;
    }
  }
}
@media (max-width: 991.98px) {
  .lt-rr-table .lt-bp-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "main"
      "stats"
      "action";
  }
  .lt-rr-table .lt-bp-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    padding-top: 0.4rem;
  }
  .lt-rr-table .lt-bp-stats .lt-bd-stat { text-align: center; }
  .lt-rr-table .lt-bp-actions { width: 100%; margin-top: 0.5rem; }
  .lt-rr-table .lt-bp-actions .btn { width: 100%; }
}
.lt-cr-card .lt-rr-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1400px) {
  .lt-cr-grid:has(.lt-rr-stats) { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
}

/* โมดัล "ยอดเดิมพันตามหมายเลข" ของหน้ารายงาน: ไฮไลต์เลขที่ออกในงวดนี้ */
.lt-num-row.is-hit { background: rgba(240, 62, 82, 0.07); }
.lt-num-row.is-hit .badge { box-shadow: 0 0 0 2px rgba(240, 62, 82, 0.35); }
.lt-num-row.is-hit .lt-num-amt::after {
  content: "ออก";
  margin-inline-start: 0.35rem;
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
  background: rgba(240, 62, 82, 0.14);
  color: var(--lt-chili);
  font-size: 0.68rem;
  font-weight: 800;
}
.lt-num-pay:empty::after { content: "–"; color: #bdb5cc; }

/* ===== /report/summary: สรุปบัญชี (แพ้-ชนะ สุทธิ / ตามสมาชิก / ตามพาร์ตเนอร์) ===== */
/* หน้านี้กลุ่มหัวตารางมีช่องไม่เท่ากัน (4/4/4 และ 4/5/4) กฎ nth-child ด้านบนจึงใช้ไม่ได้
   renderer ติดคลาส lt-g0/1/2 ให้หัวคอลัมน์ตามกลุ่มจริง แล้วใช้กฎนี้ทับ */
.lt-rpt-table thead tr:nth-child(2) th.lt-g0 {
  background: rgba(240, 62, 82, 0.12) !important;
  color: #c02a3c !important;
}
.lt-rpt-table thead tr:nth-child(2) th.lt-g1 {
  background: rgba(43, 167, 201, 0.14) !important;
  color: #14748f !important;
}
.lt-rpt-table thead tr:nth-child(2) th.lt-g2 {
  background: rgba(109, 91, 208, 0.14) !important;
  color: #5344a8 !important;
}
.lt-rpt-table thead tr:first-child th[colspan].lt-g0 { background: var(--lt-chili) !important; }
.lt-rpt-table thead tr:first-child th[colspan].lt-g1 { background: #2ba7c9 !important; }
.lt-rpt-table thead tr:first-child th[colspan].lt-g2 { background: #6d5bd0 !important; }

/* ชื่อหวย/สมาชิกในการ์ด (ย้ายมาจาก <td> เดิม จึงมีทั้งรูปธงและป้าย role) */
.lt-rpt-who img {
  width: 30px;
  height: 22px;
  object-fit: cover;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(43, 33, 64, 0.25);
}
.lt-rpt-who > .text-info,
.lt-rpt-who .cursor-pointer { cursor: pointer; }
.lt-rpt-card-head .lt-rpt-who.btn-report-user { cursor: pointer; }
.lt-rpt-card-head .lt-rpt-who.btn-report-user:hover { color: var(--lt-chili); }
.lt-rpt-who .small { color: #8a80a0; font-size: 0.78rem; }
.lt-rpt-who .btn-user-detail {
  color: #8a80a0;
  cursor: pointer;
  padding: 0.15rem;
}
.lt-rpt-who .btn-user-detail:hover { color: var(--lt-chili); }

/* ปุ่ม Export */
.lt-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1.5px solid var(--lt-line);
  background: #fff;
  color: var(--lt-ink);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
}
.lt-export-btn:hover { border-color: var(--lt-ink); }

/* ปุ่มกรองสถานะบิล (clone มาจากตารางเดิมของรายการบิลสมาชิก) */
.lt-bill-status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.lt-bill-status-bar .btn { border-radius: 999px !important; font-weight: 700; }

/* โมดัล "ส่วนแบ่งที่ได้รับ" — ตารางถูกสร้างโดย summary.js จัดสไตล์ด้วยคลาสที่ renderer ติดให้ */
.lt-ud-modal .tab-content > .tab-pane { padding: 0; }
.lt-ud-table {
  border-collapse: separate !important;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
  margin-bottom: 1rem;
}
.lt-ud-table thead th {
  background: var(--lt-ink) !important;
  color: #fff !important;
  border: 0 !important;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  padding: 0.5rem 0.6rem !important;
}
.lt-ud-table tbody td {
  border: 0 !important;
  border-bottom: 1.5px dashed rgba(43, 33, 64, 0.12) !important;
  padding: 0.45rem 0.6rem !important;
  font-size: 0.9rem;
}
.lt-ud-table tbody tr:hover td { background: rgba(240, 62, 82, 0.04); }
.lt-ud-table img { border-radius: 5px; box-shadow: 0 1px 3px rgba(43, 33, 64, 0.25); }

/* แถว "ไม่พบข้อมูล" ในโหมดตาราง — สคริปต์แต่ละที่ใส่คลาสไม่เหมือนกัน จึงล็อกสไตล์ไว้ที่เดียว */
.lt-rpt-table tbody td[colspan] {
  text-align: center;
  color: #8a80a0 !important;
  font-weight: 600;
  padding: 1.1rem 0.65rem !important;
  background: #fff;
}

/* ===== /report/round/check: รายงานตรวจรางวัล ===== */
/* คอลัมน์: หวย/งวด | สถานะ | 3 ผลรางวัล | ปิดรับ (ไม่มีคอลัมน์จำนวนบิล/จัดการเหมือนฝั่ง member) */
.lt-rcc-close {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--lt-ink-soft, #8a80a0);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.lt-rcc-table .lt-bp-row { border-radius: 10px; transition: background-color 0.12s ease; }
.lt-rcc-table .lt-bp-row:hover { background: rgba(43, 33, 64, 0.035); }
@media (min-width: 992px) {
  .lt-bp-table.lt-rcc-table {
    grid-template-columns: minmax(240px, 3fr) max-content repeat(3, minmax(84px, 0.5fr)) minmax(120px, max-content);
    column-gap: 1rem;
    padding-inline: 0.5rem;
  }
  .lt-rcc-table .lt-bp-stats .lt-bd-stat { text-align: center; }
  .lt-rcc-table .lt-bp-head span:nth-child(n + 3) { text-align: center; }
  .lt-rcc-table .lt-bp-head span:last-child { text-align: end; }
  .lt-rcc-table .lt-rcc-close { text-align: end; }
  @supports not (grid-template-columns: subgrid) {
    .lt-rcc-table .lt-bp-head,
    .lt-rcc-table .lt-bp-row {
      grid-template-columns: minmax(240px, 3fr) max-content repeat(3, minmax(84px, 0.5fr)) minmax(120px, max-content);
    }
  }
}
@media (max-width: 991.98px) {
  .lt-rcc-table .lt-bp-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.4rem;
  }
  .lt-rcc-table .lt-bp-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    padding-top: 0.4rem;
  }
  .lt-rcc-table .lt-bp-stats .lt-bd-stat { text-align: center; }
  .lt-rcc-close::before { content: "ปิดรับ "; color: #8a80a0; font-weight: 500; }
}

/* ===== /lottery/round/result: ออกผลหวย ===== */
/* รายการรอบ: หวย/งวด | 3 ผลรางวัล | ปุ่มออกผล */
.lt-res-table .lt-bp-row { border-radius: 10px; transition: background-color 0.12s ease; }
.lt-res-table .lt-bp-row:hover { background: rgba(43, 33, 64, 0.035); }
.lt-res-done {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--lt-leaf);
  white-space: nowrap;
}
@media (min-width: 992px) {
  .lt-bp-table.lt-res-table {
    grid-template-columns: minmax(240px, 3fr) repeat(3, minmax(84px, 0.5fr)) max-content;
    column-gap: 1rem;
    padding-inline: 0.5rem;
  }
  .lt-res-table .lt-bp-stats .lt-bd-stat { text-align: center; }
  .lt-res-table .lt-bp-head span:nth-child(n + 2) { text-align: center; }
  .lt-res-table .lt-bp-head span:last-child { text-align: end; }
  @supports not (grid-template-columns: subgrid) {
    .lt-res-table .lt-bp-head,
    .lt-res-table .lt-bp-row {
      grid-template-columns: minmax(240px, 3fr) repeat(3, minmax(84px, 0.5fr)) max-content;
    }
  }
}
@media (max-width: 991.98px) {
  .lt-res-table .lt-bp-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.45rem;
  }
  .lt-res-table .lt-bp-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    padding-top: 0.4rem;
  }
  .lt-res-table .lt-bp-stats .lt-bd-stat { text-align: center; }
  .lt-res-table .lt-bp-actions { width: 100%; }
  .lt-res-table .lt-bp-actions .btn { width: 100%; }
}
.lt-res-foot { justify-content: center; }
.lt-res-foot .btn { width: 100%; border-radius: 999px; }

/* โมดัลออกผล — ช่องกรอกถูกสร้างโดยสคริปต์ จัดสไตล์ผ่านคลาสที่ renderer ติดให้ */
.lt-res-hint {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  background: rgba(43, 167, 201, 0.1);
  border: 1.5px solid rgba(43, 167, 201, 0.28);
  color: #14748f;
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  margin-bottom: 0.9rem;
}
.lt-res-hint i { margin-top: 0.15rem; }
.lt-res-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin: 0 !important;
}
.lt-res-col {
  width: auto !important;
  max-width: none !important;
  flex: none !important;
  padding: 0.75rem 0.85rem !important;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  background: #fff;
}
.lt-res-col.is-locked { background: #f7f5fb; border-style: dashed; }
.lt-res-label {
  display: flex !important;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--lt-ink);
  margin-bottom: 0.45rem !important;
}
.lt-res-ico {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.8rem;
  background: linear-gradient(135deg, #ffc857, var(--lt-marigold));
}
.lt-res-col.is-check .lt-res-ico { background: linear-gradient(135deg, #12b981, #0e9f6e); }
/* ช่องกรอกเลขรางวัล — ตัวใหญ่ อ่านง่าย ระยะตัวอักษรเท่ากัน */
.lt-res-input {
  text-align: center;
  font-size: 1.6rem !important;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  padding: 0.45rem 0.5rem !important;
  border-radius: 12px !important;
  border: 1.5px solid var(--lt-line) !important;
  color: var(--lt-ink) !important;
  font-variant-numeric: tabular-nums;
}
.lt-res-input:focus {
  border-color: var(--lt-chili) !important;
  box-shadow: 0 0 0 3px rgba(240, 62, 82, 0.14) !important;
}
/* ตัวเลขที่พิมพ์ต้องใหญ่ แต่ข้อความบอกใบ้ต้องเล็กและจาง (ไม่งั้นล้นช่อง) */
.lt-res-input::placeholder {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: normal;
  color: #b9b2c9;
}
.lt-res-input[readonly] { background: #f2eff7 !important; color: #8a80a0 !important; }
.lt-res-col[data-len]::after {
  content: attr(data-len) " หลัก";
  display: block;
  margin-top: 0.3rem;
  text-align: center;
  font-size: 0.72rem;
  color: #8a80a0;
}
.lt-res-col.is-check::after { content: none; }
.lt-res-col .form-select {
  border-radius: 12px !important;
  border: 1.5px solid var(--lt-line) !important;
  font-weight: 700;
  color: var(--lt-ink) !important;
}
.lt-res-field { display: block; }
.lt-res-field .lt-res-label { margin-bottom: 0.45rem; }
.lt-res-field .form-select {
  border-radius: 12px !important;
  border: 1.5px solid var(--lt-line) !important;
  font-weight: 700;
}

/* ===== /user/member: รายการสมาชิก ===== */
.lt-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff !important;
  background-image: linear-gradient(90deg, var(--lt-chili), #f0602c);
  box-shadow: 0 3px 10px rgba(240, 62, 82, 0.28);
  text-decoration: none;
  /* ใช้ได้ทั้ง <a> และ <button> (หน้า /user/assistant เปิดโมดัลจึงเป็น <button>)
     — ล้างเส้นขอบ/พื้นหลัง/ฟอนต์ค่าเริ่มต้นของ <button> ไม่งั้นจะมีขอบและสูงกว่าปุ่มลิงก์ของหน้า /user/member */
  border: 0;
  margin: 0;
  background-color: transparent;
  font-family: inherit;
  line-height: inherit;
  white-space: nowrap;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.lt-add-btn:hover { filter: brightness(0.96); color: #fff !important; }

/* ชิปกรองสถานะ */
.lt-chip-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.lt-chip {
  border: 1.5px solid var(--lt-line);
  background: #fff;
  color: var(--lt-ink);
  border-radius: 999px;
  padding: 0.32rem 0.9rem;
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 700;
}
.lt-chip:hover { border-color: #b9b2c9; }
.lt-chip.active {
  background: var(--lt-ink);
  border-color: var(--lt-ink);
  color: #fff;
  box-shadow: 0 2px 8px rgba(43, 33, 64, 0.22);
}

/* อักษรย่อแทนรูปโปรไฟล์ */
.lt-mb-avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  background: linear-gradient(135deg, #8b7ae8, #6d5bd0);
}
.lt-mb-date { font-variant-numeric: tabular-nums; }
.lt-mb-time { margin-inline-start: 0.35rem; color: #8a80a0; font-weight: 600; font-variant-numeric: tabular-nums; }
.lt-mb-never { color: #b9b2c9; font-weight: 600; }
.lt-mb-status { display: flex; align-items: center; gap: 0.5rem; }
.lt-mb-status-text { font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.lt-mb-status.is-on .lt-mb-status-text { color: var(--lt-leaf); }
.lt-mb-status.is-off .lt-mb-status-text { color: #8a80a0; }

/* โหมดตาราง: ผู้ใช้ | สมัคร | เข้าล่าสุด | สถานะ | จัดการ */
.lt-mb-table .lt-bp-row { border-radius: 10px; transition: background-color 0.12s ease; }
.lt-mb-table .lt-bp-row:hover { background: rgba(43, 33, 64, 0.035); }
@media (min-width: 992px) {
  .lt-bp-table.lt-mb-table {
    grid-template-columns: minmax(220px, 2.2fr) repeat(2, minmax(150px, 1fr)) max-content max-content;
    column-gap: 1rem;
    padding-inline: 0.5rem;
  }
  .lt-mb-table .lt-bp-head span:nth-child(2),
  .lt-mb-table .lt-bp-head span:nth-child(3) { text-align: center; }
  .lt-mb-table .lt-bp-head span:nth-child(n + 4) { text-align: center; }
  .lt-mb-table .lt-bp-stats .lt-bd-stat { text-align: center; }
  @supports not (grid-template-columns: subgrid) {
    .lt-mb-table .lt-bp-head,
    .lt-mb-table .lt-bp-row {
      grid-template-columns: minmax(220px, 2.2fr) repeat(2, minmax(150px, 1fr)) max-content max-content;
    }
  }
}
@media (max-width: 991.98px) {
  /* กฎกลางของแถวบนมือถือแจก grid-area ให้ .lt-bp-status แต่หน้ารายชื่อผู้ใช้ใช้ .lt-mb-status
     (คนละคลาส) มันจึงถูกวางอัตโนมัติไปแย่งคอลัมน์ แล้วบีบปุ่ม ⋮ เหลือกว้าง ~6px จนกดไม่ได้
     -> แจก grid-area ให้เองเท่านั้น ที่เหลือใช้ areas กลาง (ปุ่ม ⋮ อยู่มุมขวาบนเหมือนหน้าอื่น) */
  .lt-mb-table .lt-mb-status { grid-area: status; justify-content: flex-end; }
  .lt-mb-table .lt-bp-stats {
    grid-area: stats;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    padding-top: 0.4rem;
  }
  .lt-mb-table .lt-bp-actions { grid-area: action; }
}

/* โหมดการ์ด */
.lt-mb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.75rem;
}
.lt-mb-card {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  padding: 0.85rem 0.9rem;
  overflow: visible;
}
.lt-mb-card > .lt-ticket-band {
  position: absolute;
  inset: 0 0 auto 0;
  border-start-start-radius: 16px;
  border-start-end-radius: 16px;
}
.lt-mb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.lt-mb-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.65rem;
  padding-top: 0.6rem;
  border-top: 2px dashed rgba(43, 33, 64, 0.12);
}
.lt-mb-stats .lt-bd-stat { text-align: center; }
.lt-mb-foot { margin-top: 0.7rem; }
.lt-mb-foot .btn,
.lt-mb-foot .dropdown { width: 100%; }
.lt-mb-card .dropdown-menu { z-index: 1056; }

/* โมดัลรีเซ็ตรหัสผ่าน */
.lt-pw-grid { display: grid; gap: 0.75rem; }
.lt-pw-field {
  display: block;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  background: #fff;
}
.lt-pw-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--lt-ink);
  margin-bottom: 0.4rem;
}
.lt-pw-label i { color: #8a80a0; }
.lt-pw-field .form-control {
  border-radius: 12px !important;
  border: 1.5px solid var(--lt-line) !important;
  font-weight: 600;
}
.lt-pw-field .form-control:focus {
  border-color: var(--lt-chili) !important;
  box-shadow: 0 0 0 3px rgba(240, 62, 82, 0.14) !important;
}
.lt-pw-field .form-control[readonly] { background: #f7f5fb !important; color: var(--lt-ink) !important; }
.lt-pw-switch { display: flex; align-items: center; gap: 0.6rem; margin: 0; cursor: pointer; }
.lt-pw-switch-text { font-size: 0.8rem; color: #8a80a0; }

/* .switch ของเทมเพลตกว้าง 0 แล้ววาดสไลเดอร์แบบ absolute -> ไปทับป้ายข้าง ๆ
   ล็อกกล่องให้เท่าตัวสไลเดอร์เหมือนหน้าอื่นที่เจอปัญหาเดียวกัน */
.lt-mb-status .switch,
.lt-pw-switch .switch,
.lt-mu-allswitch .switch,
.lt-hs-excess .switch,
.lt-la-switch .switch,
.lt-mu-lot .switch {
  position: relative;
  display: inline-block;
  margin: 0 !important;
  padding: 0 !important;
  flex: none;
  width: 40px !important;
  min-width: 40px !important;
  height: 24px;
}
.lt-mb-status .switch .switch-toggle-slider,
.lt-pw-switch .switch .switch-toggle-slider,
.lt-mu-allswitch .switch .switch-toggle-slider,
.lt-hs-excess .switch .switch-toggle-slider,
.lt-la-switch .switch .switch-toggle-slider,
.lt-mu-lot .switch .switch-toggle-slider {
  position: absolute !important;
  inset: 0 auto auto 0 !important;
  transform: none !important;
  width: 40px;
  height: 24px;
}
.lt-mb-status .switch .switch-input,
.lt-pw-switch .switch .switch-input,
.lt-mu-allswitch .switch .switch-input,
.lt-hs-excess .switch .switch-input,
.lt-la-switch .switch .switch-input,
.lt-mu-lot .switch .switch-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.lt-mb-status .switch .switch-label,
.lt-pw-switch .switch .switch-label,
.lt-mu-allswitch .switch .switch-label,
.lt-hs-excess .switch .switch-label,
.lt-mu-lot .switch .switch-label { display: none !important; }

/* ===== /user/member/update: แก้ไขเมมเบอร์ ===== */
.lt-page-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.lt-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1.5px solid var(--lt-line);
  background: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--lt-ink) !important;
  text-decoration: none;
  white-space: nowrap;
}
.lt-back-link:hover { border-color: var(--lt-ink); }

/* การ์ดช่องกรอกข้อมูลทั่วไป */
.lt-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.75rem;
}
.lt-form-field {
  display: block;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  background: #fff;
  margin: 0;
}
.lt-form-field.is-locked { background: #f7f5fb; border-style: dashed; }
.lt-form-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--lt-ink);
  margin-bottom: 0.4rem;
}
.lt-form-label i { color: #8a80a0; }
.lt-form-field .form-control {
  border-radius: 12px !important;
  border: 1.5px solid var(--lt-line) !important;
  font-weight: 600;
}
.lt-form-field .form-control:focus {
  border-color: var(--lt-chili) !important;
  box-shadow: 0 0 0 3px rgba(240, 62, 82, 0.14) !important;
}
.lt-form-field .form-control[readonly] { background: transparent !important; color: var(--lt-ink) !important; }
.lt-form-password { position: relative; }
.lt-form-password .form-control { padding-inline-end: 2.6rem !important; }
.lt-form-eye {
  position: absolute;
  inset-inline-end: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #8a80a0;
  padding: 0.35rem 0.45rem;
  border-radius: 10px;
}
.lt-form-eye:hover { color: var(--lt-ink); background: #f3f0f8; }

/* แท็บย่อยขนาดเล็ก (กลุ่มหวย) */
.lt-subtabs-sm .nav-link { font-size: 0.82rem; padding: 0.3rem 0.75rem; }

/* แถบหัวของแท็บ เปิด/ปิดหวย */
.lt-mu-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.lt-mu-bar-title { font-weight: 700; color: var(--lt-ink); }
.lt-mu-allswitch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--lt-ink);
  cursor: pointer;
  border: 1.5px solid var(--lt-line);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
}

/* กริดการ์ดเปิด/ปิดหวย */
.lt-mu-lots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.5rem;
}
.lt-mu-lot {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  padding: 0.55rem 0.7rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.lt-mu-lot:hover { border-color: #b9b2c9; }
.lt-mu-lot.is-on { border-color: rgba(14, 159, 110, 0.45); background: rgba(14, 159, 110, 0.06); }
.lt-mu-lot .lt-bp-flag { flex: none; width: 34px; height: 34px; border-radius: 10px; }
.lt-mu-lot-name { flex: 1; min-width: 0; font-weight: 700; font-size: 0.88rem; color: var(--lt-ink); }
.lt-mu-lot.is-on .lt-mu-lot-name { color: var(--lt-leaf); }

/* ตารางกรอกอัตราจ่าย / คอมมิชชั่น / แทงสูงสุด */
.lt-mu-table {
  border-collapse: separate !important;
  border-spacing: 0;
  margin-bottom: 0;
}
.lt-mu-table > thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--lt-ink) !important;
  color: #fff !important;
  border: 0 !important;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  padding: 0.5rem 0.6rem !important;
}
.lt-mu-table > tbody > tr > td {
  border: 0 !important;
  border-bottom: 1.5px dashed rgba(43, 33, 64, 0.12) !important;
  padding: 0.45rem 0.5rem !important;
  vertical-align: middle;
}
.lt-mu-table > tbody > tr:first-child > td {
  background: #f7f5fb;
  font-weight: 700;
}
.lt-mu-table .form-control {
  border-radius: 10px !important;
  border: 1.5px solid var(--lt-line) !important;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  min-width: 88px;
  padding: 0.3rem 0.45rem !important;
}
.lt-mu-table .form-control:focus {
  border-color: var(--lt-chili) !important;
  box-shadow: 0 0 0 3px rgba(240, 62, 82, 0.14) !important;
}
.lt-mu-table .is-over .form-control { border-color: var(--lt-chili) !important; background: rgba(240, 62, 82, 0.06); }
/* หมายเหตุ: ป้าย .user-payout-max / .user-commission-max เคยถูกจัดเป็น "ชิปใต้ช่องกรอก" ตรงนี้
   แต่ของจริงมันเป็น .input-group-text ต่อท้ายช่องกรอกในหน้า /user/setting/payoutRateCommission
   (มีที่เดียว) สไตล์สองชุดจึงตีกัน -> ป้ายเตี้ยกว่าช่องกรอกและสีขอบไม่ตรงกัน
   ย้ายไปกำหนดที่บล็อก .lt-prc-table ที่เดียวแล้ว */
.lt-mu-table img { border-radius: 6px; box-shadow: 0 1px 3px rgba(43, 33, 64, 0.25); }
.lt-mu-table .dt-hasChild { font-weight: 700; }
.lt-mu-sub > thead th { background: #6d5bd0 !important; font-size: 0.78rem; }

/* แถบบันทึกล่างจอ */
.lt-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0.25rem;
  margin-top: 0.75rem;
  background: linear-gradient(180deg, rgba(247, 245, 251, 0), var(--lt-canvas) 45%);
}
.lt-save-bar .lt-set-cancel { text-decoration: none; display: inline-flex; align-items: center; }

/* ช่องค้นหาชื่อหวยในแท็บของหน้าแก้ไขสมาชิก */
.lt-mu-searchbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.lt-mu-search { flex: 1 1 260px; max-width: 420px; margin: 0; }
.lt-mu-found { font-size: 0.82rem; font-weight: 700; color: #8a80a0; }
.lt-mu-found.is-empty { color: var(--lt-chili); }

/* โมดัล "ส่วนแบ่งที่ได้รับ" (/user/member): แท็บ + ช่องค้นหาตรึงไว้บน เนื้อหาเป็นการ์ด */
.lt-ud-modal .modal-body { padding-top: 0 !important; }
/* ตรึงเฉพาะแถวแท็บหลัก (แถวชิปกลุ่มหวยข้างในใช้คลาสเดียวกัน ถ้าตรึงด้วยจะซ้อนทับกัน) */
.lt-ud-modal .modal-body > .lt-subtabs {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #fff;
  padding-top: 0.5rem;
  padding-bottom: 0.35rem;
  margin: 0 -0.25rem;
  /* .lt-subtabs ปกติเป็นแถบเลื่อนแนวนอน (overflow-x:auto) ซึ่งจะตัดเนื้อหาแนวตั้งด้วย
     พอมาใช้คู่กับ sticky ปุ่มแท็บเลยโดนตัดครึ่ง — แท็บหลักมีแค่ 3 อัน ให้ตัดบรรทัดแทน */
  overflow: visible;
  flex-wrap: wrap;
}
.lt-ud-searchbar {
  position: sticky;
  top: 44px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  background: #fff;
  padding: 0.35rem 0 0.5rem;
}
.lt-ud-searchbar .lt-modal-search { flex: 1 1 240px; max-width: 380px; margin: 0; }
.lt-ud-modal .nav-align-top { margin-bottom: 0.5rem; }
.lt-ud-modal .lt-my-lots { gap: 0.6rem; }

/* /user/member/create: ช่องยอดเงิน + แถบคัดลอกการตั้งค่า */
.lt-form-hint { font-size: 0.75rem; font-weight: 600; color: var(--lt-chili); margin-inline-start: 0.35rem; }
.lt-form-field.is-credit { border-color: rgba(18, 185, 129, 0.4); background: rgba(18, 185, 129, 0.05); }
.lt-form-field.is-credit .lt-form-label i { color: var(--lt-leaf); }
/* แถบคัดลอกการตั้งค่า อยู่ใต้แถวแท็บ — ดึงขึ้นชิดแท็บ ไม่ให้เหลือช่องว่างใหญ่ */
.lt-copy-bar { display: flex; justify-content: flex-end; margin: -1rem 0 0.6rem; }
.lt-copy-field { flex: 1 1 320px; max-width: 420px; }
.lt-copy-field .form-select,
.lt-copy-field .select2-container { width: 100% !important; }
.lt-copy-field .select2-container--default .select2-selection--single {
  border-radius: 12px !important;
  border: 1.5px solid var(--lt-line) !important;
  height: 38px;
  display: flex;
  align-items: center;
}

/* ปุ่มลูกศรของ input[type=number] โผล่ตอน focus/hover แล้วดันข้อความในช่อง (UI ขยับ) — ซ่อนทิ้ง */
.lt-form-field input[type="number"]::-webkit-outer-spin-button,
.lt-form-field input[type="number"]::-webkit-inner-spin-button,
.lt-mu-table input[type="number"]::-webkit-outer-spin-button,
.lt-mu-table input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.lt-form-field input[type="number"],
.lt-mu-table input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* ===== /user/agent/create: แท็บ "ส่วนแบ่งหุ้น" (การ์ดต่อหวย) ===== */
/* แถบตั้งค่าทั้งกลุ่ม อยู่บนสุดของแต่ละแท็บกลุ่มหวย */
.lt-hs-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  border: 1.5px dashed var(--lt-line);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  background: #faf9fd;
  margin-bottom: 0.85rem;
}
.lt-hs-bar-head { flex: 1 1 240px; align-self: center; }
.lt-hs-bar-field { flex: 0 1 240px; margin: 0; }
.lt-hs-flabel {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #8a80a0;
  margin-bottom: 0.3rem;
}
.lt-hs-bar-field .form-select { border-radius: 12px !important; border: 1.5px solid var(--lt-line) !important; font-weight: 700; }

/* กริดการ์ดรายหวย */
.lt-hs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.6rem;
}
.lt-hs-card {
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  padding: 0.7rem 0.8rem;
  background: #fff;
}
.lt-hs-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed var(--lt-line);
}
.lt-hs-head .lt-bp-flag { flex: none; width: 32px; height: 32px; border-radius: 9px; }
.lt-hs-lot { flex: 1; min-width: 0; font-weight: 700; font-size: 0.88rem; color: var(--lt-ink); }
.lt-hs-recv {
  flex: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: #8a80a0;
  background: #f3f0f8;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}
.lt-hs-recv b { color: var(--lt-ink); font-size: 0.85rem; }
.lt-hs-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.6rem 0;
}
.lt-hs-field { margin: 0; min-width: 0; }
.lt-hs-field .form-control,
.lt-hs-field .form-select {
  border-radius: 12px !important;
  border: 1.5px solid var(--lt-line) !important;
  font-weight: 700;
}
/* ช่อง "เหลือของเรา" เป็นค่าอ่านอย่างเดียว ทำให้ดูต่างจากช่องที่กรอกได้ */
.lt-hs-field.is-ours .form-control[readonly] {
  background: #f7f5fb !important;
  border-style: dashed !important;
  color: var(--lt-ink) !important;
  text-align: center;
}
.lt-hs-field input[type="number"]::-webkit-outer-spin-button,
.lt-hs-field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
.lt-hs-field input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
/* select2 ของแบ่งหุ้น (สคริปต์หลักแปลง <select> เป็น select2 ทุกตัว) */
.lt-hs-field .select2-container,
.lt-hs-bar-field .select2-container { width: 100% !important; }
.lt-hs-field .select2-container--default .select2-selection--single,
.lt-hs-bar-field .select2-container--default .select2-selection--single {
  border-radius: 12px !important;
  border: 1.5px solid var(--lt-line) !important;
  height: 38px;
  display: flex;
  align-items: center;
}
.lt-hs-field .select2-container--default .select2-selection--single .select2-selection__rendered,
.lt-hs-bar-field .select2-container--default .select2-selection--single .select2-selection__rendered {
  font-weight: 700;
  color: var(--lt-ink);
  line-height: 1.2;
}
.lt-hs-field .select2-container--default .select2-selection--single .select2-selection__arrow,
.lt-hs-bar-field .select2-container--default .select2-selection--single .select2-selection__arrow { top: 6px; }
/* สวิตช์ "เก็บของเกิน" */
.lt-hs-excess {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--lt-ink);
  cursor: pointer;
}
.lt-hs-bar .lt-hs-excess {
  flex: none;
  align-self: center;
  border: 1.5px solid var(--lt-line);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  background: #fff;
}

/* select2 ซ่อน <select> ตัวจริงด้วยคลาส select2-hidden-accessible (width:1px !important)
   แต่กฎ .lt-xxx .form-select { width:100% !important } ของเราจำเพาะกว่า เลยไปทับจนกล่องที่ซ่อนอยู่
   ยังกว้างเต็มและดันหน้าให้เลื่อนแนวนอนได้บนจอเล็ก — ตรึงกลับเป็น 1px
   (select2 อ่านความกว้างตอน init ก่อนติดคลาสนี้ จึงไม่กระทบขนาดกล่องที่แสดงจริง) */
select.form-select.select2-hidden-accessible,
select.form-control.select2-hidden-accessible { width: 1px !important; }

/* ===== ช่องกรอกไม่ขยับตอน focus =====
   core.css ขยายเส้นขอบเป็น 2px ตอน focus แล้วหักลบ padding 2px เพื่อชดเชยความสูงให้เท่าเดิม
   แต่ theme2 ล็อกเส้นขอบไว้ 1.5px ด้วย !important เส้นขอบจึงไม่โตตามที่ core คาดไว้
   เหลือแต่ padding ที่หดลง ช่องเลย "ยุบ" ~2px และข้อความขยับทุกครั้งที่คลิก
   -> ให้ทั้งเส้นขอบและ padding ตอน focus เท่ากับสถานะปกติ (theme2 บอก focus ด้วยสีขอบ + เงาอยู่แล้ว) */
.form-control:focus,
.form-control:focus-within {
  border-width: var(--bs-border-width);
  padding-block: calc(0.426rem - var(--bs-border-width));
  padding-inline: calc(0.9375rem - var(--bs-border-width));
}
.form-select:focus,
.form-select:focus-within {
  border-width: var(--bs-border-width);
  background-position: right calc(0.9375rem - var(--bs-border-width)) center;
  padding-block: calc(0.426rem - var(--bs-border-width));
  padding-inline: calc(0.9375rem - var(--bs-border-width)) calc(2.625rem - var(--bs-border-width));
}
/* ช่องรหัสผ่านเว้นที่ให้ปุ่มลูกตา — ต้องคงไว้ตอน focus ด้วย ไม่งั้นข้อความไปทับปุ่ม */
.lt-form-password .form-control:focus { padding-inline-end: 2.6rem !important; }

/* ===== พื้นหลังไล่สี + เส้นขอบ = จุดสีแปลกที่ปลายปุ่ม =====
   ค่าเริ่มต้นของ background-origin คือ padding-box แต่ background-clip คือ border-box
   ไล่สีจึงถูก "วางขนาด" เท่ากล่องด้านใน แล้ววาดเลยออกไปถึงแถบขอบ ส่วนที่เลยออกไปจะเป็นการปูซ้ำ (repeat)
   ปลายซ้ายจึงโผล่สีท้ายของไล่สี (เหลือง) ปลายขวาโผล่สีต้น (แดง) — บนปุ่มมนจะเห็นเป็นจุดสีเพี้ยนที่ปลายทั้งสองข้าง
   -> ให้ไล่สีวางตาม border-box และห้ามปูซ้ำ
   (ใช้กับทุก element ที่มีทั้งพื้นหลังไล่สีและเส้นขอบ — ตอนนี้มี 2 ตัว) */
.lt-set-save,
.lt-empty {
  background-origin: border-box;
  background-repeat: no-repeat;
}

/* ===== /user/hierarchy: สายงาน ===== */
/* เส้นทางสายงาน — <li> ถูกสร้างจาก server (คลาส breadcrumb-item-user / breadcrumb-user) แก้ที่นี่เท่านั้น */
.lt-crumb-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.lt-crumb-home {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #8a80a0;
  white-space: nowrap;
}
.lt-crumb-home i { color: #b9b2c9; }
.lt-crumb.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
}
.lt-crumb .breadcrumb-item {
  display: inline-flex;
  align-items: center;
  padding: 0;
}
/* ลูกศรคั่นของ bootstrap ใช้ ::before — แทนด้วยไอคอนของเราให้เข้ากับชิป */
.lt-crumb .breadcrumb-item + .breadcrumb-item::before {
  content: "\203a";
  color: #c9c2d6;
  font-weight: 700;
  padding: 0 0.35rem;
  float: none;
}
.lt-crumb .breadcrumb-item a {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--lt-line);
  background: #fff;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--lt-ink) !important;
  text-decoration: none;
  white-space: nowrap;
}
.lt-crumb .breadcrumb-item a.breadcrumb-user { cursor: pointer; }
.lt-crumb .breadcrumb-item a.breadcrumb-user:hover { border-color: var(--lt-chili); color: var(--lt-chili) !important; }
.lt-crumb .breadcrumb-item.active a {
  background: var(--lt-ink);
  border-color: var(--lt-ink);
  color: #fff !important;
  cursor: default;
}

/* ชื่อผู้ใช้ที่กดไล่ลงสายงานได้ (เอเย่นต์) */
.lt-bp-title.is-drill { display: inline-flex; align-items: center; gap: 0.35rem; }
.lt-bp-title.is-drill .btn-user-downline { color: var(--lt-ink) !important; }
.lt-bp-title.is-drill i { font-size: 0.7rem; color: #b9b2c9; }
.lt-bp-title.is-drill:hover .btn-user-downline,
.lt-bp-title.is-drill:hover i { color: var(--lt-chili) !important; }
.lt-mb-avatar.is-agent { background: linear-gradient(135deg, #12b981, #0e9f6e); }

/* ป้ายระดับ */
.lt-hr-role { display: flex; justify-content: center; }
.lt-hr-role .badge {
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.72rem !important;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* โหมดตาราง: ผู้ใช้ | ระดับ | เข้าล่าสุด | สถานะ | จัดการ */
@media (min-width: 992px) {
  .lt-bp-table.lt-hr-table {
    grid-template-columns: minmax(220px, 2.4fr) max-content minmax(150px, 1fr) max-content max-content;
  }
  @supports not (grid-template-columns: subgrid) {
    .lt-hr-table .lt-bp-head,
    .lt-hr-table .lt-bp-row {
      grid-template-columns: minmax(220px, 2.4fr) max-content minmax(150px, 1fr) max-content max-content;
    }
  }
}
@media (max-width: 991.98px) {
  /* หน้านี้มี "ป้ายระดับ" เพิ่มมาอีกชิ้น -> ประกาศ areas ใหม่ทั้งชุด (ทับของ .lt-mb-table)
     คง ⋮ ไว้มุมขวาบนให้เหมือนหน้าอื่น */
  .lt-hr-table .lt-bp-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "main role action"
      "stats status status";
    row-gap: 0.5rem;
  }
  .lt-hr-table .lt-hr-role { grid-area: role; justify-content: flex-end; align-self: center; }
  .lt-hr-table .lt-bp-stats { grid-area: stats; display: block; padding-top: 0; }
  .lt-hr-table .lt-mb-status { grid-area: status; justify-content: flex-end; align-self: center; }
  .lt-hr-table .lt-bp-actions { grid-area: action; }
}
.lt-list-body .dropdown-item.btn-downline::after { content: "ดูผังสายงานทั้งชั้น"; }

/* ผังสายงาน (D3) — เดิมสไตล์อยู่ใน <style> ของวิว ย้ายมาไว้ที่นี่ (จำกัดขอบเขตในโมดัลเท่านั้น) */
.lt-tree-hint {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #8a80a0;
  margin-bottom: 0.5rem;
}
.lt-tree-hint i { color: #b9b2c9; }
.lt-tree-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  overflow: auto;
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfaff, #f5f3fa);
}
.lt-tree-modal .node text {
  font-size: 12px;
  font-weight: 700;
  fill: var(--lt-ink);
  dominant-baseline: middle;
  text-anchor: middle;
}
.lt-tree-modal .node circle { stroke: #fff; stroke-width: 3px; }
.lt-tree-modal .node:hover circle { stroke: var(--lt-chili); }
.lt-tree-modal .link { fill: none; stroke: #d9d3e6; stroke-width: 2px; }

/* กดได้ทั้งก้อน (รูป + ชื่อ + ชื่อ-นามสกุล) สำหรับแถวที่ไล่ลงสายงานได้ — ชื่อผู้ใช้สั้น ๆ จะได้ไม่ต้องเล็งกด */
.lt-bp-main.btn-user-downline { cursor: pointer; border-radius: 12px; }
.lt-bp-main.btn-user-downline:hover { background: rgba(240, 62, 82, 0.06); }
.lt-bp-main.btn-user-downline:hover .lt-bp-title.is-drill .btn-user-downline,
.lt-bp-main.btn-user-downline:hover .lt-bp-title.is-drill i { color: var(--lt-chili) !important; }


/* ===== /user/all: รายชื่อสมาชิกทั้งหมด ===== */
/* แถวชิปกรอง 2 ชุด (ระดับ / สถานะ) */
.lt-ua-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}
.lt-chip-label {
  align-self: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #8a80a0;
  margin-inline-end: 0.15rem;
}
/* ต้นสาย */
.lt-ua-upwrap { display: flex; justify-content: center; min-width: 0; }
.lt-ua-upline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  border: 1.5px solid var(--lt-line);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #7a7090;
  background: #fff;
}
.lt-ua-upline > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-ua-upline i { font-size: 0.65rem; color: #b9b2c9; }
.lt-ua-upline.is-agent {
  color: var(--lt-leaf);
  border-color: rgba(14, 159, 110, 0.35);
  background: rgba(14, 159, 110, 0.07);
}
.lt-ua-upline.is-agent i { color: var(--lt-leaf); }
.lt-ua-upline.is-none { border-style: dashed; color: #b9b2c9; }
/* ป้ายสถานะ (หน้านี้อ่านอย่างเดียว ไม่มีสวิตช์) */
.lt-ua-status { display: flex; justify-content: center; }
.lt-ua-status .badge {
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.72rem !important;
  font-weight: 700;
}
.lt-ua-status .lt-ua-off { background: #efecf5 !important; color: #8a80a0 !important; }
.lt-ua-cardline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

/* โหมดตาราง: ผู้ใช้ | ระดับ | ต้นสาย | สมัคร | เข้าล่าสุด | สถานะ | จัดการ */
@media (min-width: 992px) {
  .lt-bp-table.lt-ua-table {
    grid-template-columns: minmax(190px, 1.6fr) max-content minmax(110px, 0.9fr) repeat(2, max-content) max-content max-content;
    column-gap: 0.9rem;
  }
  /* วันที่กับเวลาต้องอยู่บรรทัดเดียวกัน (คอลัมน์เยอะ ถ้าปล่อยให้ตัดคำจะกลายเป็น 2 บรรทัด) */
  .lt-ua-table .lt-bd-stat b { white-space: nowrap; }
  @supports not (grid-template-columns: subgrid) {
    .lt-ua-table .lt-bp-head,
    .lt-ua-table .lt-bp-row {
      grid-template-columns: minmax(190px, 1.6fr) max-content minmax(110px, 0.9fr) repeat(2, max-content) max-content max-content;
    }
  }
}
@media (max-width: 991.98px) {
  /* ชิ้นส่วนเยอะกว่าหน้าอื่น -> ประกาศ areas เองให้ครบ (ปุ่ม ⋮ อยู่มุมขวาบนเหมือนกัน) */
  .lt-ua-table .lt-bp-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "main role action"
      "upline status status"
      "stats stats stats";
    row-gap: 0.5rem;
  }
  .lt-ua-table .lt-hr-role { grid-area: role; justify-content: flex-end; align-self: center; }
  .lt-ua-table .lt-ua-upwrap { grid-area: upline; justify-content: flex-start; }
  .lt-ua-table .lt-ua-status { grid-area: status; justify-content: flex-end; }
  .lt-ua-table .lt-bp-stats { grid-area: stats; }
  .lt-ua-table .lt-bp-actions { grid-area: action; }
}

/* แถบค้นหาที่วางต่อจากแถวแท็บโดยตรง (หน้า /user/setting/myDetail) ต้องเว้นระยะจากแท็บ ไม่งั้นดูติดกัน
   (หน้าอื่นแถบนี้ถูกแทรกหลัง .card-text / .lt-mu-bar จึงไม่โดนกฎนี้) */
.nav-align-top + .lt-mu-searchbar { margin-top: 0.9rem; }

/* ===== /user/setting/holdShares: ตั้งค่าแบ่งหุ้น ===== */
/* ชื่อผู้ใช้ที่กำลังแก้ (ในโมดัล) */
.lt-hs-users { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.lt-hs-users .btn {
  border-radius: 999px !important;
  padding: 0.25rem 0.75rem !important;
  font-size: 0.8rem !important;
  font-weight: 700;
  background: rgba(14, 159, 110, 0.1) !important;
  color: var(--lt-leaf) !important;
  border: 1.5px solid rgba(14, 159, 110, 0.28) !important;
  margin: 0 !important;
}
.lt-hs-modal .lt-hs-grid { margin-top: 0.85rem; }
/* กว้างเท่าโมดัลบังคับสู้ (.lt-kh-modal) — การ์ด auto-fill 280px จะเรียง 3–4 คอลัมน์ */
.lt-hs-modal .modal-xl { max-width: min(1280px, calc(100vw - 1.5rem)); }
.lt-hs-ours {
  border: 1.5px dashed var(--lt-line);
  border-radius: 12px;
  background: #f7f5fb;
  padding: 0.45rem 0.6rem;
  text-align: center;
  font-weight: 700;
  color: var(--lt-ink);
}
/* โหมดตาราง: เลือก | ผู้ใช้ | ระดับ | รับมา | แบ่งหุ้น | ของเรา | จัดการ */
@media (min-width: 992px) {
  .lt-bp-table.lt-shs-table {
    grid-template-columns: max-content minmax(190px, 1.8fr) max-content repeat(3, minmax(100px, 0.9fr)) max-content;
    column-gap: 0.9rem;
  }
  .lt-shs-table .lt-bp-stats .lt-bd-stat { text-align: center; }
  @supports not (grid-template-columns: subgrid) {
    .lt-shs-table .lt-bp-head,
    .lt-shs-table .lt-bp-row {
      grid-template-columns: max-content minmax(190px, 1.8fr) max-content repeat(3, minmax(100px, 0.9fr)) max-content;
    }
  }
}
@media (max-width: 991.98px) {
  .lt-shs-table .lt-bp-row {
    grid-template-columns: max-content minmax(0, 1fr) auto auto;
    grid-template-areas:
      "check main role action"
      "stats stats stats stats";
    row-gap: 0.5rem;
  }
  .lt-shs-table .lt-keep-check { grid-area: check; align-self: center; }
  .lt-shs-table .lt-bp-main { grid-area: main; }
  .lt-shs-table .lt-hr-role { grid-area: role; align-self: center; }
  .lt-shs-table .lt-bp-stats { grid-area: stats; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
  .lt-shs-table .lt-bp-actions { grid-area: action; align-self: center; }
}
.lt-shs-cardline { display: flex; justify-content: flex-end; margin-top: 0.5rem; }
.lt-shs-cardstats { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }

/* ===== /user/setting/payoutRateCommission: ตั้งค่าอัตราจ่าย/คอมมิชชั่น ===== */
/* ตัวเลือกหวยแบบ "เลือกได้ทีละหวย" */
.lt-prc-search { max-width: 420px; margin: 0 0 0.85rem; }
.lt-prc-groups { display: flex; flex-direction: column; gap: 0.85rem; }
.lt-prc-groups .lt-lot-group-count { font-size: 0.75rem; font-weight: 700; color: #b0a7c4; }
.lt-prc-picker .lt-lot-count {
  background: var(--lt-ink);
  color: #fff;
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
}
.lt-prc-picker .lt-lot-groupbar { margin-top: 0.9rem; }
/* ชิปอัตราจ่าย (ปกติ / VIP …) */
.lt-prc-picker .btn-payout-commission {
  border-radius: 999px !important;
  padding: 0.35rem 0.9rem !important;
  font-size: 0.85rem !important;
  font-weight: 700;
  border: 1.5px solid var(--lt-line) !important;
  margin: 0 !important;
}
.lt-prc-picker .btn-payout-commission.btn-primary {
  background: var(--lt-ink) !important;
  border-color: var(--lt-ink) !important;
  color: #fff !important;
}

/* ค่าในแต่ละประเภท: อัตราจ่าย (ตัวใหญ่) + คอมมิชชั่น (ชิป) */
.lt-prc-stat b { display: inline-flex; align-items: center; gap: 0.3rem; justify-content: center; }
.lt-prc-pay { font-weight: 700; color: var(--lt-ink); font-variant-numeric: tabular-nums; }
.lt-prc-com {
  font-size: 0.72rem;
  font-weight: 600;
  color: #d97706;
  background: rgba(255, 176, 32, 0.16);
  border-radius: 999px;
  padding: 0 0.4rem;
}
.lt-prc-stat.is-over .lt-prc-pay { color: var(--lt-chili); }
.lt-prc-role { margin-inline-start: 0.4rem; }
.lt-prc-role .badge { border-radius: 999px; padding: 0.15rem 0.5rem; font-size: 0.66rem !important; font-weight: 700; }

/* โหมดตาราง: เลือก | ผู้ใช้ | เปิด-ปิด | 6 ประเภท | จัดการ */
@media (min-width: 992px) {
  .lt-bp-table.lt-prc-table-list {
    grid-template-columns: max-content minmax(170px, 1.4fr) max-content repeat(6, minmax(74px, 0.8fr)) max-content;
    column-gap: 0.6rem;
  }
  .lt-prc-table-list .lt-bp-stats .lt-bd-stat { text-align: center; }
  @supports not (grid-template-columns: subgrid) {
    .lt-prc-table-list .lt-bp-head,
    .lt-prc-table-list .lt-bp-row {
      grid-template-columns: max-content minmax(170px, 1.4fr) max-content repeat(6, minmax(74px, 0.8fr)) max-content;
    }
  }
}
@media (max-width: 991.98px) {
  .lt-prc-table-list .lt-bp-row {
    grid-template-columns: max-content minmax(0, 1fr) auto auto;
    grid-template-areas:
      "check main status action"
      "stats stats stats stats";
    row-gap: 0.5rem;
  }
  .lt-prc-table-list .lt-keep-check { grid-area: check; align-self: center; }
  .lt-prc-table-list .lt-bp-main { grid-area: main; }
  .lt-prc-table-list .lt-mb-status { grid-area: status; align-self: center; }
  .lt-prc-table-list .lt-bp-actions { grid-area: action; align-self: center; }
  .lt-prc-table-list .lt-bp-stats {
    grid-area: stats;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
  }
}
.lt-prc-cardline { display: flex; justify-content: flex-end; margin-top: 0.5rem; }
.lt-prc-cardgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 2px dashed rgba(43, 33, 64, 0.12);
}
.lt-prc-cardgrid .lt-bd-stat { text-align: center; }
/* โมดัล */
.lt-prc-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.lt-prc-table .lt-set-btn { white-space: nowrap; }
.lt-prc-maxrow td { background: #faf9fd; }
/* ป้าย "ค่าสูงสุดที่รับมา" ของหน้านี้เป็น input-group-text ต่อท้ายช่องกรอก ไม่ใช่ชิปใต้ช่องแบบหน้าอื่น
   จึงต้องล้างสไตล์ชิปของ .lt-mu-table (margin-top/font-size/align-items: baseline) ออกให้หมด
   ไม่งั้นป้ายจะเตี้ยกว่าและเลื่อนลงจากช่องกรอก */
.lt-prc-table .input-group {
  flex-wrap: nowrap;
  align-items: stretch;
  border-radius: 12px;
}
.lt-prc-table .input-group-text {
  display: flex !important;
  align-items: center !important;
  justify-content: center;
  min-width: 66px;
  margin: 0 !important;
  padding: 0.3rem 0.6rem !important;
  border-radius: 0 12px 12px 0 !important;
  border: 1.5px solid var(--lt-line) !important;
  border-inline-start: 0 !important;
  background: #f1eef7 !important;
  font-size: 0.85rem !important;
  font-weight: 700;
  line-height: 1.4;
  color: #7a7090 !important;
}
.lt-prc-table .input-group .form-control {
  border-radius: 12px 0 0 12px !important;
  border-inline-end: 0 !important;
}
/* โฟกัส/กรอกเกินเพดาน: ให้ช่องกรอกกับป้ายเปลี่ยนสีพร้อมกันทั้งกลุ่ม จะได้ไม่เห็นรอยต่อสองสี
   และย้ายวงแหวนโฟกัสไปไว้ที่กลุ่ม (ช่องกรอกเอา box-shadow ของตัวเองออก) */
.lt-prc-table .input-group:focus-within { box-shadow: 0 0 0 3px rgba(240, 62, 82, 0.14); }
.lt-prc-table .input-group:focus-within .form-control,
.lt-prc-table .input-group:focus-within .input-group-text { border-color: var(--lt-chili) !important; }
.lt-prc-table .input-group .form-control:focus { box-shadow: none !important; }
.lt-prc-table .input-group:has(.form-control.text-danger) .form-control,
.lt-prc-table .input-group:has(.form-control.text-danger) .input-group-text {
  border-color: var(--lt-chili) !important;
}
.lt-prc-table .input-group:has(.form-control.text-danger) .input-group-text {
  background: rgba(240, 62, 82, 0.1) !important;
  color: var(--lt-chili) !important;
}
/* แถว "เลือกทั้งหมด" อยู่ใน <thead> แต่เป็น <td> จึงไม่ได้สไตล์หัวตาราง — กำหนดสีเอง */
.lt-prc-maxrow td { color: var(--lt-ink); font-weight: 700; }
/* .lt-mu-table เน้นแถวแรกของ tbody ให้เป็นแถว "ทั้งหมด" ของหน้าอื่น — หน้านี้แถวแรกเป็นข้อมูลจริง */
.lt-prc-table > tbody > tr:first-child > td { background: transparent; font-weight: 400; }

/* ---- /user/setting/payoutRateCommission: จัดใหม่ให้เป็น 2 ขั้นตอน + บอกเพดานที่รับมา ---- */
.lt-prc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.lt-prc-step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--lt-ink);
}
.lt-prc-stepno {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  background: var(--lt-chrome);
  background-origin: border-box;
  background-repeat: no-repeat;
}
.lt-prc-head .lt-prc-search { flex: 0 1 300px; margin: 0; }
.lt-prc-step2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 2px dashed rgba(43, 33, 64, 0.1);
}

/* เพดานที่เรารับมา */
.lt-prc-ceiling {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.8rem;
}
.lt-prc-ceiling:empty { display: none; }
.lt-prc-ceil-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #8a80a0;
  white-space: nowrap;
}
.lt-prc-ceil-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.lt-prc-ceil {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1.5px dashed var(--lt-line);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  background: #faf9fd;
}
.lt-prc-ceil i { font-style: normal; font-size: 0.72rem; color: #8a80a0; }
.lt-prc-ceil b { font-size: 0.85rem; font-weight: 800; color: var(--lt-ink); font-variant-numeric: tabular-nums; }
.lt-prc-ceil em {
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 700;
  color: #d97706;
  background: rgba(255, 176, 32, 0.16);
  border-radius: 999px;
  padding: 0 0.35rem;
}

/* บริบท + ชิปสรุป */
.lt-prc-context {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #8a80a0;
  margin-top: 0.15rem;
}
.lt-prc-context i { font-size: 0.6rem; color: #c9c2d6; }
.lt-prc-ctx-lot { color: var(--lt-ink); }
.lt-prc-ctx-tier { color: var(--lt-chili); }
.lt-prc-sum { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.85rem; }
.lt-prc-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  background: #fff;
  font-size: 0.78rem;
  color: #8a80a0;
}
.lt-prc-chip b { font-size: 0.92rem; font-weight: 800; color: var(--lt-ink); font-variant-numeric: tabular-nums; }
.lt-prc-chip.is-on { border-color: rgba(14, 159, 110, 0.35); background: rgba(14, 159, 110, 0.07); }
.lt-prc-chip.is-on b { color: var(--lt-leaf); }
.lt-prc-chip.is-off b { color: #8a80a0; }
.lt-prc-chip.is-full { border-color: rgba(109, 91, 208, 0.35); background: rgba(109, 91, 208, 0.07); }
.lt-prc-chip.is-full b { color: #6d5bd0; }

/* ค่าที่ตั้งเต็มเพดานแล้ว */
.lt-prc-stat.is-full .lt-prc-pay { color: var(--lt-leaf); }
.lt-prc-stat.is-full b::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Pro", "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.6rem;
  color: var(--lt-leaf);
  margin-inline-start: 0.15rem;
}

/* ---- หัวคอลัมน์กับค่าในแถวต้องจัดชิดแบบเดียวกัน ----
   กฎกลางจัดหัวคอลัมน์ตั้งแต่คอลัมน์ที่ 3 เป็นต้นไปให้ชิดขวา (text-align:end) ซึ่งเหมาะกับตารางตัวเลขเงิน
   แต่หน้ารายชื่อผู้ใช้ของเราจัดค่าไว้กึ่งกลาง -> หัวกับค่าเลยดูไม่ตรงกัน */
@media (min-width: 992px) {
  .lt-prc-table-list .lt-bp-head span:nth-child(n + 3) { text-align: center; }
  .lt-prc-table-list .lt-mb-status { justify-content: center; }
  /* ปุ่ม "จัดการ" อยู่ใต้หัวคอลัมน์ที่จัดกึ่งกลาง — ให้ปุ่มกึ่งกลางตามด้วย (เดิมชิดขวา) */
  .lt-mb-table .lt-bp-actions { justify-self: center; }
  .lt-mb-table .lt-mb-status,
  .lt-mb-table .lt-ua-status { justify-content: center; }
}

/* ---- payoutRateCommission: เลือกหลายหวยพร้อมกัน ---- */
.lt-prc-count {
  margin-inline-start: 0.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #8a80a0;
  background: #f3f0f8;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}
.lt-prc-count b { color: var(--lt-ink); }
.lt-prc-headtools { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.lt-prc-grouptoggle {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1.5px solid var(--lt-line);
  background: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #8a80a0;
  cursor: pointer;
}
.lt-prc-grouptoggle:hover { border-color: var(--lt-chili); color: var(--lt-chili); }
.lt-prc-grouptoggle.is-all { border-color: rgba(14, 159, 110, 0.4); background: rgba(14, 159, 110, 0.08); color: var(--lt-leaf); }
.lt-prc-grouptoggle i { font-size: 0.65rem; }
.lt-prc-ctx-lot.is-multi {
  background: rgba(109, 91, 208, 0.1);
  color: #6d5bd0;
  border-radius: 999px;
  padding: 0 0.5rem;
}
/* แถบเตือนว่าจะบันทึกให้หลายหวย */
.lt-prc-multi {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
  border: 1.5px dashed rgba(109, 91, 208, 0.4);
  background: rgba(109, 91, 208, 0.06);
  border-radius: 12px;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #6d5bd0;
}
.lt-prc-multi b { font-weight: 800; }
/* ค่าที่ต่างกันระหว่างหวยที่เลือก */
.lt-prc-stat.is-mixed .lt-prc-pay {
  font-size: 0.78rem;
  font-weight: 700;
  color: #6d5bd0;
  background: rgba(109, 91, 208, 0.1);
  border-radius: 999px;
  padding: 0 0.4rem;
}
.lt-prc-stat.is-mixed .lt-prc-com { display: none; }
.lt-prc-stat.is-mixed b::after { content: none; }

/* ปุ่ม "แก้ไขอัตราจ่ายของฉัน" (เฉพาะบริษัทที่ไม่มีต้นสาย) */
.lt-own-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1.5px solid rgba(217, 119, 6, 0.35);
  background: rgba(255, 176, 32, 0.14);
  color: #b45309;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.lt-own-btn:hover { background: rgba(255, 176, 32, 0.24); border-color: rgba(217, 119, 6, 0.55); }
.lt-own-btn i { font-size: 0.8rem; }
/* ตัวเตือนในโมดัล "แก้ไขอัตราจ่ายของฉัน" เมื่อเลือกหลายหวย */
.lt-prc-multi.is-warn {
  margin-top: 0;
  margin-bottom: 0.85rem;
  border-color: rgba(217, 119, 6, 0.45);
  background: rgba(255, 176, 32, 0.1);
  color: #b45309;
}

/* ===== topbar ขยับ/ล้ำ sidebar ตอน SweetAlert "กรุณารอสักครู่.." หรือโมดัลเปิด =====
   core.css ของเทมเพลตลดขอบซ้าย topbar ลงเท่าความกว้างสกอลบาร์ตอน .swal2-shown / .modal-open
   (`inset-inline-start: calc(16.25rem - var(--bs-scrollbar-width))`) เพราะคิดว่าเมนูซ้ายจะเลื่อนตามสกอลบาร์ที่หายไป
   แต่เมนูของเราเป็น position:fixed ชิดซ้าย ไม่ได้ขยับตาม topbar จึงเลื่อนซ้าย ~15px ไปทับ sidebar ทุกครั้งที่โหลด
   อีกด้านหนึ่ง สกอลบาร์หายทำให้ขอบขวา (inset-inline-end:0) ยืดออกไปอีก 15px ด้วย
   -> ตรึงขอบซ้ายไว้ที่ความกว้างเมนู และดันขอบขวาเข้ามาเท่าความกว้างสกอลบาร์
      (--bs-scrollbar-width ถูกวัดจริงใส่ไว้ที่ body โดย app-assets/js/main.js ถ้าเป็นสกอลบาร์แบบลอยจะเป็น 0 เอง)
      ผลคือ topbar ไม่ขยับสักด้าน */
@media (min-width: 1200px) {
  html.swal2-shown .lt-topbar.layout-navbar,
  body.swal2-shown .lt-topbar.layout-navbar,
  body.modal-open .lt-topbar.layout-navbar {
    inset-inline-start: calc(var(--bs-menu-width) + 0.75rem) !important;
    inset-inline-end: calc(var(--bs-scrollbar-width, 0px) + 0.75rem) !important;
  }
  html.layout-menu-collapsed.swal2-shown .lt-topbar.layout-navbar,
  html.layout-menu-collapsed body.swal2-shown .lt-topbar.layout-navbar,
  html.layout-menu-collapsed body.modal-open .lt-topbar.layout-navbar {
    inset-inline-start: calc(var(--bs-menu-collapsed-width) + 0.75rem) !important;
  }
}

/* ---- /user/setting/lotteryActive: เปิด/ปิดตลาดหวย ---- */
/* หวยที่ต้นสายปิด — ตั้งให้ลูกสายไม่ได้ */
.lt-la-blocked {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-top: 0.85rem;
  border: 1.5px dashed rgba(217, 119, 6, 0.45);
  background: rgba(255, 176, 32, 0.1);
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #b45309;
}
.lt-la-blocked b { font-weight: 800; }
.lt-la-blocked i { margin-top: 0.15rem; }
/* แถวรายการสมาชิก: เลือก | ผู้ใช้ | ระดับ | จัดการ
   ต้องเขียนเป็น .lt-bp-table.lt-la-table ใน @media เดียวกับ .lt-mb-table
   ไม่งั้นเทมเพลต 5 คอลัมน์ของ .lt-bp-table.lt-mb-table (specificity สูงกว่า) จะทับ แล้วคอลัมน์เพี้ยน */
.lt-la-row { grid-template-columns: subgrid; }
@media (min-width: 992px) {
  .lt-bp-table.lt-la-table {
    grid-template-columns: max-content minmax(220px, 3fr) minmax(110px, 0.7fr) max-content;
    column-gap: 0.8rem;
  }
  .lt-la-table .lt-bp-head span:nth-child(2) { text-align: start; }
  @supports not (grid-template-columns: subgrid) {
    .lt-la-table .lt-bp-head,
    .lt-la-table .lt-bp-row {
      grid-template-columns: max-content minmax(220px, 3fr) minmax(110px, 0.7fr) max-content;
    }
  }
}
/* โมดัล: การ์ดต่อหวย */
.lt-la-users {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}
.lt-la-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  border: 1.5px solid var(--lt-line);
  background: #f7f5fb;
  border-radius: 14px;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.75rem;
}
.lt-la-bar-head { flex: 1 1 220px; min-width: 0; }
.lt-la-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 0.6rem;
}
/* กว้างเท่าโมดัลแบ่งหุ้น/บังคับสู้ */
.lt-la-modal .modal-xl { max-width: min(1280px, calc(100vw - 1.5rem)); }
.lt-la-card {
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  padding: 0.6rem 0.75rem 0.7rem;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
/* กรอบการ์ดคงสีปกติเหมือนโมดัลอื่น — สถานะเปิด/ปิดบอกด้วยป้ายสวิตช์ + ชิปเท่านั้น (renderer สลับ .is-on ตามสวิตช์) */
.lt-la-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding-bottom: 0.5rem;
  border-bottom: 1.5px dashed rgba(43, 33, 64, 0.12);
}
.lt-la-head .lt-hs-lot { font-size: 0.9rem; }
.lt-la-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.55rem;
}
/* แถวสวิตช์: ป้ายสถานะซ้าย ชิปสถานะขวา */
.lt-la-switch {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--lt-ink-soft);
  cursor: pointer;
}
.lt-la-card.is-on .lt-la-switch { color: var(--lt-ink); }
.lt-la-state {
  margin-inline-start: auto;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: rgba(43, 33, 64, 0.07);
  color: #7a7090;
}
.lt-la-card.is-on .lt-la-state { background: rgba(14, 159, 110, 0.14); color: #0b7a55; }
/* "ผลกับ": ป้ายเล็กเหนือช่อง เต็มความกว้างการ์ด (แบบเดียวกับช่อง "แบ่งให้" ของโมดัลแบ่งหุ้น) */
.lt-la-scope { display: flex; flex-direction: column; gap: 0.2rem; }
.lt-la-scope .lt-hs-flabel { font-size: 0.7rem; }
.lt-la-scope .form-select {
  width: 100% !important;
  min-width: 0;
  border-radius: 11px !important;
  border: 1.5px solid var(--lt-line) !important;
  padding: 0.4rem 2rem 0.4rem 0.7rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--lt-ink);
  background-color: #fbfafc;
}
.lt-la-scope .form-select.is-all {
  border-color: rgba(109, 91, 208, 0.55) !important;
  background-color: rgba(109, 91, 208, 0.06);
  color: #5b48c9;
}
/* แถบตั้งรวมด้านบนยังเป็นแถวเดียว */
.lt-la-bar .lt-la-scope { flex-direction: row; align-items: center; gap: 0.35rem; }
.lt-la-bar .lt-la-scope .form-select { width: auto !important; min-width: 118px; }
.lt-la-bar .lt-la-switch { color: var(--lt-ink); }
/* สรุปของเดิมตอนเลือกหลายคน */
.lt-la-count {
  margin-inline-start: auto;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}
.lt-la-count.is-all { background: rgba(34, 197, 94, 0.14); color: #15803d; }
.lt-la-count.is-none { background: rgba(43, 33, 64, 0.08); color: #6b6480; }
.lt-la-count.is-mixed { background: rgba(255, 176, 32, 0.18); color: #b45309; }
@media (max-width: 991.98px) {
  .lt-la-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas: "check main actions" "check role actions";
  }
  .lt-la-row > .lt-keep-check { grid-area: check; }
  .lt-la-row > .lt-bp-main { grid-area: main; }
  .lt-la-row > .lt-hr-role { grid-area: role; justify-self: start; }
  .lt-la-row > .lt-bp-actions { grid-area: actions; align-self: center; }
}

/* ===== /user/setting/betLimit: ตั้งค่าแทงสูงสุด ===== */
/* แถบ "เพดานที่เรารับมา" ใช้ชิป .lt-prc-ceil ชุดเดียวกับหน้าอัตราจ่าย (ไม่ redefine) */
.lt-sbl-ceiling { margin-top: 0.85rem; }
/* รายการ: เลือก | ผู้ใช้ | ระดับ | 6 ประเภท | จัดการ */
.lt-sbl-table .lt-bd-stat b { font-variant-numeric: tabular-nums; }
.lt-sbl-table .lt-bd-stat b.lt-sbl-zero { color: #b0a7c4; }
.lt-sbl-range {
  font-size: 0.76rem;
  font-weight: 700;
  color: #6d5bd0;
  background: rgba(109, 91, 208, 0.1);
  border-radius: 999px;
  padding: 0 0.4rem;
  white-space: nowrap;
}
@media (min-width: 992px) {
  .lt-bp-table.lt-sbl-table {
    grid-template-columns: max-content minmax(170px, 1.6fr) max-content repeat(6, minmax(76px, 0.8fr)) max-content;
    column-gap: 0.7rem;
  }
  .lt-sbl-table .lt-bp-head span:nth-child(n + 3) { text-align: center; }
  .lt-sbl-table .lt-bp-stats .lt-bd-stat { text-align: center; }
  @supports not (grid-template-columns: subgrid) {
    .lt-sbl-table .lt-bp-head,
    .lt-sbl-table .lt-bp-row {
      grid-template-columns: max-content minmax(170px, 1.6fr) max-content repeat(6, minmax(76px, 0.8fr)) max-content;
    }
  }
}
/* มือถือ: ต้องแจก grid-area ให้ครบทุกชิ้น (เช็คลิสต์ข้อ 7) */
@media (max-width: 991.98px) {
  /* ป้ายระดับอยู่ใต้ชื่อ (ถ้าวางข้างชื่อ คอลัมน์ชื่อจะเหลือ ~100px จนตัวอักษรตัดทีละตัว) */
  .lt-sbl-table .lt-bp-row {
    grid-template-columns: max-content minmax(0, 1fr) auto;
    grid-template-areas:
      "check main action"
      "check role action"
      "stats stats stats";
    row-gap: 0.4rem;
  }
  .lt-sbl-table .lt-keep-check { grid-area: check; align-self: center; }
  .lt-sbl-table .lt-bp-main { grid-area: main; min-width: 0; }
  .lt-sbl-table .lt-hr-role { grid-area: role; justify-self: start; }
  .lt-sbl-table .lt-bp-stats { grid-area: stats; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
  .lt-sbl-table .lt-bp-actions { grid-area: action; align-self: center; }
}
.lt-sbl-cardline { display: flex; justify-content: flex-end; margin-top: 0.5rem; }
.lt-sbl-cardstats { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }

/* โมดัล: แท็บกลุ่มหวย + ค้นหา บนตารางเมทริกซ์ หวย × ประเภท */
.lt-sbl-modal .modal-xl { max-width: min(1180px, calc(100vw - 1.5rem)); }
.lt-sbl-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin: 0.75rem 0 0.6rem;
}
.lt-sbl-tools .lt-subtabs { flex: 1 1 auto; margin: 0; }
.lt-sbl-tools .lt-modal-search { flex: 0 1 280px; margin: 0; }
.lt-sbl-tabcount { font-size: 0.7rem; font-weight: 800; opacity: 0.75; margin-inline-start: 0.3rem; }
/* ตารางเลื่อนในตัวเอง: หัวตารางตรึงบน (จาก .lt-mu-table) + คอลัมน์ชื่อหวยตรึงซ้ายตอนเลื่อนแนวนอน */
.lt-sbl-wrap { max-height: min(62vh, 640px); overflow: auto; border-radius: 12px; }
.lt-sbl-table > thead th:first-child,
.lt-sbl-table > tbody > tr > td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 2px 0 0 rgba(43, 33, 64, 0.06);
}
.lt-sbl-table > thead th:first-child { z-index: 4; background: var(--lt-ink) !important; }
.lt-sbl-table > tbody > tr:first-child > td:first-child { background: #f7f5fb; }
.lt-sbl-table > thead th { text-align: center; }
.lt-sbl-lotcell { display: flex; align-items: center; gap: 0.5rem; min-width: 150px; }
.lt-sbl-lotcell .lt-bp-flag { width: 34px; height: 34px; border-radius: 10px; }
.lt-sbl-lot { font-weight: 700; font-size: 0.86rem; color: var(--lt-ink); white-space: nowrap; }
.lt-sbl-all-title { font-weight: 800; color: var(--lt-ink); white-space: nowrap; }
.lt-sbl-all-hint { font-size: 0.7rem; font-weight: 500; color: #8a80a0; white-space: nowrap; }
.lt-sbl-all-hint .lt-sbl-all-count { font-weight: 800; color: var(--lt-ink); }
.lt-sbl-allrow .form-control { border-style: dashed !important; }
.lt-sbl-table .form-control { min-width: 96px; }
/* ป้ายเพดานใต้ช่องกรอก */
.lt-sbl-cap {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.25rem;
  margin-top: 0.3rem;
  font-size: 0.7rem;
  white-space: nowrap;
}
.lt-sbl-cap i { font-style: normal; color: #8a80a0; font-weight: 600; }
.lt-sbl-cap b { color: var(--lt-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
/* ค่าเท่าเพดาน = เขียว + ✓, ค่า 0 = แดง (ปิดรับประเภทนั้น) */
.lt-sbl-table td.is-max .form-control { border-color: rgba(14, 159, 110, 0.55) !important; background: rgba(14, 159, 110, 0.06); }
.lt-sbl-table td.is-max .lt-sbl-cap b { color: var(--lt-leaf); }
.lt-sbl-table td.is-max .lt-sbl-cap b::after { content: " ✓"; }
.lt-sbl-table td.is-zero .form-control { color: var(--lt-chili); }

/* โหมดโมดัล: สูงสุดต่อโพย / จำกัดต่อเลขต่อรอบ (#ltBlModeTabs สลับ .lt-sbl-pane) */
/* .lt-detail-modal .modal-body เป็น flex column ที่มี max-height (modal-dialog-scrollable) — ลูกที่ overflow ไม่ใช่ visible
   (.lt-subtabs มี overflow-x:auto) จะถูกบีบตามแกนตั้งจนเหลือขอบบน ปุ่มล้นไปทับแถบกลุ่มหวย → ห้ามหด + overflow visible + ตัดบรรทัด (มี 2 แท็บ) */
.lt-sbl-modal .lt-sbl-modes {
  flex: 0 0 auto !important;
  margin-top: 0.7rem;
  overflow: visible !important;
  flex-wrap: wrap !important;
  height: auto;
}
.lt-sbl-modal .lt-sbl-modes .nav-item { flex: 0 0 auto; }
.lt-sbl-mode-badge {
  display: inline-block;
  margin-inline-start: 0.4rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.22);
}
.lt-sbl-modes .nav-link:not(.active) .lt-sbl-mode-badge { background: rgba(109, 91, 208, 0.12); color: #6d5bd0; }
.lt-sbl-num-intro {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.6rem;
  border-radius: 12px;
  background: rgba(109, 91, 208, 0.07);
  border: 1px dashed rgba(109, 91, 208, 0.35);
  font-size: 0.78rem;
  color: var(--lt-ink);
  line-height: 1.45;
}
.lt-sbl-num-intro > i { color: #6d5bd0; font-size: 1rem; margin-top: 0.15rem; }
.lt-sbl-num-intro-sub { display: block; margin-top: 0.15rem; font-size: 0.7rem; font-weight: 600; color: #8a80a0; }
/* คอลัมน์ "เปิดใช้": .switch ของเทมเพลตกว้าง 0 — ล็อกกล่องเท่าตัวสไลเดอร์ (กฎเดียวกับ .lt-lim-edit-toggle) */
.lt-sbl-num-cell { vertical-align: middle; min-width: 96px; }
.lt-sbl-num-cell .form-select { min-width: 92px; font-size: 0.8rem; font-weight: 700; }
.lt-sbl-toggle.switch {
  position: relative;
  display: inline-block;
  margin: 0 !important;
  padding: 0 !important;
  width: 40px !important;
  min-width: 40px !important;
  height: 24px;
  vertical-align: middle;
}
.lt-sbl-toggle.switch .switch-toggle-slider {
  position: absolute !important;
  inset: 0 auto auto 0 !important;
  transform: none !important;
  width: 40px;
  height: 24px;
}
.lt-sbl-toggle.switch .switch-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
/* แถวที่ปิดสวิตช์: หรี่ช่องตัวเลข (ยังแก้ได้ เก็บค่าไว้เปิดทีหลัง); 0 = ไม่จำกัด ไม่ใช้สีแดงแบบช่องต่อโพย */
.lt-sbl-num-table tr.is-off td.lt-sbl-num-val .form-control { opacity: 0.45; }
.lt-sbl-num-table tr.is-off td.lt-sbl-num-val .lt-sbl-cap { opacity: 0.45; }
.lt-sbl-num-table td.lt-sbl-num-val.is-unlimited .form-control { color: #8a80a0; }
.lt-sbl-num-table td.lt-sbl-num-val .lt-sbl-cap { min-height: 0.95rem; }
/* ชิปสถานะในรายการ (เฉพาะสมาชิก) */
.lt-sbl-numchip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.2rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.6;
  background: rgba(138, 128, 160, 0.14);
  color: #8a80a0;
  white-space: nowrap;
}
.lt-sbl-numchip.is-on { background: rgba(109, 91, 208, 0.12); color: #6d5bd0; }
.lt-sbl-numchip i { font-size: 0.6rem; }
/* จอแคบ: คอลัมน์ชื่อหวย (ตรึงซ้าย) ต้องแคบลง ไม่งั้นกินพื้นที่จนช่องตัวเลขโผล่แค่เศษเดียว */
@media (max-width: 767.98px) {
  .lt-sbl-table > thead th:first-child,
  .lt-sbl-table > tbody > tr > td:first-child { width: 126px; min-width: 126px; max-width: 126px; }
  .lt-sbl-lotcell { min-width: 0; gap: 0.35rem; }
  .lt-sbl-lotcell .lt-bp-flag { width: 26px; height: 26px; border-radius: 8px; }
  .lt-sbl-lotcell .lt-bp-flag img { max-width: 20px; }
  .lt-sbl-lot { white-space: normal; font-size: 0.78rem; line-height: 1.2; }
  .lt-sbl-all-title { white-space: normal; font-size: 0.8rem; line-height: 1.2; }
  .lt-sbl-all-hint { white-space: normal; line-height: 1.25; }
  .lt-sbl-table .form-control { min-width: 84px; }
  .lt-sbl-wrap { max-height: min(56vh, 640px); }
}

/* ===== /user/setting/keepHoldShares: ตั้งค่าบังคับสู้ ===== */
/* รายการ/โมดัลใช้ component ของ /user/setting/betLimit (.lt-sbl-*) ร่วมกัน — ที่นี่มีเฉพาะส่วนต่าง: "ขั้นต่ำ" (ต่ำกว่าไม่ได้) + คอลัมน์ "บังคับกับ" */
.lt-kh-floor { margin-top: 0.85rem; }
.lt-kh-floor .lt-prc-ceil.is-none b { color: #8a80a0; font-weight: 700; }
/* คำอธิบาย "บังคับกับ" ในโมดัล */
.lt-kh-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.75rem;
  margin: 0.25rem 0 0.5rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #8a80a0;
}
.lt-kh-hint b { color: var(--lt-ink); font-weight: 800; }
.lt-kh-hint i { font-style: normal; font-weight: 700; color: #6d5bd0; }
.lt-kh-modal .modal-xl { max-width: min(1280px, calc(100vw - 1.5rem)); }
/* คอลัมน์ "บังคับกับ" — select ของสคริปต์หลักมี style="width:100px" ติดมา */
.lt-kh-table td.lt-kh-cat { vertical-align: middle; }
.lt-kh-table td.lt-kh-cat .form-select { width: 100% !important; min-width: 128px; font-weight: 700; }
.lt-kh-table td.lt-kh-cat .form-select.is-all {
  border-color: rgba(109, 91, 208, 0.55) !important;
  background-color: rgba(109, 91, 208, 0.06);
  color: #6d5bd0;
}
/* ช่อง type=number: ซ่อนปุ่มลูกศร (ตอน focus จะโผล่มาดันตัวเลข) */
.lt-kh-table input[type="number"]::-webkit-inner-spin-button,
.lt-kh-table input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.lt-kh-table input[type="number"] { -moz-appearance: textfield; }
/* ต่ำกว่าขั้นต่ำที่เรารับมา = แดง (server ปฏิเสธด้วย 1140; ปุ่มบันทึกถูกกันไว้ใน renderer) */
.lt-kh-table td.is-low .form-control {
  border-color: rgba(240, 62, 82, 0.65) !important;
  background: rgba(240, 62, 82, 0.06);
  color: var(--lt-chili);
}
.lt-kh-table td.is-low .lt-sbl-cap b { color: var(--lt-chili); }
.lt-kh-table td.is-low .lt-sbl-cap b::after { content: " !"; }

/* ===== /user/assistant: ผู้ช่วย ===== */
/* เมนู "จัดการ" ของหน้านี้: แก้ไข (ปุ่ม .btn-update) — ชื่อคลาสซ้ำกับปุ่มเต็มของ keepHoldShares/betLimit
   จึงผูกกับ .lt-as-list เท่านั้น (ไอคอน text-warning ได้สีจากกฎกลางอยู่แล้ว) */
.lt-as-list .dropdown-item.btn-update::after { content: "ชื่อ / เบอร์โทร / สิทธิการใช้งาน"; }
/* อักษรย่อของผู้ช่วย — ใช้สีฟ้าต่างจากสมาชิก (ม่วง) ให้รู้ว่าเป็นบัญชีหลังบ้าน */
.lt-as-list .lt-mb-avatar { background: linear-gradient(135deg, #2ba7c9, #1f7fa8); }
/* ชิปสิทธิ์ในรายการ */
.lt-as-permwrap { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.lt-as-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.lt-as-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #1f7fa8;
  background: rgba(43, 167, 201, 0.1);
  border: 1.5px solid rgba(43, 167, 201, 0.28);
  white-space: nowrap;
}
.lt-as-chip i { font-size: 0.7rem; }
.lt-as-chip.is-none { color: #8a80a0; background: #f7f5fb; border-style: dashed; border-color: var(--lt-line); }
.lt-as-permcount { font-size: 0.72rem; font-weight: 700; color: #8a80a0; }
.lt-as-permcount::before { content: "สิทธิ์ "; font-weight: 600; color: #b0a7c4; }
.lt-as-permcount.is-all { color: var(--lt-leaf); }
.lt-as-permcount.is-none { color: var(--lt-chili); }
.lt-as-card-perms { margin-top: 0.6rem; }

/* โหมดตาราง: ผู้ใช้ | สิทธิ์ | สมัคร | เข้าล่าสุด | สถานะ | จัดการ
   (เขียนเป็น .lt-bp-table.lt-as-table ใน @media เดียวกับ .lt-mb-table ไม่งั้นเทมเพลต 5 คอลัมน์ของ .lt-mb-table ทับ) */
@media (min-width: 992px) {
  .lt-bp-table.lt-as-table {
    grid-template-columns: minmax(200px, 1.4fr) minmax(230px, 1.7fr) repeat(2, minmax(140px, 0.9fr)) max-content max-content;
    column-gap: 1rem;
    padding-inline: 0.5rem;
  }
  .lt-as-table .lt-bp-head span:nth-child(2) { text-align: start; }
  .lt-as-table .lt-bp-head span:nth-child(3),
  .lt-as-table .lt-bp-head span:nth-child(4),
  .lt-as-table .lt-bp-head span:nth-child(5) { text-align: center; }
  .lt-as-table .lt-bp-stats .lt-bd-stat { text-align: center; }
  /* วันที่กับเวลาอยู่บรรทัดเดียวกัน */
  .lt-as-table .lt-bd-stat b { white-space: nowrap; }
  @supports not (grid-template-columns: subgrid) {
    .lt-as-table .lt-bp-head,
    .lt-as-table .lt-bp-row {
      grid-template-columns: minmax(200px, 1.4fr) minmax(230px, 1.7fr) repeat(2, minmax(140px, 0.9fr)) max-content max-content;
    }
  }
}
@media (max-width: 991.98px) {
  /* มีชิ้น "สิทธิ์" เพิ่มจากหน้ารายชื่อผู้ใช้ -> ประกาศ areas เองให้ครบ (ปุ่ม ⋮ มุมขวาบนเหมือนหน้าอื่น) */
  .lt-as-table .lt-bp-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "main status action"
      "perms perms perms"
      "stats stats stats";
    row-gap: 0.5rem;
  }
  .lt-as-table .lt-as-permwrap { grid-area: perms; }
  .lt-as-table .lt-mb-status { grid-area: status; justify-content: flex-end; }
  .lt-as-table .lt-bp-stats {
    grid-area: stats;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }
  .lt-as-table .lt-bp-actions { grid-area: action; }
}

/* โมดัลเพิ่ม/แก้ไขผู้ช่วย (2 ขั้น: ข้อมูลบัญชี -> สิทธิการใช้งาน) */
.lt-as-modal .modal-lg { max-width: min(860px, calc(100vw - 1.5rem)); }
.lt-as-section {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.25rem 0 0.65rem;
}
.lt-as-step {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
  background-image: linear-gradient(135deg, var(--lt-chili), #f0602c);
}
.lt-as-section-title { font-weight: 800; color: var(--lt-ink); font-size: 0.95rem; }
.lt-as-perm-count { font-size: 0.76rem; font-weight: 700; color: var(--lt-leaf); }
.lt-as-perm-count.is-none { color: var(--lt-chili); }
.lt-as-perm-all {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1.5px solid var(--lt-line);
  background: #fff;
  color: var(--lt-ink);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}
.lt-as-perm-all:hover { border-color: var(--lt-ink); }
.lt-as-help { display: block; margin-top: 0.35rem; font-size: 0.74rem; color: #8a80a0; line-height: 1.35; }
.lt-as-pwhint { background: #f7f5fb; border-style: dashed; }
.lt-as-pwhint .lt-as-help { margin-top: 0.15rem; }
.lt-as-default,
.lt-as-locked {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  white-space: nowrap;
}
.lt-as-default { color: #d97706; background: rgba(217, 119, 6, 0.1); }
.lt-as-locked { color: #8a80a0; background: #efecf5; }
.lt-as-locked i { font-size: 0.62rem; color: inherit; }
/* การ์ดสิทธิ์ (label ครอบ checkbox ที่ซ่อนไว้ -> กดได้ทั้งใบ) */
.lt-as-perms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.55rem;
}
.lt-as-perm {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  padding: 0.65rem 0.75rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
}
.lt-as-perm:hover { border-color: #b9b2c9; }
.lt-as-perm.is-on {
  border-color: rgba(14, 159, 110, 0.5);
  background: rgba(14, 159, 110, 0.06);
  box-shadow: 0 2px 8px rgba(14, 159, 110, 0.12);
}
.lt-as-perm-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.lt-as-perm-ico {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: #7a7090;
  background: #f3f0f8;
}
.lt-as-perm.is-on .lt-as-perm-ico { color: #fff; background: linear-gradient(135deg, #12b981, #0e9f6e); }
.lt-as-perm-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.lt-as-perm-body b { font-size: 0.9rem; font-weight: 800; color: var(--lt-ink); line-height: 1.2; }
.lt-as-perm-body small { font-size: 0.74rem; color: #8a80a0; line-height: 1.3; }
.lt-as-perm.is-on .lt-as-perm-body b { color: var(--lt-leaf); }
.lt-as-perm-check {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--lt-line);
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  color: transparent;
  background: #fff;
}
.lt-as-perm.is-on .lt-as-perm-check { color: #fff; background: var(--lt-leaf); border-color: var(--lt-leaf); }
.lt-as-perm-input:focus-visible ~ .lt-as-perm-check { box-shadow: 0 0 0 3px rgba(14, 159, 110, 0.25); }
.lt-as-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: rgba(109, 91, 208, 0.07);
  border: 1.5px dashed rgba(109, 91, 208, 0.3);
  font-size: 0.78rem;
  color: #5a5170;
  line-height: 1.4;
}
.lt-as-note i { color: #6d5bd0; margin-top: 0.15rem; }
/* หัวโมดัลแก้ไข: ผู้ช่วยที่กำลังแก้ */
.lt-as-who { display: inline-flex; align-items: center; gap: 0.45rem; }
.lt-as-who:empty::before { content: "แก้ชื่อ เบอร์โทร Line ID และเมนูที่อนุญาต"; }
.lt-as-who-avatar {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #2ba7c9, #1f7fa8);
}
.lt-as-who b { color: var(--lt-ink); font-weight: 800; }

/* ═══════════════════════════════════════════════════════════════
   /transaction/report (รายงานการเงิน) — ช่องตัวเลขว่างในแถวสรุปยกเลิกรอบ (ไม่มียอดก่อน/หลัง)
   ═══════════════════════════════════════════════════════════════ */
.lt-tx-row .lt-bd-stat b.lt-tx-blank,
.lt-tx-card .lt-bd-stat b.lt-tx-blank { color: #b5adc4; font-weight: 500; }

/* ===== /transaction: ฝาก/ถอน (theme2) ===== */
/* บรรทัดย่อยใต้การ์ดสรุป เช่น "12 รายการ" */
.lt-dw-kpi-sub { font-size: 0.74rem; color: #8a80a0; margin-top: 0.15rem; min-height: 1.2em; }
/* บรรทัดย่อยใต้ KPI (จำนวนรายการ/นับคน) จองความสูงไว้ตั้งแต่ยังว่าง — เดิม :empty ซ่อนไว้ พอค่ามาถึงการ์ดทั้งแถวสูงขึ้น 1 บรรทัด ทำให้หน้าขยับ */
.lt-dw-kpi-sub:empty::before { content: "\00a0"; }

/* ป้ายระดับข้างชื่อผู้ใช้ */
.lt-dw-role,
.lt-dw-off {
  display: inline-block;
  margin-inline-start: 0.4rem;
  vertical-align: 2px;
  border-radius: 999px;
  padding: 0.08rem 0.5rem;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.lt-dw-role { background: rgba(109, 91, 208, 0.12); color: #6d5bd0; }
.lt-dw-role.is-agent { background: rgba(14, 159, 110, 0.12); color: var(--lt-leaf); }
.lt-dw-off { background: rgba(240, 62, 82, 0.1); color: var(--lt-chili); }

/* ยอดเงินคงเหลือของแถว */
.lt-dw-credit { min-width: 0; }
.lt-dw-credit-label { display: block; font-size: 0.7rem; color: #7a7090; line-height: 1.25; }
.lt-dw-credit b {
  display: block;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--lt-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.lt-dw-credit.is-zero b { color: #8a80a0; }

/* ปุ่ม ฝาก / ถอน / ประวัติ */
.lt-dw-actions { display: flex; gap: 0.4rem; flex-wrap: nowrap; }
.lt-dw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1.5px solid transparent;
  /* ไล่สี + เส้นขอบ -> ต้องมี ไม่งั้นปลายปุ่มมีจุดสีเพี้ยน (เช็คลิสต์ข้อ 8) */
  background-origin: border-box;
  background-repeat: no-repeat;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}
.lt-dw-btn i { font-size: 0.72rem; }
.lt-dw-btn.is-dep {
  color: #fff;
  background-image: linear-gradient(135deg, #12b981, #0e9f6e);
  box-shadow: 0 3px 8px rgba(14, 159, 110, 0.28);
}
.lt-dw-btn.is-dep:hover { filter: brightness(1.05); color: #fff; }
.lt-dw-btn.is-wd {
  color: var(--lt-chili);
  border-color: rgba(240, 62, 82, 0.45);
  background-color: rgba(240, 62, 82, 0.06);
}
.lt-dw-btn.is-wd:hover { background-color: rgba(240, 62, 82, 0.12); border-color: var(--lt-chili); }
.lt-dw-btn.is-hist { color: var(--lt-ink); border-color: var(--lt-line); background-color: #fff; }
.lt-dw-btn.is-hist:hover { border-color: #b9b2c9; }

/* โหมดตาราง: ผู้ใช้ | ยอดเงินคงเหลือ | ทำรายการ */
.lt-dw-table .lt-bp-row { border-radius: 10px; transition: background-color 0.12s ease; }
.lt-dw-table .lt-bp-row:hover { background: rgba(43, 33, 64, 0.035); }
@media (min-width: 992px) {
  .lt-bp-table.lt-dw-table {
    grid-template-columns: minmax(240px, 2fr) minmax(170px, 1fr) max-content;
    column-gap: 1.25rem;
    padding-inline: 0.5rem;
  }
  .lt-dw-table .lt-bp-head span:nth-child(2),
  .lt-dw-table .lt-bp-head span:nth-child(3) { text-align: end; }
  .lt-dw-table .lt-dw-credit { text-align: end; }
  @supports not (grid-template-columns: subgrid) {
    .lt-dw-table .lt-bp-head,
    .lt-dw-table .lt-bp-row { grid-template-columns: minmax(240px, 2fr) minmax(170px, 1fr) max-content; }
  }
}
@media (max-width: 991.98px) {
  /* กฎกลางแจก grid-area ให้ main/status/action/stats เท่านั้น — ชิ้น "ยอดเงิน" ของหน้านี้ต้องประกาศเอง
     ไม่งั้นถูกวางอัตโนมัติไปเบียดปุ่ม (เช็คลิสต์ข้อ 7); ปุ่ม 3 ปุ่มเรียงเต็มความกว้างใต้ชื่อ */
  .lt-dw-table .lt-bp-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main credit"
      "action action";
  }
  .lt-dw-table .lt-dw-credit { grid-area: credit; text-align: end; }
  .lt-dw-table .lt-dw-actions {
    grid-area: action;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    padding-top: 0.2rem;
  }
}

/* โหมดการ์ด */
.lt-dw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.75rem;
}
.lt-dw-card {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  padding: 0.85rem 0.9rem;
  overflow: hidden;
}
.lt-dw-card > .lt-ticket-band {
  position: absolute;
  inset: 0 0 auto 0;
  background: linear-gradient(90deg, #8b7ae8, #6d5bd0);
}
.lt-dw-card.is-agent > .lt-ticket-band { background: linear-gradient(90deg, #12b981, #0e9f6e); }
.lt-dw-card-head { margin-top: 0.15rem; }
.lt-dw-card .lt-dw-credit {
  margin-top: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: var(--lt-canvas);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.lt-dw-card .lt-dw-credit-label,
.lt-dw-card .lt-dw-credit b { display: inline; }
.lt-dw-card .lt-dw-credit b { font-size: 1.15rem; }
.lt-dw-card .lt-dw-actions {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

/* ── โมดัลฝาก/ถอน ── */
.lt-dw-dialog { max-width: 520px; }
.lt-dw-form { display: flex; flex-direction: column; min-height: 0; }
.lt-dw-modal.is-dep .lt-ticket-band { background: linear-gradient(90deg, #12b981, #0e9f6e); }
.lt-dw-modal.is-wd .lt-ticket-band { background: linear-gradient(90deg, #f36d7f, var(--lt-chili)); }
.lt-dw-modal-title { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.lt-dw-modal-ico {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.95rem;
}
.lt-dw-modal.is-dep .lt-dw-modal-ico { background: linear-gradient(135deg, #12b981, #0e9f6e); }
.lt-dw-modal.is-wd .lt-dw-modal-ico { background: linear-gradient(135deg, #f36d7f, var(--lt-chili)); }
/* ปุ่มยืนยันสีตามประเภท (ไล่สี + เส้นขอบโปร่ง -> background-origin ถูกตั้งไว้แล้วในกฎกลางของ .lt-set-save) */
.lt-dw-modal.is-dep .lt-set-save { background: linear-gradient(115deg, #12b981, #0e9f6e); box-shadow: 0 4px 12px rgba(14, 159, 110, 0.28); }
.lt-dw-modal.is-wd .lt-set-save { background: linear-gradient(115deg, var(--lt-chili), #f0602c); }

/* การ์ดสมาชิกที่กำลังทำรายการ */
.lt-dw-who {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  background: var(--lt-canvas);
  margin-bottom: 0.75rem;
}
.lt-dw-who-info { flex: 1; min-width: 0; }
.lt-dw-who-name { font-weight: 800; color: var(--lt-ink); line-height: 1.25; }
.lt-dw-who-full { font-size: 0.76rem; color: var(--lt-ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-dw-who-credit { flex: none; text-align: end; }
.lt-dw-who-credit span { display: block; font-size: 0.68rem; color: #7a7090; }
.lt-dw-who-credit b { font-size: 1.02rem; font-weight: 800; color: var(--lt-ink); font-variant-numeric: tabular-nums; }

/* ช่องยอดเงินตัวใหญ่ — ล็อก padding/เส้นขอบทั้งปกติและ focus (เช็คลิสต์ข้อ 9) */
.lt-dw-amount-field { margin-bottom: 0.6rem; }
.lt-dw-amount { position: relative; }
.lt-dw-cur {
  position: absolute;
  inset-inline-start: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  font-weight: 800;
  color: #b0a7c4;
  pointer-events: none;
}
.lt-dw-amount .form-control,
.lt-dw-amount .form-control:focus {
  height: 56px !important;
  padding: 0.5rem 0.9rem 0.5rem 2.2rem !important;
  border-width: 1.5px !important;
  border-radius: 14px !important;
  font-size: 1.45rem !important;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: end;
}
.lt-dw-amount .form-control::placeholder { color: #c9c2d6; font-weight: 700; }

/* ชิปยอดเร็ว */
.lt-dw-quick { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.lt-dw-quick button {
  border: 1.5px solid var(--lt-line);
  background: #fff;
  color: var(--lt-ink);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.lt-dw-quick button:hover { border-color: #b9b2c9; background: var(--lt-canvas); }
.lt-dw-quick button.is-clear { color: #8a80a0; }
.lt-dw-quick button.is-all { color: var(--lt-chili); border-color: rgba(240, 62, 82, 0.45); }

/* พรีวิวยอดหลังทำรายการ + สถิติในโมดัลประวัติ (ใช้ .lt-dw-stat ร่วมกัน) */
.lt-dw-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.lt-dw-stat {
  border: 1.5px solid var(--lt-line);
  border-radius: 12px;
  padding: 0.5rem 0.7rem;
  background: #fff;
  min-width: 0;
}
.lt-dw-stat span { display: block; font-size: 0.7rem; color: #7a7090; line-height: 1.25; }
.lt-dw-stat b { display: block; font-size: 1rem; font-weight: 800; color: var(--lt-ink); font-variant-numeric: tabular-nums; }
.lt-dw-stat small { display: block; font-size: 0.68rem; color: #8a80a0; }
.lt-dw-stat.is-bad { border-color: rgba(240, 62, 82, 0.55); background: rgba(240, 62, 82, 0.05); }
.lt-dw-stat.is-bad b { color: var(--lt-chili); }
.lt-dw-stat.is-dep b { color: var(--lt-leaf); }
.lt-dw-stat.is-wd b { color: #d97706; }
.lt-dw-stat.is-neg b { color: var(--lt-chili); }
.lt-dw-stat.is-net b { color: #14748f; }
.lt-dw-warn {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--lt-chili);
}

/* ── โมดัลประวัติ ── */
.lt-dw-hist-user { color: var(--lt-chili); }
.lt-dw-hist-modal .lt-rpt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; }
.lt-dw-hist-modal .lt-rpt-meta .lt-dw-role { margin-inline-start: 0; }
.lt-dw-hist-credit { color: var(--lt-ink); font-weight: 700; }
/* ชิป + สรุป ต้องอยู่เหนือ chrome ของ DataTable (chrome บน = order 1 ตามกฎ .lt-list-body) */
.lt-dw-hist-tools { order: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.6rem; }
.lt-dw-hist-sum { order: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 0.6rem; }
.lt-dw-hist-sum:empty { display: none; }
.lt-dw-hist-modal .lt-chip { padding: 0.25rem 0.75rem; font-size: 0.78rem; }
.lt-dw-hist-modal .lt-chip i { font-size: 0.65rem; margin-inline-end: 0.3rem; }
.lt-dw-hist-modal .lt-chip.is-dep.active { background: var(--lt-leaf); border-color: var(--lt-leaf); }
.lt-dw-hist-modal .lt-chip.is-wd.active { background: var(--lt-chili); border-color: var(--lt-chili); }
/* ค้นหาของ DataTable ใช้กับ endpoint นี้ไม่ได้ (server ไม่รับ) และ processing ของเทมเพลตทับรายการ */
.lt-dw-hist-modal .dt-search,
.lt-dw-hist-modal .dt-processing { display: none !important; }
.lt-dw-loading { padding: 1.5rem 0; text-align: center; color: #8a80a0; font-weight: 600; }
.lt-dw-hrow {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "ico main amt"
    "ico bal bal";
  align-items: center;
  column-gap: 0.65rem;
  row-gap: 0.2rem;
  padding: 0.65rem 0.25rem;
}
.lt-dw-hrow + .lt-dw-hrow { border-top: 2px dashed rgba(43, 33, 64, 0.12); }
.lt-dw-hico {
  grid-area: ico;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.85rem;
  align-self: start;
}
.lt-dw-hrow.is-dep .lt-dw-hico { background: linear-gradient(135deg, #12b981, #0e9f6e); }
.lt-dw-hrow.is-wd .lt-dw-hico { background: linear-gradient(135deg, #f36d7f, var(--lt-chili)); }
.lt-dw-hmain { grid-area: main; min-width: 0; }
.lt-dw-htitle { font-weight: 700; color: var(--lt-ink); line-height: 1.25; }
.lt-dw-hmeta { font-size: 0.74rem; color: var(--lt-ink-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.35rem; }
.lt-dw-hmeta .lt-mb-time { margin-inline-start: 0; }
.lt-dw-hcode { background: var(--lt-canvas); border-radius: 6px; padding: 0.05rem 0.4rem; font-size: 0.68rem; font-weight: 600; }
.lt-dw-hamt { grid-area: amt; font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: end; }
.lt-dw-hrow.is-dep .lt-dw-hamt { color: var(--lt-leaf); }
.lt-dw-hrow.is-wd .lt-dw-hamt { color: var(--lt-chili); }
.lt-dw-hbal {
  grid-area: bal;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: #7a7090;
  font-variant-numeric: tabular-nums;
}
.lt-dw-hbal i { font-size: 0.65rem; color: #b0a7c4; }
@media (min-width: 768px) {
  .lt-dw-hrow {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "ico main bal amt";
    column-gap: 0.9rem;
  }
  .lt-dw-hbal { justify-content: flex-end; }
}
@media (max-width: 575.98px) {
  .lt-dw-hist-sum { grid-template-columns: 1fr; }
  .lt-dw-preview { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   หน้าประกาศ company (/news รายการ, /news/create, /news/update/:id) — theme2 ก.ย. 2026
   รายการ: ตาราง #table ซ่อนเป็น data source → .lt-nw-table (แถว .lt-bp-row.lt-nw-row) / การ์ด .lt-nw-card
   switch ปักหมุด/แจ้งเตือน/สถานะ เป็น element เดิมของ news.js ที่ถูก "ย้าย" มา (คลาส .pin/.popup/.is-active)
   ═══════════════════════════════════════════════════════════════ */
/* ตัวกรอง 2 กลุ่ม (สถานะ | ระดับ) */
.lt-nw-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.lt-nw-filters .lt-chip-filter + .lt-chip-filter {
  padding-inline-start: 1rem;
  border-inline-start: 2px dashed rgba(43, 33, 64, 0.14);
}
@media (max-width: 575.98px) {
  .lt-nw-filters .lt-chip-filter + .lt-chip-filter { padding-inline-start: 0; border-inline-start: 0; }
}

/* ไอคอนประกาศ + ชื่อ + วันที่ */
.lt-nw-ico {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1rem;
  background: linear-gradient(135deg, #8b7ae8, #6d5bd0);
}
.lt-nw-row.is-pin .lt-nw-ico,
.lt-nw-card.is-pin .lt-nw-ico { background: linear-gradient(135deg, var(--lt-marigold), #d97706); }
.lt-nw-row.is-inactive .lt-nw-ico,
.lt-nw-card.is-inactive .lt-nw-ico { background: #c9c2d6; }
.lt-nw-row.is-inactive .lt-bp-title,
.lt-nw-card.is-inactive .lt-bp-title { color: #8a80a0; }
.lt-nw-row .lt-bp-meta,
.lt-nw-card .lt-bp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; font-variant-numeric: tabular-nums; }
.lt-nw-row .lt-bp-meta i,
.lt-nw-card .lt-bp-meta i { color: #b0a7c4; }
.lt-nw-ago { color: #b0a7c4; }
.lt-nw-ago::before { content: "·"; margin-inline-end: 0.3rem; }

/* ป้ายระดับ */
.lt-nw-role { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.lt-nw-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  line-height: 1.3;
  white-space: nowrap;
}
.lt-nw-chip[data-role="agent"] { background: rgba(14, 159, 110, 0.12); color: #0b7a55; }
.lt-nw-chip[data-role="member"] { background: rgba(43, 167, 201, 0.14); color: #1c7d97; }
.lt-nw-chip-none { background: #f3f0f8; color: #b9b2c9; }

/* สวิตช์ 3 ตัว (ป้ายชื่อ + switch + สถานะ) — บนจอกว้างซ่อนป้ายชื่อเพราะมีหัวคอลัมน์แล้ว */
.lt-nw-toggle { display: flex; align-items: center; gap: 0.45rem; }
.lt-nw-toggle-label,
.lt-nw-toggle-state { font-size: 0.78rem; font-weight: 700; white-space: nowrap; color: #8a80a0; }
.lt-nw-toggle.is-on .lt-nw-toggle-state { color: var(--lt-leaf); }
.lt-nw-toggle[data-kind="pin"].is-on .lt-nw-toggle-state { color: #d97706; }
/* .switch ของเทมเพลตกว้าง 0 แล้ววาดสไลเดอร์แบบ absolute → ล็อกกล่องให้เท่าตัวสไลเดอร์ (เหมือน .lt-mb-status) */
.lt-nw-toggle .switch {
  position: relative;
  display: inline-block;
  margin: 0 !important;
  padding: 0 !important;
  flex: none;
  width: 40px !important;
  min-width: 40px !important;
  height: 24px;
}
.lt-nw-toggle .switch .switch-toggle-slider {
  position: absolute !important;
  inset: 0 !important;
  margin: 0 !important;
}

/* โหมดตาราง: ประกาศ | ระดับ | ปักหมุด | แจ้งเตือน | สถานะ | จัดการ */
.lt-nw-table .lt-bp-row { border-radius: 10px; transition: background-color 0.12s ease; }
.lt-nw-table .lt-bp-row:hover { background: rgba(43, 33, 64, 0.035); }
@media (min-width: 992px) {
  .lt-bp-table.lt-nw-table {
    grid-template-columns: minmax(260px, 2.4fr) max-content repeat(3, max-content) max-content;
    column-gap: 1.1rem;
    padding-inline: 0.5rem;
  }
  .lt-nw-table .lt-nw-toggles { display: contents; }
  .lt-nw-table .lt-bp-head span:nth-child(n + 2) { text-align: center; }
  .lt-nw-table .lt-nw-role,
  .lt-nw-table .lt-nw-toggle { justify-self: center; }
  .lt-nw-table .lt-nw-toggle-label { display: none; }
  @supports not (grid-template-columns: subgrid) {
    .lt-nw-table .lt-bp-head,
    .lt-nw-table .lt-bp-row {
      grid-template-columns: minmax(260px, 2.4fr) max-content repeat(3, max-content) max-content;
      column-gap: 1.1rem;
    }
  }
}
@media (max-width: 991.98px) {
  /* แถวนี้มี "ป้ายระดับ" และ "สวิตช์ 3 ตัว" เพิ่มจากชิ้นมาตรฐาน → ประกาศ areas ใหม่ทั้งชุด
     คงปุ่ม ⋮ ไว้มุมขวาบนเหมือนหน้าอื่น */
  .lt-nw-table .lt-bp-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main action"
      "role role"
      "toggles toggles";
    row-gap: 0.45rem;
  }
  .lt-nw-table .lt-nw-role { grid-area: role; padding-inline-start: calc(40px + 0.6rem); }
  .lt-nw-table .lt-nw-toggles {
    grid-area: toggles;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    padding-top: 0.45rem;
    border-top: 1px dashed rgba(43, 33, 64, 0.12);
  }
  .lt-nw-table .lt-nw-toggle-state { display: none; }
  .lt-nw-table .lt-bp-actions { grid-area: action; }
}

/* โหมดการ์ด */
.lt-nw-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
}
.lt-nw-card {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  padding: 0.85rem 0.9rem;
  overflow: visible;
}
.lt-nw-card.is-pin { border-color: rgba(255, 176, 32, 0.55); }
.lt-nw-card.is-inactive { background: #faf9fc; }
.lt-nw-card > .lt-ticket-band {
  position: absolute;
  inset: 0 0 auto 0;
  border-start-start-radius: 16px;
  border-start-end-radius: 16px;
}
.lt-nw-card-head { display: flex; align-items: flex-start; gap: 0.6rem; }
.lt-nw-card-role { margin-top: 0.55rem; padding-inline-start: calc(40px + 0.6rem); }
.lt-nw-card-toggles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.65rem;
  padding-top: 0.6rem;
  border-top: 2px dashed rgba(43, 33, 64, 0.12);
}
.lt-nw-card-toggles .lt-nw-toggle {
  flex-direction: column;
  gap: 0.3rem;
  text-align: center;
  background: #f7f5fb;
  border-radius: 12px;
  padding: 0.45rem 0.3rem;
}
.lt-nw-card-toggles .lt-nw-toggle-state { font-size: 0.72rem; }
.lt-nw-card-foot { margin-top: 0.7rem; }
.lt-nw-card-foot .btn,
.lt-nw-card-foot .dropdown { width: 100%; }
.lt-nw-card .dropdown-menu { z-index: 1056; }

/* เมนูจัดการ: สี + คำอธิบาย (จำกัดขอบเขตที่ #ltNewsList เพราะ .btn-delete/.lt-mi-edit ใช้ในหน้าอื่นด้วย) */
.lt-list-body .dropdown-item.lt-nw-preview > i { background: linear-gradient(135deg, #2ba7c9, #38b6d9); }
.lt-list-body .dropdown-item.lt-nw-preview::after { content: "ดูแบบที่สมาชิกเห็น"; }
.lt-list-body .dropdown-item.lt-nw-preview.is-busy { opacity: 0.6; pointer-events: none; }
#ltNewsList .dropdown-item.lt-mi-edit::after { content: "แก้ไขชื่อ / เนื้อหา / การแสดงผล"; }
#ltNewsList .dropdown-item.btn-delete::after { content: "ลบประกาศนี้ออกถาวร"; }

/* โมดัลตัวอย่างประกาศ (การ์ด .lt-news-card ชุดเดียวกับหน้า member) */
.lt-nw-preview-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.7rem; }
.lt-nw-ptag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  background: #f3f0f8;
  color: #7a7090;
}
.lt-nw-ptag i { font-size: 0.7rem; }
.lt-nw-ptag.is-on { background: rgba(14, 159, 110, 0.12); color: #0b7a55; }
.lt-nw-ptag.is-off { background: rgba(240, 62, 82, 0.1); color: var(--lt-chili); }
.lt-nw-preview-empty { color: #b9b2c9; font-style: italic; margin: 0; }
#ltNwPreviewBody .lt-news-body img { max-width: 100%; height: auto; }

/* ── ฟอร์มเพิ่ม/แก้ไขประกาศ ── */
.lt-nw-form-grid { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); }
@media (max-width: 767.98px) {
  .lt-nw-form-grid { grid-template-columns: minmax(0, 1fr); }
}
.lt-nw-rolepick { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.lt-nw-rolepick .lt-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.42rem 0.95rem; cursor: pointer; }
.lt-nw-rolepick .lt-chip i { font-size: 0.75rem; opacity: 0.8; }
.lt-nw-role-hint { font-size: 0.75rem; color: #8a80a0; margin-top: 0.45rem; }
.lt-nw-role-hint.is-warn { color: var(--lt-chili); font-weight: 700; }
.lt-nw-role-hint:empty { display: none; }

.lt-nw-opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}
.lt-nw-opt {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  padding: 0.65rem 0.8rem;
  background: #fff;
  margin: 0;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.lt-nw-opt:hover { border-color: #c9c2d6; }
.lt-nw-opt.is-on { border-color: rgba(14, 159, 110, 0.45); background: rgba(14, 159, 110, 0.05); }
.lt-nw-opt-pin.is-on { border-color: rgba(255, 176, 32, 0.6); background: rgba(255, 176, 32, 0.07); }
.lt-nw-opt-ico {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.9rem;
  background: #c9c2d6;
}
.lt-nw-opt-pin.is-on .lt-nw-opt-ico { background: linear-gradient(135deg, var(--lt-marigold), #d97706); }
.lt-nw-opt-popup.is-on .lt-nw-opt-ico { background: linear-gradient(135deg, var(--lt-chili), #f0602c); }
.lt-nw-opt-active.is-on .lt-nw-opt-ico { background: linear-gradient(135deg, #12b981, #0e9f6e); }
.lt-nw-opt-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.lt-nw-opt-name { font-weight: 700; font-size: 0.9rem; color: var(--lt-ink); line-height: 1.3; }
.lt-nw-opt-desc { font-size: 0.74rem; color: #8a80a0; line-height: 1.35; }
.lt-nw-opt-state { flex: none; font-size: 0.74rem; font-weight: 700; color: #b9b2c9; white-space: nowrap; }
.lt-nw-opt.is-on .lt-nw-opt-state { color: var(--lt-leaf); }
.lt-nw-opt-pin.is-on .lt-nw-opt-state { color: #d97706; }
.lt-nw-opt .lt-tgl { flex: none; }
@media (max-width: 575.98px) {
  .lt-nw-opt-state { display: none; }
}

.lt-nw-editor .tox-tinymce {
  border: 1.5px solid var(--lt-line) !important;
  border-radius: 14px !important;
}
.lt-nw-editor .tox .tox-edit-area::before { border-color: var(--lt-chili) !important; border-radius: 0 !important; }

.lt-nw-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}
.lt-nw-actions .lt-set-cancel {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.lt-nw-preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  font-weight: 600;
  padding: 0.55rem 1.2rem;
  border: 1.5px solid var(--lt-ink);
  background: #fff;
  color: var(--lt-ink);
  font-family: inherit;
  cursor: pointer;
}
.lt-nw-preview-btn:hover { background: var(--lt-ink); color: #fff; }
@media (max-width: 575.98px) {
  .lt-nw-actions > * { flex: 1 1 auto; justify-content: center; text-align: center; }
}

/* ═══════════════════════════════════════════════════════════════
   /actionLog: ประวัติการใช้งาน (theme2) — company เท่านั้น
   ตาราง #table ซ่อนเป็น data source → ไทม์ไลน์ (หัววัน .lt-al-day) โหมดตาราง .lt-al-table
   (แถว .lt-bp-row.lt-al-row) / การ์ด .lt-al-cards > .lt-al-card ; สีตาม data-kind
   (login / logout / bill / round) ; renderer: scripts/theme2/actionLog/index.js
   ═══════════════════════════════════════════════════════════════ */
/* บรรทัดย่อยใต้ตัวเลข KPI เช่น "12 ผู้ใช้ที่มีความเคลื่อนไหว" */
/* จองความสูงบรรทัดย่อยไว้เสมอ — เดิม :empty { display:none } ทำให้การ์ด KPI หดตอนโหลด (ตัวหมุน) แล้วยืดตอนตัวเลขมา ทั้งหน้าจึงขยับ
   ตัวเลขหลัก .lt-kpi-val จองไว้แล้วด้วย min-height + ตัวหมุน position:absolute */
.lt-al-kpi-sub { font-size: 0.74rem; color: #8a80a0; margin-top: 0.15rem; min-height: 1.1em; line-height: 1.1; }

/* ตัวกรอง 2 กลุ่ม (เหตุการณ์ | ระดับ) */
.lt-al-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.lt-al-filters .lt-chip-filter + .lt-chip-filter {
  padding-inline-start: 1rem;
  border-inline-start: 2px dashed rgba(43, 33, 64, 0.14);
}
.lt-al-filters .lt-chip i { font-size: 0.72rem; margin-inline-end: 0.35rem; opacity: 0.85; }
@media (max-width: 575.98px) {
  .lt-al-filters .lt-chip-filter + .lt-chip-filter { padding-inline-start: 0; border-inline-start: 0; }
}

/* หัววันของไทม์ไลน์ (กินเต็มแถวทั้งในกริดตารางและกริดการ์ด) */
.lt-al-day {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.9rem 0 0.35rem;
  padding: 0 0.25rem;
  font-size: 0.8rem;
  color: #8a80a0;
}
.lt-al-day:first-child { margin-top: 0.25rem; }
.lt-al-day i { color: #b0a7c4; }
.lt-al-day-title { font-weight: 800; color: var(--lt-ink); font-size: 0.86rem; }
.lt-al-day-sub::before { content: "·"; margin-inline-end: 0.35rem; }
.lt-al-day::after {
  content: "";
  flex: 1;
  height: 0;
  border-top: 2px dashed rgba(43, 33, 64, 0.12);
  margin-inline-start: 0.35rem;
}

/* ไอคอนเหตุการณ์ */
.lt-al-ico {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1rem;
  background: var(--lt-ink);
}
[data-kind="login"] .lt-al-ico { background: linear-gradient(135deg, #12b981, #0e9f6e); }
[data-kind="logout"] .lt-al-ico { background: linear-gradient(135deg, #b9b2c9, #8a80a0); }
[data-kind="bill"] .lt-al-ico { background: linear-gradient(135deg, #f36d7f, var(--lt-chili)); }
[data-kind="round"] .lt-al-ico { background: linear-gradient(135deg, var(--lt-marigold), #d97706); }
.lt-al-row .lt-bp-meta,
.lt-al-card .lt-bp-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  font-variant-numeric: tabular-nums;
}
.lt-al-row .lt-bp-meta i,
.lt-al-card .lt-bp-meta i { color: #b0a7c4; }
.lt-al-ago { color: #b0a7c4; }

/* ── auditLog (agent, ก.ย. 2026): ผู้ทำ → ผู้ถูกทำ (.lt-al-parties), ประโยคสรุป (.lt-al-sum), ปุ่มดูค่าที่เปลี่ยน (.lt-al-chg),
   สีไอคอนตามหมวด (data-kind = category / fail) และตาราง ก่อน→หลัง ในโมดัล #modalAuditDetail (.lt-al-diff)
   company ยังไม่ใช้ (renderer ของ company เป็นรูปเดิม) — ใส่ไว้ให้ซิงก์กัน ── */
[data-kind="auth"] .lt-al-ico { background: linear-gradient(135deg, #12b981, #0e9f6e); }
[data-kind="user"] .lt-al-ico { background: linear-gradient(135deg, #8b7ae8, #6d5bd0); }
[data-kind="setting"] .lt-al-ico { background: linear-gradient(135deg, var(--lt-marigold), #d97706); }
[data-kind="transaction"] .lt-al-ico { background: linear-gradient(135deg, #2ba7c9, #1c7d97); }
[data-kind="lottery"] .lt-al-ico { background: linear-gradient(135deg, var(--lt-marigold), #d97706); }
[data-kind="news"] .lt-al-ico { background: linear-gradient(135deg, #b9b2c9, #8a80a0); }
[data-kind="fail"] .lt-al-ico { background: linear-gradient(135deg, #f36d7f, var(--lt-chili)); }
.lt-al-parties { display: flex; align-items: center; gap: 0.45rem; min-width: 0; flex-wrap: wrap; }
.lt-al-parties .lt-al-user { flex: 0 1 auto; }
.lt-al-arrow { font-size: 0.7rem; color: #b0a7c4; flex: none; }
.lt-al-parties .is-target .lt-al-avatar { box-shadow: 0 0 0 2px rgba(240, 62, 82, 0.25); }
.lt-al-sum { color: var(--lt-ink); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; white-space: normal; }
.lt-al-chg {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1.5px solid rgba(43, 33, 64, 0.15);
  background: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--lt-ink);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.lt-al-chg:hover { border-color: var(--lt-chili); color: var(--lt-chili); }
.lt-al-chg.is-plain { color: #8a80a0; }
.lt-al-chg i { font-size: 0.68rem; }
.lt-al-card .lt-al-detail { padding-top: 0.55rem; border-top: 1px dashed rgba(43, 33, 64, 0.12); }
@media (max-width: 991.98px) {
  /* ผู้ทำ → ผู้ถูกทำ กว้างกว่าช่อง "user" เดิม (auto) จนคอลัมน์ main เหลือ 0 → ให้ parties กินเต็มแถวใต้เหตุการณ์
     (specificity สูงกว่ากฎ areas ของ .lt-al-table .lt-bp-row ที่อยู่ถัดลงไปในไฟล์) */
  .lt-al-table .lt-bp-row.lt-al-row {
    grid-template-areas:
      "main main"
      "user user"
      "detail detail"
      "dev ip";
  }
  .lt-al-table .lt-al-parties { grid-area: user; justify-self: start; padding-inline-start: calc(40px + 0.6rem); }
  .lt-al-table .lt-al-parties .lt-al-userinfo { align-items: flex-start; }
  .lt-al-table .lt-al-parties .lt-al-uname { max-width: 32vw; }
}
.lt-al-ad-summary { font-weight: 700; color: var(--lt-ink); background: #f3f0f8; border-radius: 10px; padding: 0.55rem 0.8rem; margin-bottom: 0.75rem; overflow-wrap: anywhere; }
.lt-al-ad-section { margin-top: 0.9rem; }
.lt-al-ad-head { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; font-weight: 800; color: #7a7090; letter-spacing: 0.02em; margin-bottom: 0.4rem; }
.lt-al-ad-head i { color: #b0a7c4; }
.lt-al-ad-count { font-weight: 600; color: #b0a7c4; }
.lt-al-diff { display: flex; flex-direction: column; gap: 0.3rem; }
.lt-al-diff-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(43, 33, 64, 0.1);
  font-size: 0.82rem;
}
.lt-al-diff-label { font-weight: 600; color: var(--lt-ink); overflow-wrap: anywhere; }
.lt-al-diff-before { color: #8a80a0; text-decoration: line-through; font-family: var(--lt-font-digit); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.lt-al-diff-after { color: var(--lt-leaf); font-weight: 800; font-family: var(--lt-font-digit); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.lt-al-diff-arrow { font-size: 0.65rem; color: #b0a7c4; }
@media (max-width: 575.98px) {
  .lt-al-diff-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .lt-al-diff-label { grid-column: 1 / -1; }
}
.lt-al-ago::before { content: "·"; margin-inline-end: 0.3rem; }

/* ผู้ใช้: อักษรย่อ + ชื่อ + ป้ายระดับ */
.lt-al-user { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.lt-al-avatar {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.82rem;
  color: #fff;
  background: linear-gradient(135deg, #8b7ae8, #6d5bd0);
}
.lt-al-avatar[data-role="agent"] { background: linear-gradient(135deg, #12b981, #0e9f6e); }
.lt-al-avatar[data-role="member"] { background: linear-gradient(135deg, #2ba7c9, #14748f); }
.lt-al-avatar[data-role="company"] { background: var(--lt-chrome); }
.lt-al-avatar[data-role="assistant"] { background: linear-gradient(135deg, #b9b2c9, #8a80a0); }
.lt-al-userinfo { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.lt-al-uname { font-weight: 700; color: var(--lt-ink); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-al-role {
  align-self: flex-start;
  border-radius: 999px;
  padding: 0.06rem 0.5rem;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  background: #f3f0f8;
  color: #8a80a0;
}
.lt-al-role[data-role="company"] { background: rgba(240, 62, 82, 0.1); color: var(--lt-chili); }
.lt-al-role[data-role="assistant"] { background: rgba(43, 33, 64, 0.08); color: #5f5675; }
.lt-al-role[data-role="agent"] { background: rgba(14, 159, 110, 0.12); color: #0b7a55; }
.lt-al-role[data-role="member"] { background: rgba(43, 167, 201, 0.14); color: #1c7d97; }

/* รายละเอียด: เลขโพย / ชื่อหวย + งวด */
.lt-al-detail { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; font-size: 0.85rem; }
.lt-al-code {
  align-self: flex-start;
  font-family: var(--lt-font-digit);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--lt-chili);
  background: rgba(240, 62, 82, 0.08);
  border-radius: 8px;
  padding: 0.15rem 0.55rem;
  white-space: nowrap;
}
.lt-al-round { font-weight: 700; color: var(--lt-ink); }
.lt-al-round-sub { font-size: 0.78rem; color: #7a7090; }
.lt-al-none { color: #c9c2d6; font-weight: 600; }

/* อุปกรณ์/เบราว์เซอร์ — เป็นปุ่ม กดแล้วเปิดโมดัลรายละเอียด */
.lt-al-dev {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  min-width: 0;
  border: 1.5px solid transparent;
  background: transparent;
  border-radius: 12px;
  padding: 0.25rem 0.45rem 0.25rem 0.25rem;
  margin: -0.25rem 0;
  font-family: inherit;
  text-align: start;
  color: var(--lt-ink);
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.lt-al-dev:hover { border-color: rgba(43, 33, 64, 0.15); background: #fff; }
.lt-al-dev-ico {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #f3f0f8;
  color: #7a7090;
  font-size: 0.85rem;
}
.lt-al-dev-info { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.lt-al-dev-main { font-weight: 700; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-al-dev-sub { font-size: 0.74rem; color: #8a80a0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-al-dev-arrow { font-size: 0.6rem; color: #c9c2d6; margin-inline-start: 0.1rem; }
.lt-al-dev:hover .lt-al-dev-arrow { color: var(--lt-chili); }

/* IP */
.lt-al-ip { min-width: 0; }
.lt-al-ip-val {
  display: inline-block;
  max-width: 100%;
  font-family: var(--lt-font-digit);
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  font-weight: 600;
  color: #5f5675;
  background: #f3f0f8;
  border-radius: 8px;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* โหมดตาราง: เหตุการณ์ | ผู้ใช้ | รายละเอียด | อุปกรณ์ | IP */
.lt-al-table .lt-bp-row { border-radius: 10px; transition: background-color 0.12s ease; }
.lt-al-table .lt-bp-row:hover { background: rgba(43, 33, 64, 0.035); }
/* แถวแรกหลังหัววันไม่ต้องมีเส้นคั่น (หัววันมีเส้นของตัวเองแล้ว) */
.lt-al-table .lt-al-day + .lt-bp-row { border-top: 0; }
@media (min-width: 992px) {
  .lt-bp-table.lt-al-table {
    grid-template-columns: minmax(200px, 1.5fr) minmax(170px, 1.2fr) minmax(130px, 1fr) minmax(190px, 1.4fr) minmax(110px, 0.8fr);
    column-gap: 1rem;
    padding-inline: 0.5rem;
  }
  .lt-al-table .lt-bp-head,
  .lt-al-table .lt-bp-row { column-gap: 1rem; }
  .lt-al-table .lt-bp-head span:last-child,
  .lt-al-table .lt-al-ip { text-align: end; }
  @supports not (grid-template-columns: subgrid) {
    .lt-al-table .lt-bp-head,
    .lt-al-table .lt-bp-row {
      grid-template-columns: minmax(200px, 1.5fr) minmax(170px, 1.2fr) minmax(130px, 1fr) minmax(190px, 1.4fr) minmax(110px, 0.8fr);
    }
  }
}
@media (max-width: 991.98px) {
  /* แถวนี้ไม่มี status/stats มาตรฐาน → ประกาศ areas เอง: เหตุการณ์+ผู้ใช้ / รายละเอียด / อุปกรณ์+IP */
  .lt-al-table .lt-bp-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main user"
      "detail detail"
      "dev ip";
    row-gap: 0.45rem;
    column-gap: 0.75rem;
    align-items: center;
  }
  .lt-al-table .lt-al-user { grid-area: user; justify-self: end; }
  .lt-al-table .lt-al-user .lt-al-userinfo { align-items: flex-end; }
  .lt-al-table .lt-al-user .lt-al-uname { max-width: 40vw; }
  .lt-al-table .lt-al-detail { grid-area: detail; padding-inline-start: calc(40px + 0.6rem); }
  .lt-al-table .lt-al-detail.is-none { display: none; }
  .lt-al-table .lt-al-dev { grid-area: dev; }
  .lt-al-table .lt-al-ip { grid-area: ip; justify-self: end; }
  .lt-al-table .lt-al-dev,
  .lt-al-table .lt-al-ip { padding-top: 0.45rem; border-top: 1px dashed rgba(43, 33, 64, 0.12); }
  .lt-al-table .lt-al-dev { margin: 0; align-self: stretch; }
  .lt-al-table .lt-al-ip { align-self: stretch; display: flex; align-items: center; }
}

/* โหมดการ์ด */
.lt-al-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.75rem;
}
.lt-al-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: #fff;
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  padding: 0.85rem 0.9rem 0.85rem 1.05rem;
  overflow: hidden;
}
.lt-al-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--lt-ink);
}
.lt-al-card[data-kind="login"]::before { background: #0e9f6e; }
.lt-al-card[data-kind="logout"]::before { background: #b9b2c9; }
.lt-al-card[data-kind="bill"]::before { background: var(--lt-chili); }
.lt-al-card[data-kind="round"]::before { background: var(--lt-marigold); }
.lt-al-card .lt-al-user { padding-top: 0.55rem; border-top: 1px dashed rgba(43, 33, 64, 0.12); }
.lt-al-card .lt-al-detail { padding-inline-start: calc(32px + 0.5rem); }
.lt-al-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(43, 33, 64, 0.12);
}
.lt-al-card-foot .lt-al-dev { margin: 0; min-width: 0; }
.lt-al-card-foot .lt-al-ip { flex: none; max-width: 45%; }

/* โมดัลรายละเอียดอุปกรณ์ */
.lt-al-ua-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
}
.lt-al-ua-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  background: #f8f6fb;
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
}
.lt-al-ua-label { font-size: 0.72rem; color: #8a80a0; display: inline-flex; align-items: center; gap: 0.35rem; }
.lt-al-ua-label i { color: #b0a7c4; font-size: 0.7rem; }
.lt-al-ua-val { font-size: 0.92rem; color: var(--lt-ink); overflow-wrap: anywhere; }
.lt-al-ua-rawwrap { margin-top: 0.75rem; }
.lt-al-ua-rawhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 700;
  color: #8a80a0;
  margin-bottom: 0.3rem;
}
.lt-al-ua-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1.5px solid var(--lt-line);
  background: #fff;
  color: var(--lt-ink);
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
}
.lt-al-ua-copy:hover { border-color: var(--lt-ink); }
.lt-al-ua-copy.is-done { border-color: var(--lt-leaf); color: var(--lt-leaf); }
.lt-al-ua-raw {
  display: block;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #5f5675;
  background: #f3f0f8;
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ═══════════════════════════════════════════════════════════════
   /lottery/groupCategory — ประเภทหวย (theme2, ก.ย. 2026)
   แถว/การ์ดใช้ --lt-accent = สีประจำกลุ่ม (bgColor) ที่สมาชิกเห็นจริง; สีขาว = ไม่ตั้ง → ใช้สีธีม
   ═══════════════════════════════════════════════════════════════ */
.lt-gc-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.lt-gc-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #8a80a0;
}
.lt-gc-hint i { color: #b0a7c4; }
.lt-gc-chip-count {
  display: inline-block;
  min-width: 1.5em;
  margin-inline-start: 0.4rem;
  padding: 0 0.4em;
  border-radius: 999px;
  background: rgba(43, 33, 64, 0.08);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.55;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.lt-gc-chip-count:empty { display: none; }
.lt-chip.active .lt-gc-chip-count { background: rgba(255, 255, 255, 0.22); }
/* helper ของหน้านี้คืนทุกกลุ่มทีเดียว (ไม่แบ่งหน้า) → chrome ของ DataTable ไม่มีความหมาย ซ่อนทั้งชุด */
.lt-gc-source table,
.lt-gc-source .dt-length,
.lt-gc-source .dt-info,
.lt-gc-source .dt-paging,
.lt-gc-source .dt-search,
.lt-gc-source .dataTables_length,
.lt-gc-source .dataTables_info,
.lt-gc-source .dataTables_paginate { display: none !important; }

/* ชิ้นส่วนร่วมของแถว/การ์ด */
.lt-gc-row,
.lt-gc-card,
.lt-gc-sort-item { --lt-accent: var(--lt-chili); }
.lt-gc-flag {
  background: var(--lt-accent, var(--lt-chili));
  color: #fff;
  font-size: 1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.lt-gc-flag.is-theme { background: var(--lt-chrome); }
.lt-gc-code {
  display: inline-block;
  font-family: var(--lt-font-digit);
  font-size: 0.72rem;
  font-weight: 700;
  color: #7a7090;
  background: #f3f0f8;
  border-radius: 6px;
  padding: 0 0.4rem;
  margin-inline-end: 0.35rem;
}
.lt-gc-custom-tag {
  display: inline-block;
  margin-inline-start: 0.4rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: #b45309;
  background: rgba(255, 176, 32, 0.16);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  vertical-align: middle;
  line-height: 1.5;
}
.lt-gc-colors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.lt-gc-color-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--lt-font-digit);
  font-size: 0.78rem;
  font-weight: 700;
  color: #5f5675;
  background: #fff;
  border: 1.5px solid var(--lt-line);
  border-radius: 999px;
  padding: 0.18rem 0.65rem 0.18rem 0.25rem;
  white-space: nowrap;
}
.lt-gc-color-chip i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c, #fff);
  border: 1px solid rgba(43, 33, 64, 0.15);
}
.lt-gc-color-chip.is-theme i { background: var(--lt-chrome); border-color: transparent; }
.lt-gc-color-chip.is-theme { color: #8a80a0; }
.lt-gc-color-dots { display: inline-flex; gap: 3px; align-items: center; }
.lt-gc-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c, #fff);
  border: 1px solid rgba(43, 33, 64, 0.15);
}
/* สวิตช์เปิด/ปิด (ย้ายมาจากตาราง) — ล็อกกล่อง .switch ของเทมเพลตให้เท่าสไลเดอร์ เหมือน .lt-nw-toggle */
.lt-gc-toggle { display: flex; align-items: center; gap: 0.45rem; }
.lt-gc-toggle-state { font-size: 0.78rem; font-weight: 700; white-space: nowrap; color: #8a80a0; }
.lt-gc-toggle.is-on .lt-gc-toggle-state { color: var(--lt-leaf); }
.lt-gc-toggle .switch {
  position: relative;
  display: inline-block;
  margin: 0 !important;
  padding: 0 !important;
  flex: none;
  width: 40px !important;
  min-width: 40px !important;
  height: 24px;
}
.lt-gc-toggle .switch .switch-toggle-slider {
  position: absolute !important;
  inset: 0 !important;
  margin: 0 !important;
}
.lt-gc-order-badge {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 28px;
  padding: 0 0.5rem;
  border-radius: 9px;
  background: #f3f0f8;
  color: var(--lt-ink);
  font-weight: 800;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* โหมดตาราง: ประเภทหวย | สีประจำกลุ่ม | สถานะ | ลำดับ | จัดการ */
.lt-gc-table .lt-bp-row { border-radius: 10px; transition: background-color 0.12s ease; }
.lt-gc-table .lt-bp-row:hover { background: rgba(43, 33, 64, 0.035); }
.lt-gc-row.is-inactive .lt-bp-title,
.lt-gc-card.is-inactive .lt-bp-title { color: #8a80a0; }
.lt-gc-row.is-inactive .lt-gc-flag,
.lt-gc-card.is-inactive .lt-gc-flag { opacity: 0.5; }
@media (min-width: 992px) {
  .lt-bp-table.lt-gc-table {
    grid-template-columns: minmax(240px, 2fr) minmax(170px, max-content) max-content max-content max-content;
    column-gap: 1.1rem;
    padding-inline: 0.5rem;
  }
  .lt-gc-table .lt-bp-head span:nth-child(n + 3) { text-align: center; }
  .lt-gc-table .lt-gc-status,
  .lt-gc-table .lt-gc-order { justify-self: center; }
  @supports not (grid-template-columns: subgrid) {
    .lt-gc-table .lt-bp-head,
    .lt-gc-table .lt-bp-row {
      grid-template-columns: minmax(240px, 2fr) minmax(170px, max-content) max-content max-content max-content;
      column-gap: 1.1rem;
    }
  }
}
@media (max-width: 991.98px) {
  /* แถวนี้มี "สี" / "สถานะ" / "ลำดับ" เพิ่มจากชิ้นมาตรฐาน → ประกาศ areas ใหม่ทั้งชุด (ปุ่ม ⋮ มุมขวาบนเหมือนหน้าอื่น) */
  .lt-gc-table .lt-bp-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main action"
      "colors colors"
      "status order";
    row-gap: 0.45rem;
  }
  .lt-gc-table .lt-gc-colors { grid-area: colors; padding-inline-start: calc(40px + 0.6rem); }
  .lt-gc-table .lt-gc-status { grid-area: status; padding-inline-start: calc(40px + 0.6rem); }
  .lt-gc-table .lt-gc-order { grid-area: order; justify-self: end; }
  .lt-gc-table .lt-bp-actions { grid-area: action; }
}

/* โหมดการ์ด */
.lt-gc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.lt-gc-card {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  padding: 0.95rem 0.9rem 0.85rem;
  overflow: visible; /* เมนู "จัดการ" ต้องไม่ถูกการ์ดตัด */
}
.lt-gc-card.is-inactive { background: #faf9fc; }
.lt-gc-card > .lt-ticket-band {
  position: absolute;
  inset: 0 0 auto 0;
  border-start-start-radius: 16px;
  border-start-end-radius: 16px;
}
.lt-gc-card-head { display: flex; align-items: flex-start; gap: 0.6rem; }
.lt-gc-card-head .lt-bp-main { flex: 1; min-width: 0; }
.lt-gc-card-head .lt-gc-order { flex: none; }
.lt-gc-card-colors { margin-top: 0.6rem; padding-inline-start: calc(40px + 0.6rem); }
.lt-gc-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 2px dashed rgba(43, 33, 64, 0.12);
}
.lt-gc-card .dropdown-menu { z-index: 1056; }

/* เมนูจัดการ: สี + คำอธิบาย (จำกัดที่ #ltGcList — .btn-update ใช้ในหน้าอื่นด้วย) */
#ltGcList .dropdown-item.btn-update > i { background: linear-gradient(135deg, #ffc857, var(--lt-marigold)); }
#ltGcList .dropdown-item.btn-update::after { content: "เปลี่ยนชื่อที่แสดง / สีประจำกลุ่ม"; }
#ltGcList .dropdown-item.lt-gc-open-sort > i { background: linear-gradient(135deg, #8b7ae8, #6d5bd0); }
#ltGcList .dropdown-item.lt-gc-open-sort::after { content: "ย้ายตำแหน่งกลุ่มนี้ในหน้าสมาชิก"; }

/* ── โมดัลแก้ไขชื่อ/สี ── */
.lt-gc-modal .modal-content { --lt-accent: var(--lt-chili); }
.lt-gc-modal-flag {
  background: var(--lt-accent, var(--lt-chili));
  color: #fff;
  font-size: 1rem;
  transition: background-color 0.15s ease;
}
.lt-gc-modal-flag.is-theme { background: var(--lt-chrome); }
.lt-gc-modal .lt-rpt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.lt-gc-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(250px, 0.85fr);
  gap: 0.9rem;
}
@media (max-width: 767.98px) {
  .lt-gc-edit-grid { grid-template-columns: minmax(0, 1fr); }
}
.lt-gc-edit-col { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.lt-gc-field-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  color: #8a80a0;
  margin-top: 0.45rem;
}
.lt-gc-field-hint b { color: var(--lt-ink); font-weight: 700; }
.lt-gc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 0;
  background: transparent;
  padding: 0 0.2rem;
  color: var(--lt-chili);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: underline dotted;
  cursor: pointer;
}
.lt-gc-link i { font-size: 0.7rem; }
.lt-gc-link:hover { color: #c92d3f; }

.lt-gc-color-main {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  background: #fff;
}
.lt-gc-color-slot { flex: none; display: grid; place-items: center; }
/* ปุ่มของ Pickr (แทนที่ div ที่ mount) — ขยายและปรับมุมให้เข้าธีม; ::before = ลายโปร่งใส ::after = สีที่เลือก */
.lt-gc-color-slot .pcr-button {
  width: 48px !important;
  height: 48px !important;
  padding: 0 !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 8px rgba(43, 33, 64, 0.18) !important;
  cursor: pointer;
}
.lt-gc-color-slot .pcr-button::before,
.lt-gc-color-slot .pcr-button::after { border-radius: 14px !important; }
.lt-gc-color-text { min-width: 0; flex: 1; }
.lt-gc-color-name { font-weight: 700; color: var(--lt-ink); font-size: 0.92rem; }
.lt-gc-color-desc { font-size: 0.76rem; color: #8a80a0; line-height: 1.4; margin-top: 0.15rem; }
.lt-gc-swatches { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.6rem; }
.lt-gc-swatch-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--c, #fff);
  box-shadow: 0 0 0 1.5px rgba(43, 33, 64, 0.18);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.lt-gc-swatch-btn.is-theme { background: var(--lt-chrome); }
.lt-gc-swatch-btn:hover { transform: scale(1.12); }
.lt-gc-swatch-btn.active { box-shadow: 0 0 0 2.5px var(--lt-ink); }

.lt-gc-more {
  border: 1.5px dashed var(--lt-line);
  border-radius: 14px;
  padding: 0.55rem 0.85rem;
  background: #fff;
}
.lt-gc-more summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--lt-ink);
}
.lt-gc-more summary::-webkit-details-marker { display: none; }
.lt-gc-more summary > i { font-size: 0.7rem; color: #8a80a0; transition: transform 0.15s ease; }
.lt-gc-more[open] summary > i { transform: rotate(90deg); }
.lt-gc-more-note { font-size: 0.72rem; font-weight: 600; color: #b9b2c9; margin-inline-start: auto; }
.lt-gc-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
  margin-top: 0.7rem;
}
.lt-gc-color-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #f8f6fb;
  border-radius: 12px;
  padding: 0.5rem 0.6rem;
  min-width: 0;
}
.lt-gc-color-item .lt-gc-color-slot .pcr-button {
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 4px rgba(43, 33, 64, 0.16) !important;
}
.lt-gc-color-item .lt-gc-color-slot .pcr-button::before,
.lt-gc-color-item .lt-gc-color-slot .pcr-button::after { border-radius: 10px !important; }
.lt-gc-color-item-name { font-size: 0.8rem; font-weight: 700; color: var(--lt-ink); line-height: 1.25; }
.lt-gc-color-item-sub { font-size: 0.7rem; color: #8a80a0; }

/* พรีวิวแบบหน้าแทงหวยของสมาชิก (ยืมคลาส .lt-group-head/.lt-ticket ของ member) */
.lt-gc-preview-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #8a80a0;
}
.lt-gc-preview {
  background: var(--lt-canvas);
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  padding: 0.35rem 0.85rem 0.85rem;
}
.lt-gc-preview .lt-group-head { margin: 0.6rem 0 0.55rem; font-size: 1rem; }
.lt-gc-preview .lt-group-head > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lt-gc-preview-tickets {
  display: grid;
  grid-template-columns: minmax(0, 260px);
  gap: 0.6rem;
}
.lt-gc-preview .lt-ticket { pointer-events: none; }
.lt-gc-preview .lt-ticket-flag { width: 36px; height: 36px; color: var(--lt-ink-soft); font-size: 0.95rem; }
.lt-gc-preview .lt-ticket .lottery-name { font-size: 0.84rem !important; }
.lt-gc-preview .lt-countdown-chip { font-size: 0.7rem; }
.lt-gc-preview-note { font-size: 0.74rem; color: #8a80a0; line-height: 1.4; }
.lt-gc-preview-note:empty { display: none; }

/* ── โมดัลจัดลำดับ ── */
.lt-gc-sort {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.lt-gc-sort-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #fff;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  padding: 0.5rem 0.6rem;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.lt-gc-sort-item:active { cursor: grabbing; }
.lt-gc-sort-item.sortable-ghost { opacity: 0.35; border-style: dashed; }
.lt-gc-sort-item.sortable-chosen,
.lt-gc-sort-item.is-focus {
  border-color: var(--lt-ink);
  box-shadow: 0 6px 18px rgba(43, 33, 64, 0.14);
}
.lt-gc-sort-item.is-inactive .lt-gc-sort-name { color: #8a80a0; }
.lt-gc-sort-grip { flex: none; color: #c9c2d6; font-size: 0.9rem; }
.lt-gc-sort-num {
  flex: none;
  min-width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--lt-ink);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.lt-gc-sort-chip {
  flex: none;
  width: 11px;
  height: 24px;
  border-radius: 4px;
  background: var(--lt-accent, var(--lt-chili));
}
.lt-gc-sort-item.is-theme .lt-gc-sort-chip { background: var(--lt-chrome); }
.lt-gc-sort-name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  color: var(--lt-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lt-gc-sort-name small { font-weight: 600; font-size: 0.72rem; color: #b9b2c9; margin-inline-start: 0.4rem; }
.lt-gc-sort-btns { display: inline-flex; gap: 0.25rem; flex: none; }
.lt-gc-sort-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 9px;
  border: 1.5px solid var(--lt-line);
  background: #fff;
  color: var(--lt-ink);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  cursor: pointer;
}
.lt-gc-sort-btn:hover { border-color: var(--lt-ink); }
.lt-gc-sort-btn:disabled { opacity: 0.3; cursor: default; border-color: var(--lt-line); }
.lt-gc-sort-item.is-moved { animation: ltGcFlash 0.55s ease; }
@keyframes ltGcFlash {
  from { background: rgba(255, 176, 32, 0.28); }
  to { background: #fff; }
}
/* พรีวิวในโมดัลประเภทหวยเปลี่ยนสีตามที่เลือกแบบ real time — ใส่ transition ให้เห็นการเปลี่ยน */
.lt-gc-modal > .modal-dialog > .modal-content > .lt-ticket-band,
.lt-gc-preview .lt-ticket-band,
.lt-gc-preview .lt-group-chip,
.lt-gc-modal-flag { transition: background-color 0.18s ease; }

/* ═══════════════════════════════════════════════════════════════
   /lottery/category — รายการหวย (theme2, ก.ย. 2026)
   แถว/การ์ดใช้ --lt-accent = สีประจำกลุ่มของหวยตัวนั้นที่สมาชิกเห็นจริง (ว่าง = สีธีม)
   ═══════════════════════════════════════════════════════════════ */
.lt-lc-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.lt-lc-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #8a80a0;
}
.lt-lc-hint i { color: #b0a7c4; }
.lt-lc-chip-count {
  display: inline-block;
  min-width: 1.5em;
  margin-inline-start: 0.4rem;
  padding: 0 0.4em;
  border-radius: 999px;
  background: rgba(43, 33, 64, 0.08);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.55;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.lt-lc-chip-count:empty { display: none; }
.lt-chip.active .lt-lc-chip-count { background: rgba(255, 255, 255, 0.22); }

/* ชิ้นส่วนร่วมของแถว/การ์ด */
.lt-lc-row,
.lt-lc-card,
.lt-lc-sort-item { --lt-accent: var(--lt-chili); }
.lt-lc-flag { background: var(--lt-canvas); overflow: hidden; }
.lt-lc-flag img { max-width: 30px; max-height: 30px; height: auto; }
.lt-lc-flag i { color: var(--lt-ink-soft); }
.lt-lc-code {
  display: inline-block;
  font-family: var(--lt-font-digit);
  font-size: 0.72rem;
  font-weight: 700;
  color: #7a7090;
  background: #f3f0f8;
  border-radius: 6px;
  padding: 0 0.4rem;
  margin-inline-end: 0.35rem;
}
.lt-lc-own {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: #1c7d97;
  background: rgba(43, 167, 201, 0.14);
  border-radius: 6px;
  padding: 0 0.4rem;
  margin-inline-start: 0.35rem;
}
.lt-lc-custom-tag {
  display: inline-block;
  margin-inline-start: 0.4rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: #b45309;
  background: rgba(255, 176, 32, 0.16);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  vertical-align: middle;
  line-height: 1.5;
  white-space: nowrap;
}
.lt-lc-group { display: flex; align-items: center; min-width: 0; }
.lt-lc-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--lt-ink);
  background: #fff;
  border: 1.5px solid var(--lt-line);
  border-radius: 999px;
  padding: 0.18rem 0.7rem 0.18rem 0.35rem;
}
.lt-lc-group-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-lc-group-chip i {
  flex: none;
  width: 8px;
  height: 18px;
  border-radius: 3px;
  background: var(--lt-accent, var(--lt-chili));
}
.lt-lc-group-chip.is-theme i { background: var(--lt-chrome); }
/* สวิตช์เปิด/ปิด (ย้ายมาจากตาราง) — ล็อกกล่อง .switch ของเทมเพลตให้เท่าสไลเดอร์ */
.lt-lc-toggle { display: flex; align-items: center; gap: 0.45rem; }
.lt-lc-toggle-state { font-size: 0.78rem; font-weight: 700; white-space: nowrap; color: #8a80a0; }
.lt-lc-toggle.is-on .lt-lc-toggle-state { color: var(--lt-leaf); }
.lt-lc-toggle .switch {
  position: relative;
  display: inline-block;
  margin: 0 !important;
  padding: 0 !important;
  flex: none;
  width: 40px !important;
  min-width: 40px !important;
  height: 24px;
}
.lt-lc-toggle .switch .switch-toggle-slider {
  position: absolute !important;
  inset: 0 !important;
  margin: 0 !important;
}
.lt-lc-order-badge {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 28px;
  padding: 0 0.5rem;
  border-radius: 9px;
  background: #f3f0f8;
  color: var(--lt-ink);
  font-weight: 800;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* โหมดตาราง: หวย | ประเภทหวย | สถานะ | ลำดับ | จัดการ */
.lt-lc-table .lt-bp-row { border-radius: 10px; transition: background-color 0.12s ease; }
.lt-lc-table .lt-bp-row:hover { background: rgba(43, 33, 64, 0.035); }
.lt-lc-row.is-inactive .lt-bp-title,
.lt-lc-card.is-inactive .lt-bp-title { color: #8a80a0; }
.lt-lc-row.is-inactive .lt-lc-flag,
.lt-lc-card.is-inactive .lt-lc-flag { opacity: 0.5; filter: grayscale(0.6); }
@media (min-width: 992px) {
  .lt-bp-table.lt-lc-table {
    grid-template-columns: minmax(240px, 2fr) minmax(150px, max-content) max-content max-content max-content;
    column-gap: 1.1rem;
    padding-inline: 0.5rem;
  }
  .lt-lc-table .lt-bp-head span:nth-child(n + 3) { text-align: center; }
  .lt-lc-table .lt-lc-status,
  .lt-lc-table .lt-lc-order { justify-self: center; }
  @supports not (grid-template-columns: subgrid) {
    .lt-lc-table .lt-bp-head,
    .lt-lc-table .lt-bp-row {
      grid-template-columns: minmax(240px, 2fr) minmax(150px, max-content) max-content max-content max-content;
      column-gap: 1.1rem;
    }
  }
}
@media (max-width: 991.98px) {
  /* แถวนี้มี "ประเภท" / "สถานะ" / "ลำดับ" เพิ่มจากชิ้นมาตรฐาน → ประกาศ areas ใหม่ทั้งชุด (ปุ่ม ⋮ มุมขวาบนเหมือนหน้าอื่น) */
  .lt-lc-table .lt-bp-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main action"
      "group group"
      "status order";
    row-gap: 0.45rem;
  }
  .lt-lc-table .lt-lc-group { grid-area: group; padding-inline-start: calc(40px + 0.6rem); }
  .lt-lc-table .lt-lc-status { grid-area: status; padding-inline-start: calc(40px + 0.6rem); }
  .lt-lc-table .lt-lc-order { grid-area: order; justify-self: end; }
  .lt-lc-table .lt-bp-actions { grid-area: action; }
}

/* โหมดการ์ด */
.lt-lc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.lt-lc-card {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  padding: 0.95rem 0.9rem 0.85rem;
  overflow: visible; /* เมนู "จัดการ" ต้องไม่ถูกการ์ดตัด */
}
.lt-lc-card.is-inactive { background: #faf9fc; }
.lt-lc-card > .lt-ticket-band {
  position: absolute;
  inset: 0 0 auto 0;
  border-start-start-radius: 16px;
  border-start-end-radius: 16px;
}
.lt-lc-card-head { display: flex; align-items: flex-start; gap: 0.6rem; }
.lt-lc-card-head .lt-bp-main { flex: 1; min-width: 0; }
.lt-lc-card-head .lt-lc-order { flex: none; }
.lt-lc-card-group { margin-top: 0.6rem; padding-inline-start: calc(40px + 0.6rem); }
.lt-lc-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 2px dashed rgba(43, 33, 64, 0.12);
}
.lt-lc-card .dropdown-menu { z-index: 1056; }

/* เมนูจัดการ: สี + คำอธิบาย (จำกัดที่ #ltLcList — .btn-delete ใช้ในหน้าอื่นด้วย) */
#ltLcList .dropdown-item.lt-lc-edit > i { background: linear-gradient(135deg, #ffc857, var(--lt-marigold)); }
#ltLcList .dropdown-item.lt-lc-edit::after { content: "ชื่อ รูป รอบ อัตราจ่าย และตั้งค่าอื่น ๆ"; }
#ltLcList .dropdown-item.lt-lc-open-sort > i { background: linear-gradient(135deg, #8b7ae8, #6d5bd0); }
#ltLcList .dropdown-item.lt-lc-open-sort::after { content: "ย้ายตำแหน่งหวยตัวนี้ในหน้าสมาชิก"; }
#ltLcList .dropdown-item.btn-delete::after { content: "ลบหวยของบริษัทออกถาวร (ต้องไม่มีบิลค้าง)"; }

/* ── โมดัลจัดลำดับ ── */
.lt-lc-modal .modal-content { --lt-accent: var(--lt-chili); }
.lt-lc-modal-flag { background: var(--lt-chrome); color: #fff; font-size: 1rem; }
.lt-lc-sort-tools { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.lt-lc-sort-tools .lt-modal-search { margin-bottom: 0; }
.lt-lc-sort-groups .lt-chip { padding: 0.25rem 0.75rem; font-size: 0.78rem; }
.lt-lc-sort-note {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: #8a80a0;
  line-height: 1.4;
}
.lt-lc-sort-note i { margin-top: 0.15rem; color: #b0a7c4; }
.lt-lc-sort {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.lt-lc-sort-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #fff;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  padding: 0.5rem 0.6rem;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.lt-lc-sort-item:active { cursor: grabbing; }
.lt-lc-sort-item.sortable-ghost { opacity: 0.35; border-style: dashed; }
.lt-lc-sort-item.sortable-chosen,
.lt-lc-sort-item.is-focus {
  border-color: var(--lt-ink);
  box-shadow: 0 6px 18px rgba(43, 33, 64, 0.14);
}
.lt-lc-sort-item.is-inactive .lt-lc-sort-name > span { color: #8a80a0; }
.lt-lc-sort-item.is-inactive .lt-lc-sort-img { opacity: 0.5; filter: grayscale(0.6); }
.lt-lc-sort-grip { flex: none; color: #c9c2d6; font-size: 0.9rem; }
.lt-lc-sort-num {
  flex: none;
  min-width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--lt-ink);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.lt-lc-sort-img {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--lt-canvas);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--lt-ink-soft);
}
.lt-lc-sort-img img { max-width: 26px; max-height: 26px; height: auto; }
.lt-lc-sort-name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.5rem;
  font-weight: 700;
  color: var(--lt-ink);
}
.lt-lc-sort-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.lt-lc-sort-group {
  font-size: 0.7rem;
  font-weight: 700;
  color: #7a7090;
  background: #f3f0f8;
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  white-space: nowrap;
}
.lt-lc-sort-off { font-size: 0.7rem; font-weight: 600; color: #b9b2c9; white-space: nowrap; }
.lt-lc-sort-btns { display: inline-flex; gap: 0.25rem; flex: none; }
.lt-lc-sort-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 9px;
  border: 1.5px solid var(--lt-line);
  background: #fff;
  color: var(--lt-ink);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  cursor: pointer;
}
.lt-lc-sort-btn:hover { border-color: var(--lt-ink); }
.lt-lc-sort-btn:disabled { opacity: 0.3; cursor: default; border-color: var(--lt-line); }
.lt-lc-sort-item.is-moved { animation: ltLcFlash 0.55s ease; }
@keyframes ltLcFlash {
  from { background: rgba(255, 176, 32, 0.28); }
  to { background: #fff; }
}
@media (max-width: 575.98px) {
  .lt-lc-sort-group { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   /lottery/category/update/:id — แก้ไขหวย (theme2, ก.ย. 2026)
   ═══════════════════════════════════════════════════════════════ */
.lt-cu-head { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.lt-cu-head-img {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--lt-canvas);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.lt-cu-head-img img { max-width: 36px; max-height: 36px; height: auto; }
.lt-cu-head-text { min-width: 0; }
.lt-cu-head-text .lt-lc-code { margin-inline-end: 0.35rem; }
.lt-cu-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
  gap: 0.75rem;
  align-items: start;
}
@media (max-width: 767.98px) {
  .lt-cu-info-grid { grid-template-columns: minmax(0, 1fr); }
}
.lt-cu-field-hint {
  display: block;
  font-size: 0.74rem;
  color: #8a80a0;
  margin-top: 0.4rem;
  line-height: 1.4;
}
.lt-cu-field-hint i { margin-inline-end: 0.3rem; color: #b0a7c4; }
/* select ปกติ + select2 ที่สคริปต์หลักแปลงให้ ในช่องกรอกของหน้านี้ */
.lt-cu-select-field .form-select {
  border-radius: 12px !important;
  border: 1.5px solid var(--lt-line) !important;
  font-weight: 600;
}
.lt-cu-select-field .select2-container,
.lt-cu-field .select2-container { width: 100% !important; }
.lt-cu-select-field .select2-container--default .select2-selection--single,
.lt-cu-field .select2-container--default .select2-selection--single {
  border-radius: 12px !important;
  border: 1.5px solid var(--lt-line) !important;
  height: 38px;
  display: flex;
  align-items: center;
  background: #fff;
}
.lt-cu-select-field .select2-container--default .select2-selection--single .select2-selection__rendered,
.lt-cu-field .select2-container--default .select2-selection--single .select2-selection__rendered {
  font-weight: 600;
  color: var(--lt-ink);
  line-height: 1.2;
}
.lt-cu-select-field .select2-container--default .select2-selection--single .select2-selection__arrow,
.lt-cu-field .select2-container--default .select2-selection--single .select2-selection__arrow { top: 6px; }
.lt-cu-select-field .select2-container--default.select2-container--disabled .select2-selection--single { background: #f7f5fb; }
/* รูปหวย (dropify) */
.lt-cu-image .dropify-wrapper {
  border: 1.5px dashed var(--lt-line) !important;
  border-radius: 14px !important;
  background: #faf9fd !important;
}
.lt-cu-image .dropify-wrapper:hover { background: #f3f0f8 !important; }
.lt-cu-image .dropify-message span { font-size: 0.9rem !important; color: #8a80a0; }
.lt-cu-image .dropify-preview { background: #fff; }
.lt-cu-image.is-locked .dropify-wrapper { opacity: 0.6; }

/* ── แท็บวันที่เปิด/ปิดรับ ── */
.lt-cu-round-top {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.lt-cu-round-mode { flex: 1 1 260px; max-width: 380px; }
.lt-cu-warn {
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #b45309;
  background: rgba(255, 176, 32, 0.12);
  border: 1.5px solid rgba(217, 119, 6, 0.25);
  border-radius: 14px;
  padding: 0.6rem 0.8rem;
}
.lt-cu-warn i { flex: none; font-size: 1rem; }
.lt-cu-round-all {
  border: 1.5px dashed var(--lt-line);
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  background: #faf9fd;
  margin-bottom: 0.75rem;
}
.lt-cu-round-all-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--lt-ink);
  margin-bottom: 0.55rem;
}
.lt-cu-round-all-title i { color: var(--lt-chili); }
.lt-cu-round-all-title span { font-size: 0.74rem; font-weight: 600; color: #8a80a0; }
.lt-cu-round-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
  align-items: end;
}
.lt-cu-field { display: flex; flex-direction: column; gap: 0.25rem; margin: 0; min-width: 0; }
.lt-cu-field > span:first-child { font-size: 0.72rem; font-weight: 700; color: #8a80a0; white-space: nowrap; }
.lt-cu-field .form-control,
.lt-cu-field .form-select {
  border-radius: 10px !important;
  border: 1.5px solid var(--lt-line) !important;
  font-weight: 600;
  min-height: 38px;
}
.lt-cu-time {
  text-align: center;
  font-family: var(--lt-font-digit);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  background: #fff !important;
  color: var(--lt-ink) !important;
}
.lt-cu-field-switch { justify-content: flex-start; }
.lt-cu-field-switch .lt-tgl { margin-top: 0.3rem; }
.lt-cu-round-list { display: flex; flex-direction: column; gap: 0.5rem; }
.lt-cu-round-row {
  display: grid;
  grid-template-columns: 150px repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
  align-items: end;
  border: 1.5px solid var(--lt-line);
  border-radius: 14px;
  padding: 0.65rem 0.8rem;
  background: #fff;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.lt-cu-round-row:not(.is-on) .lt-cu-field:not(.lt-cu-field-create) { opacity: 0.55; }
.lt-cu-round-row.is-on { border-color: rgba(14, 159, 110, 0.4); background: rgba(14, 159, 110, 0.04); }
.lt-cu-round-row.is-new { animation: ltCuFlash 0.6s ease; }
@keyframes ltCuFlash {
  from { background: rgba(255, 176, 32, 0.25); }
  to { background: rgba(14, 159, 110, 0.04); }
}
.lt-cu-round-day { display: flex; align-items: center; gap: 0.5rem; align-self: center; color: var(--lt-ink); min-width: 0; }
.lt-cu-day-badge {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #c9c2d6;
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.lt-cu-round-row.is-on .lt-cu-day-badge { background: var(--lt-leaf); }
/* แถวระบุวัน: หัวแถว (ลำดับ + สรุป + ปุ่มลบ) เต็มความกว้าง แล้วตามด้วยช่อง 7 ช่อง */
.lt-cu-date-row { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.lt-cu-date-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--lt-ink);
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed rgba(43, 33, 64, 0.12);
}
.lt-cu-date-summary { font-size: 0.78rem; font-weight: 600; color: #8a80a0; }
.lt-cu-row-remove {
  margin-inline-start: auto;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1.5px solid var(--lt-line);
  background: #fff;
  color: var(--lt-chili);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}
.lt-cu-row-remove:hover { background: var(--lt-chili); border-color: var(--lt-chili); color: #fff; }
.lt-cu-add-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.7rem;
  border: 1.5px dashed var(--lt-ink);
  background: #fff;
  color: var(--lt-ink);
  border-radius: 999px;
  padding: 0.45rem 1.05rem;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}
.lt-cu-add-row:hover { background: var(--lt-ink); color: #fff; }
.lt-cu-date-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  color: #8a80a0;
  font-size: 0.85rem;
  padding: 1rem;
  border: 1.5px dashed var(--lt-line);
  border-radius: 14px;
}
.lt-cu-date-empty i { color: #b0a7c4; }
@media (max-width: 991.98px) {
  .lt-cu-round-row,
  .lt-cu-date-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lt-cu-round-day { grid-column: 1 / -1; }
  .lt-cu-field > span:first-child { white-space: normal; }
}

/* ── แท็บสีหน้าแทงหวย ── */
.lt-cu-color-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.lt-cu-color-top > div:first-child { flex: 1 1 260px; min-width: 0; }
.lt-cu-color-title { display: flex; align-items: center; gap: 0.45rem; font-weight: 700; color: var(--lt-ink); }
.lt-cu-color-title i { color: var(--lt-chili); }
.lt-cu-color-top .lt-copy-field { flex: 1 1 300px; max-width: 400px; }
.lt-cu-color-groups { display: flex; flex-direction: column; gap: 0.9rem; }
.lt-cu-color-group-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: #7a7090;
  margin: 0 0 0.5rem;
}
.lt-cu-color-group-title i { color: #b0a7c4; font-size: 0.8rem; }
.lt-cu-color-count { margin-inline-start: auto; font-size: 0.72rem; font-weight: 700; color: #b9b2c9; }
.lt-cu-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.6rem;
}
.lt-cu-color-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #f8f6fb;
  border-radius: 12px;
  padding: 0.5rem 0.6rem;
  min-width: 0;
}
.lt-cu-color-slot { flex: none; display: grid; place-items: center; }
.lt-cu-color-slot .pcr-button {
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 4px rgba(43, 33, 64, 0.16) !important;
  cursor: pointer;
}
.lt-cu-color-slot .pcr-button::before,
.lt-cu-color-slot .pcr-button::after { border-radius: 10px !important; }
.lt-cu-color-text { min-width: 0; }
.lt-cu-color-name { font-size: 0.8rem; font-weight: 700; color: var(--lt-ink); line-height: 1.25; }
.lt-cu-color-hex {
  font-family: var(--lt-font-digit);
  font-size: 0.72rem;
  font-weight: 700;
  color: #8a80a0;
  margin-top: 0.1rem;
}
.lt-cu-color-item.is-unset .lt-cu-color-hex,
.lt-cu-color-item.is-transparent .lt-cu-color-hex { color: #b9b2c9; font-style: italic; }
/* โหมดรายวันของหวยที่สคริปต์บันทึกไม่ส่ง "เปิดรับก่อนรอบ" (ทุกตัวยกเว้นหวยลาว 4 ตัว) → ซ่อนช่องนั้น ไม่ให้ตั้งค่าที่ไม่มีผล */
.lt-cu-no-minus .lt-cu-field-minus { display: none; }
.lt-cu-no-minus .lt-cu-round-row { grid-template-columns: 150px repeat(4, minmax(0, 1fr)); }
@media (max-width: 991.98px) {
  .lt-cu-no-minus .lt-cu-round-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.lt-cu-minus-note { margin: -0.25rem 0 0.75rem; }

/* ═══════════════════════════════════════════════════════════════
   ซ่อน scrollbar แนวตั้งของหน้าทั้งหมด — หน้ายังเลื่อนได้ด้วยล้อเมาส์/สัมผัส
   แต่ไม่มีแถบโผล่มาดัน UI ตอนเนื้อหายาวขึ้น; ความกว้าง scrollbar ที่ Bootstrap/เทมเพลตวัดได้จะเป็น 0
   จึงไม่มี padding ชดเชยตอนเปิดโมดัล (กฎเดียวกันทั้ง member/company/agent — แก้ต้องซิงก์)
   ═══════════════════════════════════════════════════════════════ */
html::-webkit-scrollbar {
  display: none; /* ซ่อน scrollbar (Chrome/Safari/Edge) */
}
html {
  -ms-overflow-style: none; /* IE + Edge old */
  scrollbar-width: none; /* Firefox */
}
body.modal-open { padding-right: 0 !important; }
/* SweetAlert2 (ทุก Swal.fire ที่มี backdrop รวม "กรุณารอสักครู่..") วัดความกว้างสกอลบาร์จาก div ทดสอบ (ได้ 15px เมื่อ macOS ต่อเมาส์ / Windows)
   แล้วใส่ padding-right ให้ body แบบ inline เพื่อชดเชยสกอลบาร์ที่มันคิดว่าหายไป — แต่สกอลบาร์ของหน้าถูกซ่อนอยู่แล้ว
   เนื้อหาทั้งหน้าจึงถูกดันไปซ้ายทุกครั้งที่เปิด → !important ชนะ inline style */
body.swal2-shown { padding-right: 0 !important; }

/* ชิปเลือกหวยที่ "เลือกอยู่" ต้องหน้าตาเดียวกันทั้งหน้า /lottery/round (ปุ่ม .lottery-category-item) และหน้าที่ใช้ partial
   (label .form-check-label-lottery-category เช่น /lottery/bill) — ของเดิมปุ่มบนหน้า round โดนสถานะ .btn ของ Bootstrap
   (hover/focus/active) ทับจนพื้นกลับเป็นขาว เหลือแต่ขอบกับติ๊ก จึงครอบทุกสถานะและระบุ background-color ตรง ๆ */
.lt-admin .lt-round-lots .lottery-category-item.btn-outline-success,
.lt-admin .lt-round-lots .lottery-category-item.btn-outline-success:hover,
.lt-admin .lt-round-lots .lottery-category-item.btn-outline-success:focus,
.lt-admin .lt-round-lots .lottery-category-item.btn-outline-success:focus-visible,
.lt-admin .lt-round-lots .lottery-category-item.btn-outline-success:active,
.lt-admin .lt-round-lots .lottery-category-item.btn-outline-success.active,
.lt-admin .lt-round-lots .form-check-lottery-category:checked + .form-check-label-lottery-category,
.lt-admin .lt-round-lots .form-check-lottery-category:checked + .form-check-label-lottery-category:hover {
  background-color: rgba(14, 159, 110, 0.12) !important;
  background-image: none !important;
  border-color: rgba(14, 159, 110, 0.6) !important;
  color: var(--lt-ink) !important;
  font-weight: 600;
  box-shadow: none !important;
}
.lt-admin .lt-round-lots .lottery-category-item.btn-outline-success .lt-lot-tick-i,
.lt-admin .lt-round-lots .form-check-lottery-category:checked + .form-check-label-lottery-category .lt-lot-tick-i {
  background: var(--lt-leaf) !important;
  color: #fff !important;
}

/* กล่องรายการหวยของ /lottery/round เลื่อนภายใน (max-height) — เมื่อรายการยาวเกินกล่อง ชิปแถวสุดท้ายจะชิดขอบล่างพอดี
   ดูเหมือนโดนตัด/เลื่อนไม่สุด (หน้าบิลรายการสั้นกว่าจึงไม่เห็น) → เผื่อพื้นที่ล่างไว้ในกล่องเลื่อน */
.lt-round-lots .lt-lot-groups {
  padding-bottom: 0.9rem;
  scroll-padding-bottom: 0.9rem;
}
.lt-round-lots .lt-lot-group:last-child { margin-bottom: 0.25rem; }

/* ===== แท็บกลุ่มหวยในแท็บ "เปิด/ปิดหวย" ของฟอร์มสมาชิก/เอเย่นต์ (ตัวกรองการ์ด .lt-mu-lot) — ซิงก์กับ agent ===== */
/* <ul> ถูกห่อด้วย div.nav-align-top — ใส่ระยะห่างที่ตัวห่อ (กฎ .lt-mu-groups + .lt-mu-lots ไม่โดน เพราะไม่ใช่พี่น้องกัน) */
.lt-mu-groups-wrap { margin: 0.9rem 0 1.1rem; }
.lt-mu-lot.lt-grp-hide { display: none !important; }

/* ===== ฟอร์มสร้าง/แก้ไขเมมเบอร์-เอเย่นต์: กันเลย์เอาต์ขยับ (agent + company ต้องเหมือนกัน) =====
   1) ป้าย "ยอดเงินสูงสุด" ใช้คลาส .user-credit ตัวเดียวกับ header — index.js ใส่สปินเนอร์ icon-20px ลง .user-credit ทุกตัว
      ทุกรอบรีเฟรชเครดิต ทำให้บรรทัดป้ายสูงขึ้นชั่วคราวแล้วช่องกรอกด้านล่างกระโดด → ล็อกสปินเนอร์ให้เท่าตัวอักษร + จองพื้นที่ไว้ */
.lt-form-label .user-credit {
  display: inline-block;
  min-width: 4.5rem;
  min-height: 1.3em;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.lt-form-label .user-credit .fa-spinner,
.lt-form-label .user-credit .icon-base,
.lt-form-label .user-credit .fa-spinner::before,
.lt-form-label .user-credit .icon-base::before {
  font-size: 1em !important;
  width: auto !important;
  height: auto !important;
  line-height: inherit !important;
}
.lt-form-label .user-credit .fa-spinner,
.lt-form-label .user-credit .icon-base { display: inline-block; vertical-align: baseline; }
/* 2) แถบชิปกลุ่มหวยในแท็บ ส่วนแบ่งหุ้น/อัตราจ่าย/แทงสูงสุด (ลูกตรงของ .tab-pane) ต้องเว้นจากกล่อง/ตารางข้างล่าง
      (แท็บเปิด/ปิดหวยมี .lt-mu-groups-wrap อยู่แล้ว; โมดัลส่วนแบ่งห่อด้วย div อีกชั้นจึงไม่โดน) */
.tab-pane > .nav-align-top { margin-bottom: 1.1rem; }

/* ── หน้า /login (theme2) — คัดลอกจากส่วนเดียวกันใน member/theme2.css (แก้ component กลางต้องซิงก์)
   ต่างจาก member: ช่องกรอกใช้ .lt-login-field (ไม่ใช่ .lt-login-field ซึ่งใน company เป็นกล่องมีกรอบของโมดัลรีเซ็ตรหัสผ่าน) ──
   แนวคิด: ทั้งหน้าเป็น "ตั๋วใบเดียว" .lt-tk = ต้นขั้วสีแบรนด์ (.lt-tk-stub) + รอยปรุ (.lt-tk-perf) + ตัวตั๋วที่เป็นฟอร์ม (.lt-tk-body)
   มือถือเรียงบน-ล่าง / desktop (≥992px) เรียงซ้าย-ขวา — ไม่มี hero แยกและไม่มีการ์ดซ้อน
   ใช้ร่วม: .lt-login-field/.lt-pw-input/.lt-pw-eye (ฟิลด์ของโมดัลเปลี่ยนรหัสผ่าน), .lt-tgl,
   .lt-set-cancel, .lt-detail-modal + .lt-ticket-band (เชลล์โมดัล PIN) */
.lt-login-body {
  margin: 0;
  /* แสงสีแบรนด์จาง ๆ 2 มุมบน canvas ให้พื้นไม่แบน — รัศมีสั้น (≤300px) เพื่อไม่ทับตำแหน่งรอยบากของตั๋ว
     (รอยบากเป็นวงกลมสีพื้นทึบ ถ้าพื้นตรงนั้นมีสีจะเห็นขอบ) */
  background:
    radial-gradient(360px 300px at 0% 0%, rgba(240, 62, 82, 0.16), transparent 70%),
    radial-gradient(380px 320px at 100% 100%, rgba(255, 176, 32, 0.2), transparent 70%),
    var(--lt-canvas);
}
.lt-login {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 1rem 1rem 1.4rem;
}
.lt-tk {
  position: relative;
  display: grid;
  /* minmax(0,…) + min-width:0 กันข้อความไทยยาว ๆ (ไม่มีช่องว่าง) ดัน track กว้างเกินจอจนหน้าเลื่อนแนวนอนได้ */
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 440px;
  background: var(--lt-card);
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(43, 33, 64, 0.14);
  overflow: hidden;
  /* เข้าหน้าแบบ fade อย่างเดียว — ห้ามใส่ translate */
  animation: ltTkIn 0.3s ease both;
}
@keyframes ltTkIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.lt-tk-stub,
.lt-tk-body { min-width: 0; }
.lt-tk-brand,
.lt-tk-line,
.lt-login-sub,
.lt-login-help span { overflow-wrap: anywhere; }

/* ต้นขั้ว */
.lt-tk-stub {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.7rem 1.25rem 1.85rem;
  background: var(--lt-chrome);
  color: #fff;
  text-align: center;
}
.lt-tk-stub::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 320px;
  height: 320px;
  right: -130px;
  top: -170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 65%);
  pointer-events: none;
}
/* ชื่อเว็บพิมพ์จาง ๆ แนวตั้งริมรอยปรุ เหมือนตัวพิมพ์ข้างต้นขั้วตั๋ว — desktop เท่านั้น */
.lt-tk-mark { display: none; }
/* กล่องโลโก้ใหญ่กว่าเดิม (76/92px) เพราะไฟล์โลโก้ที่อัปโหลดมักมีขอบโปร่งใสรอบตัวงาน ~20% ต่อด้าน ตัวโลโก้จริงจึงเหลือเล็กมาก */
.lt-tk-logo {
  width: 104px;
  height: 104px;
  object-fit: cover;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.3);
  padding: 4px;
  box-shadow: 0 10px 26px rgba(43, 33, 64, 0.28);
}
.lt-tk-brand {
  font-family: var(--lt-font-display);
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.15;
  margin: 0.15rem 0 0;
  color: #fff;
  text-shadow: 0 2px 6px rgba(43, 33, 64, 0.25);
}
.lt-tk-role {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
  background: rgba(43, 33, 64, 0.45);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.lt-tk-line {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.92;
  text-shadow: 0 1px 2px rgba(43, 33, 64, 0.25);
}

/* รอยปรุระหว่างต้นขั้วกับตัวตั๋ว: เส้นประ + รอยบากครึ่งวงกลมสีพื้นหลัง (ตั๋ว overflow:hidden ตัดให้เหลือครึ่ง)
   มือถือ = เส้นแนวนอน รอยบากซ้าย/ขวา; desktop = เส้นแนวตั้ง รอยบากบน/ล่าง */
.lt-tk-perf {
  position: relative;
  z-index: 1;
  height: 0;
  border-top: 2px dashed rgba(43, 33, 64, 0.16);
}
.lt-tk-perf::before,
.lt-tk-perf::after {
  content: "";
  position: absolute;
  top: -12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--lt-canvas);
  box-shadow: inset 0 1px 3px rgba(43, 33, 64, 0.12);
}
.lt-tk-perf::before { left: -11px; }
.lt-tk-perf::after { right: -11px; }

/* ตัวตั๋ว (ฟอร์ม) */
.lt-tk-body {
  display: flex;
  flex-direction: column;
  padding: 1.3rem 1.35rem 1.3rem;
}
.lt-tk-head { margin-bottom: 1.05rem; }
.lt-login-title {
  font-family: var(--lt-font-body);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.2;
  margin: 0;
  color: var(--lt-ink);
}
.lt-login-sub { color: var(--lt-ink-soft); font-size: 0.85rem; margin: 0.25rem 0 0; }
#formLogin {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
/* server แปลงชื่อผู้ใช้เป็นตัวใหญ่เสมอ — โชว์ให้ตรงกับที่เก็บ (placeholder คงเดิม) */
.lt-login-body #username { text-transform: uppercase; }
.lt-login-body #username::placeholder { text-transform: none; }
.lt-login-body .lt-pw-input input { font-size: 1rem; }
/* autofill ของ Chrome ทาสีพื้นช่องเป็นฟ้า/เหลืองทับกล่องมน — บังคับพื้นขาวไว้ */
.lt-login-body .lt-pw-input input:-webkit-autofill,
.lt-login-body .lt-pw-input input:-webkit-autofill:hover,
.lt-login-body .lt-pw-input input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: var(--lt-ink);
  caret-color: var(--lt-ink);
}
/* focus ของหน้านี้ใช้สีหมึก ไม่ใช้สีชิลีของธีม — ช่องแรกถูก auto-focus ตอนเปิดหน้า ถ้าขอบแดงจะดูเหมือน error ทั้งที่ยังไม่ได้พิมพ์
   (ต้องอยู่ก่อนกฎ .is-invalid ด้านล่างเพื่อให้สถานะ error ชนะเมื่อ focus อยู่) */
.lt-login-body .lt-pw-input:focus-within {
  border-color: var(--lt-ink);
  box-shadow: 0 0 0 3px rgba(43, 33, 64, 0.1);
}
/* บรรทัดข้อความใต้ช่องกรอก "จอง" ความสูง 1 บรรทัดไว้เสมอ — ถ้าโผล่เฉพาะตอน error ตั๋วจะสูงขึ้น
   แล้วถูกจัดกึ่งกลางแนวตั้งใหม่ ทั้งหน้ากระโดดขึ้น */
.lt-login-msg {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.05rem;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.05rem;
  color: var(--lt-chili);
}
.lt-login-msg i { font-size: 0.72rem; }
.lt-login-field.is-invalid .lt-pw-input {
  border-color: var(--lt-chili);
  box-shadow: 0 0 0 3px rgba(255, 76, 81, 0.12);
  animation: ltShake 0.32s ease;
}
/* ป้าย Caps Lock อยู่ในช่องรหัสผ่าน (ชิปหน้าปุ่มตา) — ไม่ใช่บรรทัดใต้ช่อง เพื่อไม่ให้ความสูงฟอร์มเปลี่ยน */
.lt-login-caps {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.12);
  color: #d97706;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}
.lt-login-caps[hidden] { display: none; }
.lt-login-remember {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.15rem 0 0.45rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--lt-ink-soft);
  cursor: pointer;
  user-select: none;
}
.lt-login-remember .lt-tgl { width: 42px; height: 24px; }
.lt-login-remember .lt-tgl-track::after { width: 18px; height: 18px; }
.lt-login-remember .lt-tgl input:checked + .lt-tgl-track::after { transform: translateX(18px); }
.lt-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 999px;
  background: var(--lt-chrome);
  color: #fff;
  font-family: var(--lt-font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 16px rgba(240, 62, 82, 0.3);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.lt-login-btn:hover { filter: brightness(1.05); box-shadow: 0 8px 20px rgba(240, 62, 82, 0.36); }
.lt-login-btn:active { transform: translateY(1px); }
.lt-login-btn:disabled { cursor: progress; filter: saturate(0.8); box-shadow: none; }
.lt-login-btn:focus-visible,
.lt-login-body .lt-pw-eye:focus-visible,
.lt-pin-key:focus-visible {
  outline: 3px solid rgba(240, 62, 82, 0.45);
  outline-offset: 2px;
}
.lt-login-btn-text,
.lt-login-btn-load { display: inline-flex; align-items: center; gap: 0.5rem; }
.lt-login-btn-load { display: none; }
.lt-login-btn.is-loading .lt-login-btn-text { display: none; }
.lt-login-btn.is-loading .lt-login-btn-load { display: inline-flex; }
.lt-login-help {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 1.1rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: #f7f5fb;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--lt-ink-soft);
}
.lt-login-help i { flex: none; margin-top: 0.2rem; color: var(--lt-marigold); }
.lt-login-foot { font-size: 0.75rem; color: #a59cb8; text-align: center; }

@media (min-width: 992px) {
  .lt-login { padding: 2rem 2rem 2.4rem; }
  .lt-tk {
    max-width: 920px;
    grid-template-columns: 340px auto minmax(0, 1fr);
    border-radius: 28px;
  }
  /* desktop จัดกึ่งกลางเหมือนมือถือ — เดิมชิดซ้ายแล้วเหลือที่ว่างด้านขวา/บนมาก */
  .lt-tk-stub {
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 2.6rem 2.4rem 2.6rem 2.5rem;
    text-align: center;
  }
  .lt-tk-stub::before { right: -110px; top: -150px; }
  .lt-tk-mark {
    display: block;
    position: absolute;
    right: 0.35rem;
    bottom: -0.35rem;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--lt-font-display);
    font-weight: 600;
    font-size: 3.6rem;
    line-height: 1;
    letter-spacing: 0.04em;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.14);
    pointer-events: none;
    user-select: none;
  }
  .lt-tk-logo { width: 176px; height: 176px; border-radius: 44px; }
  .lt-tk-brand { font-size: 2.1rem; }
  .lt-tk-line { margin-top: 0.5rem; }
  .lt-tk-perf {
    height: auto;
    width: 0;
    border-top: 0;
    border-left: 2px dashed rgba(43, 33, 64, 0.16);
  }
  .lt-tk-perf::before,
  .lt-tk-perf::after { left: -12px; right: auto; }
  .lt-tk-perf::before { top: -11px; }
  .lt-tk-perf::after { top: auto; bottom: -11px; }
  .lt-tk-body { padding: 2.2rem 2.5rem 2.1rem; justify-content: center; }
  .lt-tk-head { margin-bottom: 1.3rem; }
  .lt-login-title { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .lt-tk,
  .lt-login-field.is-invalid .lt-pw-input,
  .lt-pin-dots.is-shake { animation: none; }
  .lt-login-btn,
  .lt-pin-key,
  .lt-pin-dots span,
  .lt-tgl-track,
  .lt-tgl-track::after { transition: none; }
}

/* โมดัล PIN */
.lt-pin-dialog { max-width: 380px; }
.lt-pin-step {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.15rem 0 0.7rem;
}
.lt-pin-step[hidden] { display: none; }
.lt-pin-step span { width: 30px; height: 4px; border-radius: 999px; background: #eeeaf4; }
.lt-pin-step span.is-on { background: var(--lt-chili); }
.lt-pin-dots {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.5rem 0 1rem;
}
.lt-pin-dots span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #d9d3e4;
  background: #fff;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.lt-pin-dots span.is-on { background: var(--lt-ink); border-color: var(--lt-ink); transform: scale(1.12); }
.lt-pin-dots.is-ok span { background: var(--lt-leaf); border-color: var(--lt-leaf); }
.lt-pin-dots.is-shake { animation: ltShake 0.35s ease; }
.lt-pin-err {
  margin: -0.45rem 0 0.65rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--lt-chili);
}
.lt-pin-err[hidden] { display: none; }
.lt-pin-busy {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: -0.45rem 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--lt-ink-soft);
}
.lt-pin-modal.is-busy .lt-pin-busy { display: flex; }
.lt-pin-modal.is-busy .lt-pin-err { display: none; }
.lt-pin-modal.is-busy .lt-pin-pad { opacity: 0.45; pointer-events: none; }
/* modal-body ของ .lt-detail-modal เป็น flex คอลัมน์ → margin:0 auto ทำให้แป้นหดเท่าความกว้างปุ่ม (ปุ่มแคบสูง)
   จึงกำหนด width:100% + max-width ให้ปุ่มกว้างแบบแป้นโทรศัพท์ */
.lt-pin-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  width: 100%;
  max-width: 312px;
  margin: 0 auto;
}
.lt-pin-key {
  height: 60px;
  border: 1.5px solid var(--lt-line);
  border-radius: 16px;
  background: #fff;
  color: var(--lt-ink);
  font-family: var(--lt-font-digit);
  font-feature-settings: "tnum";
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s ease, transform 0.1s ease;
}
.lt-pin-key:hover { background: #f7f5fb; }
.lt-pin-key:active { background: #efeaf6; transform: scale(0.96); }
.lt-pin-key-fn { font-family: var(--lt-font-body); font-size: 0.9rem; color: var(--lt-ink-soft); }
.lt-pin-hint {
  margin-top: 0.85rem;
  text-align: center;
  font-size: 0.72rem;
  color: #a59cb8;
}
@media (max-width: 575.98px) {
  .lt-pin-hint { display: none; }
  .lt-pin-key { height: 54px; }
}
@keyframes ltShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ── ยอดเดิมพันตามหมายเลขแบบ realtime (ก.ย. 2026): แถบสถานะในหัวโมดัล #modalReportLotteryNumber + ไฮไลต์เลขที่เพิ่งเปลี่ยน
   (scripts/lottery/numberTotalsLive.js — company/agent สำเนาเหมือนกัน) ── */
.lt-numt-live { display: inline-flex; align-items: center; gap: 0.45rem; margin-top: 0.35rem; font-size: 0.78rem; color: #8a80a0; }
.lt-numt-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #c9c2d6; flex: none; }
.lt-numt-live.is-on .lt-numt-live-dot { background: var(--lt-leaf); box-shadow: 0 0 0 3px rgba(14, 159, 110, 0.18); animation: lt-numt-pulse 1.6s ease-in-out infinite; }
.lt-numt-live.is-on .lt-numt-live-text { color: #0b7a55; font-weight: 700; }
.lt-numt-rebuild {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-inline-start: 0.35rem;
  border: 1.5px solid rgba(43, 33, 64, 0.15);
  background: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--lt-ink);
  cursor: pointer;
  font-family: inherit;
}
.lt-numt-rebuild:hover { border-color: var(--lt-chili); color: var(--lt-chili); }
.lt-numt-rebuild i { font-size: 0.7rem; }
@keyframes lt-numt-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(14, 159, 110, 0.18); }
  50% { box-shadow: 0 0 0 6px rgba(14, 159, 110, 0.05); }
}
/* เซลล์ที่ตัวเลขเพิ่งเปลี่ยนจาก delta — กะพริบสีเหลืองแล้วจางหาย */
#tableReportLotteryNumber td.lt-num-flash,
#tableReportLotteryType tr.lt-num-flash > td { animation: lt-num-flash 1.8s ease-out; }
@keyframes lt-num-flash {
  0% { background: rgba(245, 158, 11, 0.45); }
  100% { background: transparent; }
}

/* ===== แท็บ "ผลรางวัล" ในโมดัลเลขที่บิล (.lt-rs-*) — theme2/lottery/billDetail.js renderResultTab (company/agent สำเนาเหมือนกัน) ===== */
.lt-rs-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-bottom: 0.75rem; }
.lt-rs-status {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.7rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700;
  background: rgba(18, 185, 129, 0.14); color: #0e9f6e;
}
.lt-rs-status.is-wait { background: rgba(255, 176, 32, 0.16); color: #b45309; }
.lt-rs-hit { font-size: 0.86rem; color: #7a7090; }
.lt-rs-hit b { color: var(--lt-chili); }
.lt-rs-hero { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.75rem; }
.lt-rs-first {
  flex: 1 1 240px; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem 1.1rem; border-radius: 14px;
  background: var(--lt-ink); color: #fff;
}
.lt-rs-first.is-special { background: linear-gradient(135deg, #d97706, var(--lt-marigold)); }
.lt-rs-first-label { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; opacity: 0.85; }
.lt-rs-first-num { font-size: 1.9rem; font-weight: 800; letter-spacing: 0.14em; color: var(--lt-marigold); font-variant-numeric: tabular-nums; line-height: 1; }
.lt-rs-first.is-special .lt-rs-first-num { color: #fff; }
.lt-rs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.6rem; }
.lt-rs-item { border: 1px solid var(--lt-line); border-radius: 12px; padding: 0.6rem 0.75rem; background: #fff; }
.lt-rs-item.is-wide { grid-column: 1 / -1; }
.lt-rs-label { font-size: 0.78rem; font-weight: 600; color: #8a80a0; margin-bottom: 0.35rem; }
.lt-rs-nums { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.lt-rs-nums .lt-rc-num, .lt-rs-nums .lt-rc-num-main { min-width: 2.6rem; text-align: center; }
.lt-rs-nums .is-hit { box-shadow: 0 0 0 2px var(--lt-chili); }
.lt-rs-empty { color: #b9b2c9; font-weight: 700; }

/* แถว "ทั้งหมด" หัวรายการในโมดัลแก้ไขเลขอั้น (สวิตช์รวม อั้น/ครึ่งราคา — renderer ltRenderLimitEdit) */
.lt-lim-edit-row.is-all {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--lt-canvas);
  border-style: dashed;
  margin-bottom: 0.25rem;
}
.lt-lim-edit-num.is-all { font-size: 0.95rem; letter-spacing: 0; }
