/* =====================================================================
   หน้าจองรอบเรียน (booking.html) และหน้าคอร์ส/เก็บเงิน (admin.html)
   ใช้ร่วมกับ style.css (สีและส่วนประกอบหลักอยู่ที่นั่น)
   ===================================================================== */

.loading { color: var(--on-board-2); }
.foot-link { color: var(--on-board); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255,255,255,.4); }
.foot-link:hover { text-decoration-color: currentColor; }

.linkish {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0; border: 0; background: none; cursor: pointer;
  font: 500 .92rem var(--font-display); color: inherit;
  text-decoration: underline; text-decoration-thickness: var(--line); text-underline-offset: 4px;
  text-decoration-color: var(--mat-yellow);
}
.linkish:hover { text-decoration-color: currentColor; }
.linkish .icon { width: 1rem; height: 1rem; }

.demo-note {
  display: flex; gap: 10px; align-items: flex-start;
  margin: -12px 0 30px; padding: 10px 14px;
  border: var(--line) dashed rgba(255,255,255,.45);
  border-radius: var(--radius);
  color: var(--on-board-2); font-size: .92rem; max-width: 80ch;
}
.demo-note strong { color: var(--on-board); font-family: var(--font-display); font-weight: 500; margin-right: 4px; }
.demo-note .icon { margin-top: 3px; }
.demo-note .linkish { margin-left: 6px; color: var(--on-board); font-size: .88rem; }
.demo-note code { color: var(--on-board); font-size: .95em; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  transform: translate(-50%, 20px);
  max-width: min(92vw, 480px);
  padding: 10px 18px;
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius);
  font: 500 .95rem var(--font-display);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .3s var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--error); color: #fff; }

.wait { margin: 0; color: var(--ink-2); }
.wait.small { font-size: .92rem; }
.fine { margin: 12px 0 0; color: var(--ink-2); font-size: .85rem; }
.error { margin: 0; color: var(--error); font-weight: 500; }
.warn { color: var(--error); }

/* ---------------------------------------------------------------- ขั้นตอนการจอง */

.bk-step { margin-bottom: 44px; }
.bk-step > .sheet { padding: 20px 24px; }

/* ตัวเลือก (สาขา): กระดาษบนการ์ดสีเข้ม เลือกแล้วการ์ดเป็นสีเหลือง */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: calc(var(--mat-w) * 2 + 12px); }
.opt {
  --mat: var(--board-deep);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  width: calc(100% - var(--mat-w) * 2);
  padding: 14px 16px;
  border: 0; text-align: left; cursor: pointer;
  font: inherit; color: var(--ink);
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.opt:hover { transform: translateY(-3px); box-shadow: 0 0 0 var(--mat-w) var(--mat), 0 16px 22px -12px var(--lift); }
.opt.on { --mat: var(--mat-yellow); }
.opt > .icon { width: 1.5rem; height: 1.5rem; color: var(--ink-2); }
.opt strong { display: block; font: 500 1.08rem/1.3 var(--font-display); }
.opt small { display: block; color: var(--ink-2); font-size: .86rem; line-height: 1.4; }
.opt .tick { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--mat-yellow); color: #161d2b; }
.opt .tick .icon { width: 1rem; height: 1rem; }

/* คอร์ส: ปุ่มแคปซูล */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pick-chip {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  padding: 8px 18px;
  border: var(--line) solid var(--rule); border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font: 500 1rem/1.25 var(--font-display); cursor: pointer;
  transition: border-color .2s, background .2s;
}
.pick-chip small { font: 400 .8rem var(--font-body); color: var(--ink-2); }
.pick-chip:hover { border-color: var(--ink); }
.pick-chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pick-chip.on small { color: inherit; opacity: .8; }

/* แถบวันที่ (เลื่อนซ้าย-ขวา) */
.dates {
  display: flex; gap: 8px;
  overflow-x: auto; overscroll-behavior-x: contain;
  margin: 0 -24px 18px; padding: 4px 24px 12px;
  scrollbar-width: thin; scrollbar-color: var(--rule) transparent;
}
.day {
  flex: none;
  display: grid; justify-items: center; gap: 0;
  width: 4.6rem; padding: 8px 4px 9px;
  border: var(--line) solid var(--rule); border-radius: var(--radius);
  background: var(--paper); color: var(--ink);
  font: inherit; cursor: pointer;
  transition: border-color .2s, transform .2s var(--ease-out);
}
.day small { font-size: .78rem; color: var(--ink-2); line-height: 1.3; }
.day b { font: 600 1.45rem/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.day em { margin-top: 4px; font: 500 .74rem var(--font-display); font-style: normal; color: var(--ok-ink); white-space: nowrap; }
.day:hover:not(:disabled) { border-color: var(--ink); transform: translateY(-2px); }
.day.off em { color: var(--ink-2); }
.day:disabled { cursor: default; border-style: dashed; background: var(--paper-2); }
.day:disabled b { color: var(--ink-2); }
.day.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.day.on small, .day.on em { color: inherit; }

/* รอบเวลา */
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.time {
  display: grid; gap: 6px; text-align: left;
  padding: 12px 14px;
  border: var(--line) solid var(--rule); border-radius: var(--radius);
  background: var(--paper); color: var(--ink);
  font: inherit; cursor: pointer;
  transition: border-color .2s;
}
.time b { font: 600 1.25rem var(--font-display); font-variant-numeric: tabular-nums; }
.time small { color: var(--ink-2); font-size: .86rem; }
.time:hover:not(:disabled) { border-color: var(--ink); }
.time:disabled { cursor: default; background: var(--paper-2); border-style: dashed; }
.time:disabled b { color: var(--ink-2); text-decoration: line-through; text-decoration-thickness: var(--line); }
.time.on { border-color: var(--ink); box-shadow: inset 0 0 0 var(--line) var(--ink); }
.meter { height: 6px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--mat-red); border-radius: inherit; }
.time.on .meter { background: var(--rule); }

/* ผังที่นั่ง */
.seat-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 34px; align-items: start; }
.show-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 16px; font: 500 1rem var(--font-display); }
.show-line .icon { color: var(--ink-2); }
.show-line .linkish { margin-left: auto; }

