/* =====================================================================
   รอบ 49: ศูนย์รายงาน (/reports) — Components/Pages/Reports.razor, ReportFilterBar.razor, ReportView.razor
   - จอคอม (≥1025px): หน้าพอดีจอ — เมนูรายงานซ้าย (เลื่อนเอง) | ตัวกรอง + ผลรายงาน (ตารางเลื่อนในกรอบ หัวติดบน แถวรวมติดล่าง)
   - แท็บเล็ต/มือถือ: ซ่อนเมนูซ้าย (ใช้ลิงก์ "รายงานทั้งหมด" กลับไปสารบัญ), ตารางเลื่อนแนวนอนในกรอบของตัวเอง (หน้าไม่เลื่อนข้าง)
   - พิมพ์ A4: html[data-print="rc"] (แนวตั้ง) / "rc-land" (แนวนอน) แสดงเฉพาะ .rc-print, หัวตารางซ้ำทุกหน้า, เลขหน้าที่มุมล่าง
   ทุกกฎขึ้นต้นด้วย .rc-  ใช้ตัวแปรสีของธีม (โหมดมืดใช้ได้)
   ===================================================================== */

/* ---------- หัวหน้า ---------- */
.rc-head-text { min-width: 0; }
.rc-head-text .context { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70ch; }
.rc-back {
  display: inline-flex; align-items: center; gap: 4px; margin: 0 0 4px; padding: 2px 8px 2px 4px; border-radius: 999px;
  color: var(--brand-strong, var(--brand)); font-size: .82rem; font-weight: 600; text-decoration: none;
}
.rc-back:hover { background: var(--brand-tint); }
.rc-tools { gap: 8px; }
.rc-tools .btn { display: inline-flex; align-items: center; gap: 6px; }
.rc-orient, .rc-seg {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 11px; background: var(--chip); flex: none;
}
.rc-orient button, .rc-seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 32px; padding: 0 11px;
  border: 0; border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.rc-orient button { padding: 0 8px; }
.rc-orient button:hover, .rc-seg button:hover { color: var(--ink); }
.rc-orient button.on, .rc-seg button.on { background: var(--surface); color: var(--brand-strong, var(--brand)); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---------- สารบัญ (ยังไม่เลือกรายงาน) ---------- */
.rc-dir { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.rc-dir > .empty { grid-column: 1 / -1; }
.rc-dir-group { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.rc-dir-group h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.05rem; }
.rc-gico {
  flex: none; width: 30px; height: 30px; border-radius: 10px; background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), .18); position: relative;
}
.rc-gico::after {
  content: ""; position: absolute; inset: 9px; border-radius: 3px; background: var(--brand);
}
.rc-gico.g-audit::after { border-radius: 50%; background: var(--danger); }
.rc-gico.g-audit { background: var(--danger-soft); box-shadow: none; }
.rc-gico.g-other::after { inset: 10px 8px; border-radius: 2px; background: var(--muted); }
.rc-gico.g-other { background: var(--chip); box-shadow: none; }
.rc-dir-list { display: grid; gap: 8px; }
.rc-dir-item {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); text-decoration: none; background: var(--surface); transition: border-color .12s, background .12s;
}
.rc-dir-item strong { font-size: .95rem; font-weight: 600; }
.rc-dir-item small { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.rc-dir-item:hover { border-color: var(--brand); background: var(--brand-tint); }

/* ---------- โครงหลัก: เมนู | เนื้อหา ---------- */
.rc-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 16px; min-width: 0; }
.rc-menu { margin: 0; padding: 8px 8px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rc-menu-group { display: flex; flex-direction: column; gap: 1px; }
.rc-menu-group h3 { margin: 8px 10px 4px; color: var(--muted); font-size: .74rem; font-weight: 700; letter-spacing: .02em; }
.rc-mi {
  display: block; padding: 7px 10px; border-radius: 9px; color: var(--ink); font-size: .9rem; line-height: 1.35;
  text-decoration: none; overflow: hidden; text-overflow: ellipsis;
}
.rc-mi:hover { background: var(--chip); }
.rc-mi.on { background: var(--brand-soft); color: var(--brand-strong, var(--brand)); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.rc-mi-ext::after { content: " ↗"; color: var(--muted); font-size: .8em; }
.rc-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rc-desc { margin: 0; color: var(--muted); font-size: .86rem; }

/* ---------- แถบตัวกรอง ---------- */
.rc-filter {
  display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); min-width: 0;
}
.rc-presets { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px 1px; }
.rc-presets::-webkit-scrollbar { display: none; }
.rc-presets .chip { flex: none; cursor: pointer; font: inherit; font-size: .8rem; padding: 3px 11px; min-height: 30px; }
.rc-presets .chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink, #fff); }
.rc-frow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; min-width: 0; }
.rc-fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rc-flabel { color: var(--muted); font-size: .76rem; font-weight: 600; line-height: 1.2; }
.rc-fld select, .rc-fld input[type="date"], .rc-fld input[type="text"], .rc-fld input[type="search"] {
  min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--ink); font: inherit; font-size: .9rem; min-width: 0;
}
.rc-fld select:focus, .rc-fld input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.rc-fld-branch select { max-width: 220px; }
.rc-fld-num input { width: 110px; }
.rc-period { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rc-dash { color: var(--muted); }
.rc-fld-run { margin-left: auto; }
.rc-run { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; }
.rc-run.is-busy svg { animation: rc-spin .9s linear infinite; }
@keyframes rc-spin { to { transform: rotate(360deg); } }

.rc-pick { display: inline-flex; align-items: stretch; min-height: 38px; max-width: 260px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.rc-pick-btn {
  display: inline-flex; align-items: center; min-width: 0; padding: 0 10px; border: 0; background: none; color: var(--ink);
  font: inherit; font-size: .9rem; cursor: pointer; text-align: left;
}
.rc-pick-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-pick-btn.is-static { cursor: default; color: var(--brand-strong, var(--brand)); font-weight: 600; }
.rc-pick-x { flex: none; width: 34px; border: 0; border-left: 1px solid var(--line); background: var(--chip); color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.rc-pick-x:hover { color: var(--danger); }
.rc-psearch { position: relative; }
.rc-psearch input { width: 220px; }
.rc-sugg {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: min(360px, 86vw);
  margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.rc-sugg button {
  display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--ink); font: inherit; font-size: .88rem; text-align: left; cursor: pointer;
}
.rc-sugg button:hover { background: var(--brand-tint); }
.rc-sugg small { color: var(--muted); }

/* ---------- ผลรายงาน ---------- */
.rc-result { min-width: 0; transition: opacity .15s; }
.rc-result.is-busy { opacity: .55; }
.rc-print-head { display: none; }
.rc-view { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.rc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.rc-card {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
}
.rc-card-label { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-card strong { font-size: 1.22rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-card small { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-card:first-child { background: var(--brand-tint); box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), .22); }
.rc-card:first-child strong { color: var(--brand-strong, var(--brand)); }
.rc-card.good strong { color: var(--ok); }
.rc-card.bad strong { color: var(--danger); }
.rc-card.warn { box-shadow: var(--shadow), inset 3px 0 0 #D69E2E; }
/* รอบ 109: การ์ดคาดการณ์ (Tone "est") — กรอบเส้นประ ไม่มีเงา ให้ต่างจากยอดแน่นอนชัดเจน */
.rc-card.est { background: transparent; box-shadow: none; border: 1.5px dashed color-mix(in srgb, var(--muted) 60%, transparent); }
.rc-card.est strong { color: var(--ink); font-weight: 600; }

.rc-alert { margin: 0; background: var(--warn-soft); color: #7A4B00; }
.rc-notes { display: flex; flex-direction: column; gap: 4px; }
.rc-note { position: relative; margin: 0; padding-left: 20px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.rc-note::before {
  content: "i"; position: absolute; left: 0; top: .15em; width: 14px; height: 14px; border-radius: 50%; background: var(--chip);
  color: var(--muted); font-size: 10px; font-weight: 800; line-height: 14px; text-align: center; font-style: italic;
}
.rc-note-lock::before { content: "🔒"; background: none; font-style: normal; font-size: 10px; }

.rc-tsec { display: flex; flex-direction: column; min-width: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.rc-thead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.rc-thead h2 { margin: 0 auto 0 0; font-size: 1rem; }
.rc-thead .fit-count { margin-left: auto; }
.rc-thead h2 + .rc-tsearch, .rc-thead h2 + .fit-count { margin-left: 0; }
.rc-tsearch {
  display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; width: 240px; max-width: 100%;
  border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface);
}
.rc-tsearch:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.rc-tsearch input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; font-size: .88rem; }
.rc-tscroll { overflow: auto; overscroll-behavior: contain; max-height: 70vh; -webkit-overflow-scrolling: touch; }

.rc-t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .89rem; }
.rc-t th {
  position: sticky; top: 0; z-index: 2; padding: 9px 12px; background: var(--surface); color: var(--muted);
  font-size: .78rem; font-weight: 700; text-align: left; white-space: nowrap; box-shadow: inset 0 -1px 0 var(--line);
}
.rc-t th.r, .rc-t td.r { text-align: right; }
.rc-t td { padding: 7px 12px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); vertical-align: top; white-space: nowrap; }
.rc-t td.rc-wide, .rc-r-group td { white-space: normal; }
.rc-t .num { font-variant-numeric: tabular-nums; }
.rc-t td.r { white-space: nowrap; }
.rc-t .rc-wide { min-width: 180px; }
.rc-t .rc-nowrap { white-space: nowrap; }
.rc-t tbody tr:hover td { background: var(--brand-tint); }
.rc-sort {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit;
  font: inherit; font-weight: inherit; cursor: pointer; white-space: nowrap;
}
.rc-t th.r .rc-sort { flex-direction: row-reverse; }
.rc-sort:hover { color: var(--ink); }
.rc-si { display: inline-block; width: 8px; height: 10px; opacity: .35; position: relative; }
.rc-si::before, .rc-si::after { content: ""; position: absolute; left: 0; border: 4px solid transparent; }
.rc-si::before { top: -4px; border-bottom-color: currentColor; }
.rc-si::after { bottom: -4px; border-top-color: currentColor; }
.rc-si.up, .rc-si.down { opacity: 1; color: var(--brand); }
.rc-si.up::after, .rc-si.down::before { display: none; }
.rc-th-print { display: none; }

.rc-r-group td {
  padding-top: 11px; background: var(--brand-tint); color: var(--brand-strong, var(--brand)); font-weight: 700;
  border-bottom: 1px solid rgba(var(--brand-rgb), .2);
}
.rc-t tbody tr.rc-r-group:hover td { background: var(--brand-soft); }
.rc-r-sub td { background: var(--chip); font-weight: 700; }
.rc-r-total td { background: var(--chip); font-weight: 800; border-top: 2px solid var(--ink); border-bottom: 0; }
.rc-r-total.rc-r-auto td { position: sticky; bottom: 0; z-index: 1; }
.rc-r-warn td { background: var(--danger-soft); }
.rc-r-warn td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.rc-t tbody tr.rc-r-warn:hover td { background: color-mix(in srgb, var(--danger-soft) 70%, var(--danger) 8%); }
.rc-r-link { cursor: pointer; }
/* รอบ 108b: แถวที่แสดงไว้แต่ไม่นับในยอดรวม (ReportRow.Muted) */
.rc-r-muted td, .rc-r-muted.rc-r-link td:first-child { color: var(--muted); }
.rc-r-link td:first-child { color: var(--brand-strong, var(--brand)); font-weight: 600; }
.rc-r-link:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.rc-empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.rc-more { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }

.rc-skel { display: grid; gap: 10px; }
.rc-skel span { display: block; height: 52px; border-radius: var(--radius); background: linear-gradient(90deg, var(--chip) 25%, var(--surface) 50%, var(--chip) 75%); background-size: 200% 100%; animation: rc-shine 1.2s linear infinite; }
.rc-skel span:first-child { height: 76px; }
.rc-skel span:last-child { height: 220px; }
@keyframes rc-shine { to { background-position: -200% 0; } }

/* ---------- รอบ 107: <ReportEmbed> รายงานที่ฝังในหน้าอื่น ---------- */
.rce { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rce-head { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.rce-hint { flex: 1 1 260px; margin: 0; }
.rce-open { flex: none; display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.rce-link { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- จอคอม: พอดีจอ ---------- */
@media screen and (min-width: 1025px) {
  .rc-back { display: none; }
  .rc-home .rc-body { overflow: auto; overscroll-behavior: contain; margin: 0 -8px; padding: 0 8px 8px; }
  .rc-open .rc-body { overflow: hidden; }
  .rc-layout { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); }
  .rc-menu { min-height: 0; overflow: auto; overscroll-behavior: contain; }
  .rc-main { min-height: 0; }
  .rc-main > .rc-desc, .rc-main > .rc-filter { flex: none; }
  .rc-result { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; margin: 0 -6px; padding: 0 6px 6px; }
  .rc-print { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .rc-view { flex: 1 1 auto; min-height: 0; }
  .rc-view > .rc-cards, .rc-view > .rc-notes, .rc-view > .rc-alert { flex: none; }
  /* ตารางเดียว: เต็มพื้นที่ที่เหลือ เลื่อนในกรอบ (หัวติดบน แถวรวมติดล่าง) */
  .rc-tsec.rc-single { flex: 1 1 auto; min-height: 260px; }
  .rc-tsec.rc-single:has(.rc-empty:only-child) { flex: none; min-height: 0; }
  .rc-single .rc-tscroll { flex: 1 1 auto; min-height: 0; max-height: none; }
  .rc-tsec:not(.rc-single) { flex: none; }
  .rce { flex: 1 1 auto; min-height: 0; }
}

/* ---------- แท็บเล็ต ---------- */
@media (max-width: 1024px) {
  .rc-layout { grid-template-columns: minmax(0, 1fr); }
  .rc-menu { display: none; }
}

/* ---------- มือถือ ---------- */
@media (max-width: 760px) {
  .rc-tools { justify-content: flex-start; flex-wrap: wrap; }
  .rc-tools .btn { flex: 1 1 0; justify-content: center; min-width: 0; }
  .rc-dir { gap: 12px; }
  .rc-filter { padding: 10px; gap: 8px; }
  .rc-presets { margin: 0 -10px; padding: 0 10px 2px; }
  .rc-frow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; align-items: end; }
  .rc-fld-mode, .rc-fld-period, .rc-fld-run, .rc-fld-product { grid-column: 1 / -1; }
  .rc-fld-mode .rc-seg { display: flex; overflow-x: auto; scrollbar-width: none; }
  .rc-fld-mode .rc-seg button { flex: 1 0 auto; padding: 0 8px; }
  .rc-seg { display: flex; }
  .rc-seg button { flex: 1 1 0; }
  .rc-fld select, .rc-fld input[type="date"], .rc-fld input[type="text"], .rc-fld input[type="search"] { width: 100%; max-width: none; }
  .rc-fld-branch select { max-width: none; }
  .rc-period { flex-wrap: nowrap; }
  .rc-period > * { flex: 1 1 0; min-width: 0; }
  .rc-period > .rc-dash { flex: none; }
  .rc-pick, .rc-psearch, .rc-psearch input { max-width: none; width: 100%; }
  .rc-fld-run { margin: 0; }
  .rc-run { width: 100%; justify-content: center; }
  .rc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .rc-card { padding: 10px 12px; }
  .rc-card strong { font-size: 1.05rem; }
  .rc-thead { padding: 10px 12px; }
  .rc-tsearch { width: 100%; order: 3; }
  .rc-t { font-size: .84rem; }
  .rc-t th, .rc-t td { padding: 7px 9px; }
  .rc-t .rc-wide { min-width: 150px; }
}

/* ---------- โหมดมืด ---------- */
@media screen {
  html[data-theme="dark"] .rc-alert { color: #F3C969; }
  html[data-theme="dark"] .rc-orient button.on, html[data-theme="dark"] .rc-seg button.on { box-shadow: 0 1px 3px rgba(0,0,0,.5); }
}

/* =========================== พิมพ์ A4 =========================== */
@page rc-a4 {
  size: A4 portrait; margin: 12mm 10mm 14mm;
  @bottom-right { content: counter(page) " / " counter(pages); font-size: 8pt; color: #555; }
}
@page rc-a4l {
  size: A4 landscape; margin: 10mm 10mm 13mm;
  @bottom-right { content: counter(page) " / " counter(pages); font-size: 8pt; color: #555; }
}
@media print {
  html:is([data-print="rc"], [data-print="rc-land"]), html:is([data-print="rc"], [data-print="rc-land"]) body {
    page: rc-a4; margin: 0 !important; padding: 0 !important; height: auto !important; overflow: visible !important;
    background: #fff !important; color: #111 !important;
    --ink: #111; --muted: #555; --surface: #fff; --line: #CFCFCF; --chip: #F1F1F1; --bg: #fff;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  html[data-print="rc-land"], html[data-print="rc-land"] body { page: rc-a4l; }
  html:is([data-print="rc"], [data-print="rc-land"]):has(.rc-print) body *:not(:has(.rc-print)):not(.rc-print):not(.rc-print *) { display: none !important; }
  html:is([data-print="rc"], [data-print="rc-land"]):has(.rc-print) body *:has(.rc-print) {
    display: block !important; position: static !important; inset: auto !important;
    margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important;
    width: auto !important; max-width: none !important; min-width: 0 !important;
    height: auto !important; min-height: 0 !important; max-height: none !important;
    overflow: visible !important; background: none !important; box-shadow: none !important; transform: none !important; opacity: 1 !important;
  }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-print,
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-print * { visibility: visible !important; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-print { display: block !important; font-size: 9pt; color: #111; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-print .no-print { display: none !important; }

  /* หัวรายงาน */
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-print-head {
    display: flex !important; align-items: center; gap: 4mm; margin: 0 0 4mm; padding-bottom: 3mm; border-bottom: 1.5px solid #111;
  }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-logo { width: auto; max-width: 30mm; max-height: 16mm; object-fit: contain; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-print-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-print-title strong { font-size: 10pt; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-print-title h1 { margin: 0; font-size: 15pt; line-height: 1.25; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-print-title p { margin: 0; font-size: 9.5pt; font-weight: 600; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-print-meta { align-self: flex-end; color: #555; font-size: 7.5pt; text-align: right; white-space: nowrap; }

  /* การ์ด / หมายเหตุ */
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-view { display: block !important; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-cards { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5mm; margin-bottom: 4mm; }
  html[data-print="rc-land"] .rc-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-card { padding: 2mm 3mm; border: 1px solid #CFCFCF; border-radius: 2mm; box-shadow: none !important; background: #fff !important; break-inside: avoid; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-card strong { font-size: 11pt; color: #111 !important; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-card.est { border-style: dashed; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-card-label, html:is([data-print="rc"], [data-print="rc-land"]) .rc-card small { font-size: 7.5pt; white-space: normal; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-notes { margin-bottom: 3mm; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-note { font-size: 8pt; color: #444; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-alert { margin-bottom: 3mm; padding: 2mm 3mm; border: 1px solid #C9A227; background: #fff !important; color: #111 !important; font-size: 8.5pt; }

  /* ตาราง: หัวตารางซ้ำทุกหน้า, แถวไม่ขาดกลาง */
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-tsec { display: block !important; margin: 0 0 5mm; border-radius: 0; box-shadow: none !important; overflow: visible !important; background: none !important; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-thead { padding: 0 0 1.5mm; border: 0; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-thead h2 { font-size: 11pt; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-thead .fit-count { display: none; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-tscroll { overflow: visible !important; max-height: none !important; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-t { font-size: 8.5pt; width: 100%; border-collapse: collapse; }
  html[data-print="rc-land"] .rc-t { font-size: 8pt; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-t thead { display: table-header-group; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-t tr { break-inside: avoid; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-t th {
    position: static !important; padding: 1.4mm 1.8mm; background: #EDEDED !important; color: #111; font-size: 7.8pt;
    border-top: 1px solid #111; border-bottom: 1px solid #111; box-shadow: none; white-space: normal;
  }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-t td { padding: 1.2mm 1.8mm; border-bottom: 0.5px solid #D5D5D5; background: none !important; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-t .rc-wide { min-width: 0; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-sort { display: none !important; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-th-print { display: inline !important; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-si { display: none; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-r-group td { background: #F3F3F3 !important; color: #111; border-bottom: 0.5px solid #999; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-r-sub td { background: #F6F6F6 !important; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-r-total td { position: static !important; background: #EDEDED !important; border-top: 1.2px solid #111; border-bottom: 1.2px solid #111; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-r-warn td { background: #FBE9E7 !important; }
  html:is([data-print="rc"], [data-print="rc-land"]) .rc-r-link td:first-child { color: #111; font-weight: inherit; }
}