.seatmap { display: grid; justify-items: center; gap: 18px; padding: 18px 12px 16px; background: var(--paper-2); border-radius: var(--radius); }
.front {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: min(100%, 360px); padding: 6px 12px;
  border-bottom: 4px solid var(--ink);
  font: 500 .88rem var(--font-display); color: var(--ink-2);
}
.seat-rows { display: grid; gap: 10px; }
.seat-row { display: flex; align-items: center; gap: 8px; }
.row-name { width: 1.4rem; text-align: center; font: 600 .95rem var(--font-display); color: var(--ink-2); }
.aisle { width: 18px; }
.seat {
  display: grid; place-items: center;
  width: 2.9rem; height: 2.7rem;
  border: var(--line) solid var(--ink-2);
  border-radius: 9px 9px 4px 4px;
  background: var(--paper); color: var(--ink);
  font: 500 .95rem var(--font-display); font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform .2s var(--ease-out), background .15s;
}
.seat:hover:not(:disabled) { transform: translateY(-2px); background: var(--paper-2); }
.seat.on { background: var(--mat-yellow); border-color: #161d2b; color: #161d2b; }
.seat.on:hover { background: var(--mat-yellow); }
.seat.taken {
  cursor: not-allowed; border-color: var(--rule); color: transparent;
  background: repeating-linear-gradient(45deg, var(--rule) 0 2px, var(--paper-2) 2px 7px);
}
/* ผังห้องจริง: โต๊ะเรียงต่อกันเป็นแถว (ซ้าย / ขวา) ชิดล่างเหมือนผังห้อง */
.room { display: flex; align-items: flex-end; justify-content: center; gap: clamp(40px, 12vw, 120px); width: 100%; }
.desk-col { display: flex; flex-direction: column; }
.desk {
  display: grid; place-items: center; align-content: center; gap: 0;
  width: 5.6rem; min-height: 3.1rem;
  margin-top: calc(var(--line) * -1);
  border: var(--line) solid var(--ink-2);
  background: var(--paper); color: var(--ink);
  font: inherit; cursor: pointer;
  transition: background .15s;
}
.desk-col .desk:first-child { margin-top: 0; border-radius: var(--radius) var(--radius) 0 0; }
.desk-col .desk:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.desk b { font: 600 1.1rem/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.desk small { font: 500 .68rem/1.2 var(--font-display); color: var(--ink-2); text-align: center; padding: 0 4px; }
.desk:hover:not(:disabled) { background: var(--paper-2); }
.desk.on, .desk.on:hover { position: relative; z-index: 1; background: var(--mat-yellow); border-color: #161d2b; color: #161d2b; }
.desk.on small { color: #161d2b; }
.desk.trial { border-style: dashed; }
.desk.trial b { color: var(--mat-red); }
.desk.on.trial b { color: #161d2b; }
.desk.taken {
  cursor: not-allowed; color: var(--ink-2);
  background: repeating-linear-gradient(45deg, var(--rule) 0 2px, var(--paper-2) 2px 7px);
}
.desk.taken, .desk.trial.taken { border-style: solid; border-color: var(--rule); }
.desk.taken b, .desk.trial.taken b { color: var(--ink-2); font-weight: 500; }
.desk.other { cursor: default; background: var(--paper-2); border-color: var(--rule); color: var(--ink-2); }
.desk.other b { font-weight: 500; opacity: .7; }
.legend .seat.other { background: var(--paper-2); border-color: var(--rule); }
.legend .seat.trial { border-style: dashed; }
.badge.trial { font: 500 .72rem var(--font-display); padding: 1px 8px; vertical-align: 2px; border-color: var(--mat-red); color: var(--ink); }

.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: .86rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend .seat { width: 1.3rem; height: 1.15rem; border-radius: 5px 5px 2px 2px; cursor: default; }
.legend.inline { justify-content: flex-start; color: var(--on-board-2); }

/* ฟอร์มผู้จอง */
.bk-form { display: grid; gap: 14px; }
.bk-form h3 { margin: 0; font-size: 1.2rem; }
.field { display: flex; flex-direction: column; gap: 6px; font: 500 .95rem var(--font-display); }
.field input, .date-input, .branch-sel select, .search input {
  font: 400 1rem var(--font-body);
  padding: 10px 12px;
  color: var(--ink); background: var(--paper);
  border: var(--line) solid var(--rule); border-radius: var(--radius);
  caret-color: var(--mat-red);
}
.field input:focus, .date-input:focus, .branch-sel select:focus, .search input:focus { outline: none; border-color: var(--ink); }
.sum { display: grid; gap: 2px; padding: 12px 0 2px; border-top: var(--line) solid var(--rule); font: 500 1rem var(--font-display); }
.sum small { font: 400 .88rem var(--font-body); color: var(--ink-2); }
.btn.big { padding: 13px 18px; font-size: 1.08rem; }

/* ตั๋ว */
.tickets { display: grid; gap: 30px; max-width: 640px; }
.ticket {
  display: grid; grid-template-columns: minmax(0, 1fr) 150px;
  background: var(--paper); color: var(--ink);
  border-radius: 6px;
  box-shadow: 0 0 0 var(--mat-w) var(--mat-yellow);
  margin: var(--mat-w);
  animation: ticket-in .6s var(--ease-out) both;
}
.ticket:nth-child(2) { animation-delay: .08s; }
.ticket:nth-child(3) { animation-delay: .16s; }
@keyframes ticket-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.t-main { padding: 20px 24px; }
.t-club { margin: 0; font: 500 .82rem var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.t-main h2 { margin: 2px 0 12px; font-size: 1.5rem; }
.t-main dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 0; }
.t-main dt { font-size: .8rem; color: var(--ink-2); }
.t-main dd { margin: 0; font: 500 1rem/1.35 var(--font-display); }
.t-stub {
  position: relative;
  display: grid; align-content: center; justify-items: center; gap: 0;
  padding: 18px 12px;
  border-left: var(--line) dashed var(--rule);
  text-align: center;
}
/* รอยเจาะครึ่งวงกลมที่รอยฉีก */
.t-stub::before, .t-stub::after {
  content: ""; position: absolute; left: -11px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--mat-yellow);
}
.t-stub::before { top: -17px; }
.t-stub::after { bottom: -17px; }
.t-stub small { font-size: .8rem; color: var(--ink-2); }
.t-stub b { font: 600 2.6rem/1.1 var(--font-display); margin-bottom: 8px; }
.t-stub code { font: 600 1.05rem var(--font-display); letter-spacing: .08em; }

.empty-note { max-width: 560px; }
.empty-note h2 { margin: 0 0 6px; }

/* ---------------------------------------------------------------- หน้าแอดมิน */

.head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.head-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.branch-sel { display: inline-flex; align-items: center; gap: 8px; font: 500 .95rem var(--font-display); color: var(--on-board); }
.branch-sel select { padding: 8px 10px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: calc(var(--mat-w) * 2 + 12px); margin-bottom: 40px; }
.stat { display: grid; gap: 2px; padding: 14px 18px; }
.stat b { font: 600 1.7rem/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.stat b small { font-size: .95rem; font-weight: 500; color: var(--ink-2); }
.stat span { color: var(--ink-2); font-size: .9rem; }

.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 30px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 6px;
  border: 0; border-radius: var(--radius);
  background: var(--paper); color: var(--ink);
  font: 500 .98rem var(--font-display); cursor: pointer;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.tab .no { display: grid; place-items: center; min-width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--paper-2); color: var(--ink-2); font-size: .82rem; }
.tab:hover { transform: translateY(-2px); }
.tab.active { box-shadow: 0 0 0 4px var(--mat-yellow); }
.tab.active .no { background: var(--mat-yellow); color: #161d2b; }
.tab .count { min-width: 1.4rem; padding: 0 6px; border-radius: 999px; background: var(--mat-red); color: #fff; font-size: .8rem; line-height: 1.4rem; text-align: center; }

.tab-body > .strip { margin-top: 4px; }
.tab-body > .sheet { margin-bottom: 40px; }
.list-sheet { padding: 4px 0; }
.list-sheet .empty { padding: 26px 20px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.list-sheet .empty .icon { display: inline; width: 1.2rem; height: 1.2rem; margin: 0; }

.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.3fr) auto auto auto; align-items: center; gap: 8px 18px;
  padding: 12px 24px;
  border-bottom: var(--line) solid var(--rule);
}
.row:last-child { border-bottom: 0; }
.who strong { display: block; font: 500 1.04rem/1.3 var(--font-display); }
.who small, .when small { display: block; color: var(--ink-2); font-size: .85rem; line-height: 1.45; }
.when { display: grid; gap: 4px; }
.amt { font: 600 1.1rem var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.acts { display: flex; justify-content: flex-end; gap: 8px; }
.acts .btn { padding: 7px 12px; font-size: .92rem; white-space: nowrap; }
.badge.due { background: transparent; border-color: var(--mat-red); color: var(--ink); }

.roster { margin-bottom: 30px; }
.roster .strip { font-size: 1.1rem; }
.roster .strip small { font: 400 .88rem var(--font-body); color: var(--ink-2); margin-left: 4px; }
.roster-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.roster-row.cancelled .who { opacity: .5; text-decoration: line-through; }
.seat-tag {
  display: grid; place-items: center; width: 2.5rem; height: 2.3rem;
  border: var(--line) solid var(--ink-2); border-radius: 8px 8px 3px 3px;
  font: 600 .92rem var(--font-display);
}

/* ปุ่มแบ่งช่อง (สถานะ) */
.seg { display: inline-flex; border: var(--line) solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.seg button {
  padding: 6px 11px;
  border: 0; border-left: var(--line) solid var(--ink);
  background: var(--paper); color: var(--ink);
  font: 500 .86rem var(--font-display); cursor: pointer; white-space: nowrap;
}
.seg button:first-child { border-left: 0; }
.seg button:hover { background: var(--paper-2); }
.seg button.on { background: var(--ink); color: var(--paper); }
.seg button.on.s-มาเรียน { background: var(--ok-ink); color: #fff; }
.seg button.on.s-ขาด { background: var(--mat-red); color: #fff; }
.seg.on-board { border-color: var(--on-board); }
.seg.on-board button { border-left-color: var(--on-board); }
.seg.on-board button:first-child { border-left: 0; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 22px; }
.toolbar .btn { padding: 8px 12px; }
.on-board-text { font: 500 1.05rem var(--font-display); color: var(--on-board); margin-left: 6px; }
.search { position: relative; flex: 1 1 280px; max-width: 420px; display: flex; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-2); }
.search input { width: 100%; padding-left: 38px; }
.date-input { padding: 7px 10px; }

.table-sheet td small.sub { display: block; color: var(--ink-2); font: 400 .82rem var(--font-body); }
.table-sheet td .btn { padding: 6px 12px; font-size: .9rem; }

/* จุดความคืบหน้า: เต็ม = เรียนแล้ว, วง = จองไว้ */
.dots { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.dots i { width: .8rem; height: .8rem; border-radius: 50%; border: var(--line) solid var(--rule); }
.dots i.used { background: var(--mat-green); border-color: var(--mat-green); }
.dots i.booked { border-color: var(--mat-green); border-style: dashed; }
.dots b { font: 600 .8rem var(--font-display); color: var(--mat-red); margin-left: 2px; }

/* ---------------------------------------------------------------- บิล (หน้าต่าง) */

#bill-dlg {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0; border: 0;
  background: var(--paper); color: var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 0 0 var(--mat-w) var(--mat-yellow), 0 30px 60px -20px rgba(0,0,0,.5);
}
#bill-dlg::backdrop { background: rgba(13, 24, 54, .6); }
.invoice { padding: 26px 28px 8px; }
.inv-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding-bottom: 16px; border-bottom: var(--line) solid var(--ink); }
.inv-head img { width: 84px; display: block; }
.inv-head h2 { margin: 0; font-size: 1.45rem; }
.inv-head p { margin: 0; color: var(--ink-2); font-size: .88rem; }
.inv-info { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin: 16px 0; }
.inv-info dt { font-size: .8rem; color: var(--ink-2); }
.inv-info dd { margin: 0; font: 500 1.02rem var(--font-display); }
.inv-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.inv-table th { text-align: left; font: 500 .86rem var(--font-display); color: var(--ink-2); padding: 8px 0; border-bottom: var(--line) solid var(--rule); }
.inv-table td { padding: 8px 0; border-bottom: var(--line) solid var(--rule); }
.inv-table td:first-child, .inv-table th:first-child { width: 5rem; }
.inv-table tfoot td { border-bottom: 0; border-top: var(--line) solid var(--ink); padding-top: 12px; font: 600 1.2rem var(--font-display); }
.inv-pay { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 22px; margin: 20px 0 10px; padding: 18px; background: var(--paper-2); border-radius: var(--radius); }
.inv-pay .slot { grid-column: 1 / -1; aspect-ratio: auto; padding: 26px 16px; }
.inv-pay strong { font: 500 1.05rem var(--font-display); }
.inv-pay p { margin: 4px 0 0; color: var(--ink-2); }
.inv-pay .amt-big { margin-top: 8px; font: 600 1.9rem var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.qr { padding: 10px; background: #fff; border-radius: var(--radius); line-height: 0; }
.qr img, .qr canvas { display: block; width: 200px; height: 200px; }
.dlg-acts { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 28px 24px; }
.dlg-acts .btn { padding: 8px 14px; font-size: .95rem; }
.dlg-acts .btn:last-child { margin-left: auto; }

/* ---------------------------------------------------------------- จอเล็ก */

@media (max-width: 900px) {
  .seat-layout { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row .when { grid-column: 1 / -1; grid-row: 2; }
  .row .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .roster-row { grid-template-columns: auto minmax(0, 1fr); }
  .roster-row .acts { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .bk-step > .sheet { padding: 16px; }
  .dates { margin-inline: -16px; padding-inline: 16px; }
  .seat { width: 2.5rem; height: 2.4rem; }
  .seat-row { gap: 6px; }
  .aisle { width: 10px; }
  .ticket { grid-template-columns: minmax(0, 1fr) 112px; }
  .t-main { padding: 16px 18px; }
  .t-main dl { grid-template-columns: minmax(0, 1fr); }
  .t-stub b { font-size: 2.1rem; }
  .row { padding: 12px 16px; }
  .invoice { padding: 20px 18px 6px; }
  .inv-head { grid-template-columns: 1fr auto; }
  .inv-head img { display: none !important; }
  .inv-pay { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .dlg-acts { padding: 12px 18px 20px; }
  .dlg-acts .btn:last-child { margin-left: 0; }
  .seg button { padding: 6px 8px; }
}

/* พิมพ์บิล: พิมพ์เฉพาะใบแจ้งค่าเรียน */
@media print {
  body { background: #fff !important; }
  body::before, body > :not(dialog) { display: none !important; }
  #bill-dlg { position: static; width: 100%; max-height: none; box-shadow: none; color: #000; background: #fff; }
  #bill-dlg::backdrop { display: none; }
  .dlg-acts { display: none; }
  .inv-pay { background: #fff; border: 2px solid #ccc; }
}
