/* ==========================================================================
   HRPM GUARD — FREE TOOLS (โหลดเฉพาะหน้า /tools)
   ใช้ตัวแปรสีและคอมโพเนนต์จาก style.css
   ========================================================================== */

.tool-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-darker) 100%);
  color: #FFFFFF;
  padding: 28px 0 44px;
}
.tool-hero h1 {
  color: #FFFFFF !important;
  font-size: 2.2rem;
  margin: 10px 0 14px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.tool-hero-lead {
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.1rem;
  max-width: 820px;
}
.tool-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 0.85rem;
}
@media (max-width: 767px) {
  .tool-hero { padding: 20px 0 30px; }
  .tool-hero h1 { font-size: 1.55rem; }
  .tool-hero-lead { font-size: 0.98rem; }
}

/* Breadcrumb */
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.75);
}
.breadcrumb li + li::before {
  content: '›';
  margin-right: 6px;
  color: rgba(255, 255, 255, 0.5);
}
.breadcrumb a { color: #BFD7FF; }
.breadcrumb a:hover { color: #FFFFFF; }

/* Layout: ฟอร์มซ้าย / ผลลัพธ์ขวา */
.tool-section { padding: 36px 0 56px; background: var(--bg-subtle); }
.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (min-width: 992px) {
  .tool-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
  .tool-result-sticky { position: sticky; top: 96px; }
}
.tool-card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  min-width: 0;
}
@media (max-width: 767px) {
  .tool-card { padding: 18px 16px; }
}
.tool-card h2 { font-size: 1.3rem; margin-bottom: 4px; }
.tool-card-sub { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 16px; }

.tool-fieldset {
  border: 0;
  box-shadow: inset 0 1px 0 var(--line-light);
  padding: 18px 0 4px;
  margin: 0;
  min-width: 0;
}
.tool-fieldset:first-of-type { box-shadow: none; padding-top: 6px; }
.tool-fieldset legend {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 1rem;
  padding: 0;
  margin-bottom: 12px;
  float: left;
  width: 100%;
}
.tool-fieldset legend + * { clear: both; }
.result-peek {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: var(--primary-tint);
  border: 1px solid #BFD7FF;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.92rem;
  color: var(--primary-dark);
}
.result-peek strong { font-family: var(--font-heading); font-size: 1.05rem; white-space: nowrap; }
.result-peek > span:last-child { white-space: nowrap; }
@media (min-width: 992px) { .result-peek { display: none; } }
.tool-card .form-row { margin-bottom: 12px; }
@media (min-width: 576px) {
  .form-row.three-cols { grid-template-columns: 1fr 1fr 1fr; }
}
.form-row.three-cols { grid-template-columns: 1fr 1fr; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); line-height: 1.45; }
.form-control[aria-invalid="true"] { border-color: var(--danger); background: #FFF6F7; }
.field-error { font-size: 0.8rem; color: var(--danger); }
.input-suffix { position: relative; }
.input-suffix .form-control { padding-right: 56px; }
.input-suffix span {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.82rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Segmented radio */
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.seg label {
  flex: 1 1 140px;
  position: relative;
  cursor: pointer;
}
.seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
}
.seg span {
  display: block;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.9rem;
  line-height: 1.35;
  transition: var(--transition);
  height: 100%;
}
.seg span strong { display: block; font-family: var(--font-heading); color: var(--primary-dark); }
.seg input:checked + span { border-color: var(--primary); background: var(--primary-tint); box-shadow: 0 0 0 3px rgba(11, 94, 215, 0.12); }
.seg input:focus-visible + span { outline: 3px solid rgba(11, 94, 215, 0.45); outline-offset: 2px; }

.check-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.92rem;
  margin: 6px 0;
}
.check-line input { margin-top: 5px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--primary); }

/* Result */
.result-summary {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.result-summary-label { font-size: 0.9rem; opacity: 0.85; }
.result-summary-value { font-family: var(--font-heading); font-size: 2rem; font-weight: 700; line-height: 1.2; }
.result-summary-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.85rem; opacity: 0.9; margin-top: 6px; }

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.result-table th, .result-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-light);
  text-align: left;
  vertical-align: top;
}
.result-table th { font-family: var(--font-heading); color: var(--primary-dark); font-weight: 600; background: var(--primary-tint); }
.result-table td.num, .result-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.result-table .formula { display: block; font-size: 0.78rem; color: var(--text-muted); }
.result-table tr.total td { font-weight: 700; color: var(--primary-dark); border-top: 2px solid var(--line); }
.result-table tr.deduct td.num { color: var(--danger); }
.result-table tr.net td { font-weight: 800; font-size: 1.02rem; color: #166534; background: #F0FAF4; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

.tool-alerts { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.tool-alert {
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.88rem;
  line-height: 1.55;
  border: 1px solid;
}
.tool-alert-danger { background: #FFF1F2; border-color: #FCA5A5; color: #9F1239; }
.tool-alert-warning { background: #FFFBEB; border-color: #FCD34D; color: #854D0E; }
.tool-alert-info { background: var(--primary-tint); border-color: #BFD7FF; color: #0A2D6B; }
.tool-notes { margin-top: 14px; font-size: 0.82rem; color: var(--text-muted); padding-left: 18px; list-style: disc; }
.tool-notes li { margin-bottom: 4px; }

.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.tool-actions .btn { padding: 10px 16px; font-size: 0.92rem; }
.btn-sm { padding: 8px 14px !important; font-size: 0.88rem !important; }
.tool-empty { color: var(--text-muted); text-align: center; padding: 30px 10px; }

/* Content */
.tool-content { padding: 56px 0; }
.tool-content .prose { max-width: 860px; margin: 0 auto; }
.prose h2 { font-size: 1.6rem; margin: 40px 0 14px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.2rem; margin: 24px 0 10px; }
.prose p { margin-bottom: 14px; color: var(--text); }
.prose ul, .prose ol { margin: 0 0 16px 22px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 6px; }
.prose table { width: 100%; border-collapse: collapse; margin: 10px 0 18px; font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--primary-tint); font-family: var(--font-heading); color: var(--primary-dark); }
.prose .callout {
  background: var(--primary-tint);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 16px 0;
}
.prose .callout-warn { background: #FFFBEB; border-left-color: var(--accent); }
.prose code { background: var(--line-light); padding: 1px 6px; border-radius: 4px; font-size: 0.9em; }
@media (max-width: 767px) {
  .tool-content { padding: 36px 0; }
  .prose h2 { font-size: 1.3rem; margin-top: 30px; }
}
.source-list { font-size: 0.9rem; }
.source-list li { margin-bottom: 8px; }
.source-meta { color: var(--text-muted); font-size: 0.82rem; }

/* CTA */
.tool-cta {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-darker) 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 32px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  margin: 40px auto 0;
  max-width: 1040px;
}
@media (min-width: 768px) {
  .tool-cta { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}
.tool-cta h2 { color: #FFFFFF; font-size: 1.45rem; margin: 0 0 8px; }
.tool-cta p { color: rgba(255, 255, 255, 0.85); margin: 0; }
.tool-cta-actions { display: flex; flex-direction: column; gap: 10px; }
.tool-cta-actions .btn { width: 100%; }
.btn-accent { background: var(--accent); color: #1B2433; }
.btn-accent:hover { background: var(--accent-hover); color: #1B2433; transform: translateY(-2px); }
@media (max-width: 767px) { .tool-cta { padding: 22px 18px; } }

/* Related / Tools grid */
.related-grid, .tools-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
@media (min-width: 640px) { .related-grid, .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 992px) { .tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.related-card, .tool-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  height: 100%;
}
.related-card:hover, .tool-tile:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); color: var(--text); }
.related-kind { font-size: 0.78rem; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 0.3px; }
.related-title { font-family: var(--font-heading); font-weight: 600; color: var(--primary-dark); line-height: 1.4; }
.tool-tile-icon { font-size: 1.8rem; line-height: 1; }
.tool-tile h2, .tool-tile h3 { font-size: 1.12rem; margin: 6px 0 2px; }
.tool-tile p { font-size: 0.92rem; color: var(--text-muted); flex: 1; }
.tool-tile-go { font-family: var(--font-heading); font-weight: 600; color: var(--primary); font-size: 0.92rem; }

/* Lead form (Tool 2) */
.lead-inline {
  border: 1px dashed var(--primary);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 18px;
  background: var(--primary-tint);
}
.lead-inline h3 { font-size: 1.1rem; margin-bottom: 6px; }
.lead-purpose { font-size: 0.82rem; color: var(--text-muted); margin: 8px 0 12px; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-status { font-size: 0.9rem; margin-top: 10px; }
.form-status.ok { color: var(--success); }
.form-status.err { color: var(--danger); }

/* Schedule grid (Tool 3) */
.sched-table { border-collapse: collapse; font-size: 0.8rem; min-width: 100%; }
.sched-table th, .sched-table td { border: 1px solid var(--line); padding: 4px 6px; text-align: center; white-space: nowrap; }
.sched-table th { background: var(--primary-tint); color: var(--primary-dark); font-family: var(--font-heading); position: sticky; top: 0; }
.sched-table td.name { text-align: left; font-weight: 600; position: sticky; left: 0; background: #FFFFFF; z-index: 1; }
.sched-table .weekend { background: #F8FAFC; }
.shift-D { background: #E8F1FF; color: #0A2D6B; font-weight: 700; }
.shift-N { background: #1E293B; color: #FFFFFF; font-weight: 700; }
.shift-M { background: #E8F1FF; color: #0A2D6B; font-weight: 700; }
.shift-A { background: #FEF3C7; color: #854D0E; font-weight: 700; }
.shift-O { color: var(--text-light); }
.shift-R { background: #ECFDF5; color: #065F46; font-weight: 700; }
.sched-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 0.82rem; margin: 10px 0; }
.sched-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sched-legend i { display: inline-block; width: 22px; height: 16px; border-radius: 3px; border: 1px solid var(--line); font-style: normal; text-align: center; font-size: 0.7rem; line-height: 14px; }
.cov-bad { background: #FFF1F2 !important; color: #9F1239 !important; font-weight: 700; }

/* QR (Tool 4) */
.qr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.qr-item { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px; text-align: center; background: #FFFFFF; }
.qr-item canvas, .qr-item img { width: 100%; height: auto; image-rendering: pixelated; }
.qr-item-title { font-family: var(--font-heading); font-weight: 600; color: var(--primary-dark); font-size: 0.92rem; margin-top: 6px; line-height: 1.35; word-break: break-word; }
.qr-item-code { font-size: 0.75rem; color: var(--text-muted); word-break: break-all; }
.qr-item .btn { margin-top: 8px; width: 100%; }
.cp-rows { display: flex; flex-direction: column; gap: 8px; }
.cp-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.cp-row .btn-icon { height: 42px; border: 1px solid var(--line); background: #FFFFFF; border-radius: var(--radius-md); cursor: pointer; color: var(--danger); font-size: 1.1rem; }

/* Checklist (Tool 5) */
.check-group { margin-bottom: 26px; }
.check-group h2 { font-size: 1.3rem; margin-bottom: 10px; }
.check-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  margin-bottom: 10px;
}
.check-item input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--success); }
.check-item label { cursor: pointer; }
.check-item-title { font-family: var(--font-heading); font-weight: 600; color: var(--primary-dark); display: block; }
.check-item-detail { font-size: 0.9rem; color: var(--text); margin-top: 4px; }
.check-item-src { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }
.check-item.done { border-color: #86EFAC; background: #F0FDF4; }
.progress { height: 10px; background: var(--line-light); border-radius: var(--radius-full); overflow: hidden; }
.progress > div { height: 100%; background: var(--success); width: 0; transition: width 0.3s ease; }
.status-pill { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); margin-left: 6px; vertical-align: middle; }
.status-verified { background: #DCFCE7; color: #166534; }
.status-pending { background: #FEF3C7; color: #854D0E; }

/* Print: พิมพ์เฉพาะผลลัพธ์ */
@media print {
  .topbar, .navbar, .site-footer, .mobile-bottom-bar, .cookie-banner, .mobile-nav-drawer, .mobile-nav-backdrop,
  .tool-hero, .tool-content, .tool-form-col, .tool-actions, .no-print, .lead-inline, .tool-cta { display: none !important; }
  body { padding: 0 !important; background: #FFFFFF !important; }
  .tool-section { padding: 0 !important; background: #FFFFFF !important; }
  .tool-layout { display: block !important; }
  .tool-card { border: 0 !important; box-shadow: none !important; padding: 0 !important; }
  .tool-result-sticky { position: static !important; }
  .print-only { display: block !important; }
  .result-summary { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table-scroll { overflow: visible !important; }
  a[href]::after { content: none !important; }
}
.print-only { display: none; }

/* Tool 3: ปุ่มในช่องตารางเวร */
.sched-table td { padding: 0; }
.sched-table td.name { padding: 4px 8px; }
.cell-btn {
  display: block;
  width: 100%;
  min-width: 28px;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
}
.cell-btn:hover { outline: 2px solid var(--primary); outline-offset: -2px; }
.cell-btn:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.tool-layout.single { grid-template-columns: minmax(0, 1fr) !important; }
@media print {
  .sched-table { font-size: 7pt; }
  .sched-table .shift-N { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.tool-actions .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ลิงก์ในเนื้อหาต้องแยกจากข้อความรอบข้างได้โดยไม่ใช้สีอย่างเดียว (WCAG 1.4.1) */
.prose a, .check-item-src a, .lead-purpose a, .form-hint a { text-decoration: underline; text-underline-offset: 2px; }

/* Performance: ไม่ต้องคำนวณ layout ของเนื้อหาใต้จอจนกว่าจะเลื่อนถึง (เนื้อหายังอยู่ใน HTML สำหรับ SEO) */
.tool-content, .tool-below { content-visibility: auto; contain-intrinsic-size: auto 1400px; }
@media print { .tool-content, .tool-below { content-visibility: visible; } }

/* แอตทริบิวต์ hidden ต้องชนะ display: grid/flex ของ .form-row/.form-group */
.tool-section [hidden] { display: none !important; }

/* ==========================================================================
   เอกสารสำหรับพิมพ์ / บันทึก PDF (A4 แนวตั้ง) — สร้างโดย JS แล้วแสดงเฉพาะตอนพิมพ์
   ออกแบบให้อ่านชัดทั้งพิมพ์สีและขาวดำ
   ========================================================================== */
.print-doc { display: none; }
@page wagedoc { size: A4 portrait; margin: 10mm 11mm 10mm; }
@page landdoc { size: A4 landscape; margin: 8mm 9mm; }
@media print {
  body.print-doc-mode > *:not(.print-doc) { display: none !important; }
  body.print-doc-mode { padding: 0 !important; background: #FFFFFF !important; }
  body.print-doc-mode .print-doc { display: block; page: wagedoc; }
  body.print-doc-mode .print-doc.landscape { page: landdoc; }
}
.print-doc {
  font-family: var(--font-body);
  color: #111827;
  font-size: 9pt;
  line-height: 1.4;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.pd-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12pt;
  padding-bottom: 6pt;
  border-bottom: 2.5pt solid #0A2D6B;
}
.pd-brand { display: flex; align-items: center; gap: 8pt; }
.pd-logo {
  width: 30pt; height: 30pt; border-radius: 6pt; background: #0A2D6B; color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
}
.pd-brand-name { font-family: var(--font-heading); font-weight: 700; font-size: 15pt; color: #0A2D6B; line-height: 1.1; }
.pd-brand-name span { color: #0B5ED7; }
.pd-brand-sub { font-size: 8pt; color: #4B5563; }
.pd-title { text-align: right; }
.pd-title h1 { font-family: var(--font-heading); font-size: 15pt; color: #0A2D6B; margin: 0; line-height: 1.2; }
.pd-title div { font-size: 8.4pt; color: #4B5563; }
.pd-summary {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border: 1pt solid #CBD5E1; border-radius: 4pt; margin: 8pt 0 2pt; overflow: hidden;
}
.pd-summary > div { padding: 4pt 10pt; border-right: 1pt solid #CBD5E1; }
.pd-summary > div:last-child { border-right: 0; background: #0A2D6B; color: #FFFFFF; }
.pd-summary small { display: block; font-size: 8pt; color: #4B5563; }
.pd-summary > div:last-child small { color: #DCE8FF; }
.pd-summary strong { font-family: var(--font-heading); font-size: 13pt; font-variant-numeric: tabular-nums; }
.pd-section { margin-top: 6pt; break-inside: avoid; }
.pd-end { break-inside: avoid; }
.pd-section h2 {
  font-family: var(--font-heading); font-size: 10.5pt; color: #0A2D6B; margin: 0 0 4pt;
  padding-left: 6pt; border-left: 3pt solid #0B5ED7; line-height: 1.3;
}
.pd-table { width: 100%; border-collapse: collapse; font-size: 8.8pt; }
.pd-table th, .pd-table td { border: 0.75pt solid #CBD5E1; padding: 2.6pt 6pt; vertical-align: top; text-align: left; }
.pd-table thead th { background: #E8EEF7; color: #0A2D6B; font-family: var(--font-heading); font-weight: 600; font-size: 8.8pt; }
.pd-table .c-no { width: 22pt; text-align: center; color: #4B5563; }
.pd-table .c-amt { width: 78pt; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pd-table .c-formula { color: #374151; font-size: 8.6pt; }
.pd-table tr.pd-sub td { background: #F3F4F6; font-weight: 700; }
.pd-table tr.pd-ded td.c-amt { color: #B91C1C; }
.pd-table tr.pd-net td { background: #0A2D6B; color: #FFFFFF; font-weight: 700; font-size: 10.5pt; border-color: #0A2D6B; }
.pd-table tr.pd-group td { background: #F9FAFB; font-weight: 700; color: #0A2D6B; font-size: 8.8pt; }
.pd-kv { width: 100%; border-collapse: collapse; font-size: 8.6pt; }
.pd-kv th, .pd-kv td { border: 0.75pt solid #CBD5E1; padding: 2.2pt 6pt; text-align: left; vertical-align: top; }
.pd-kv th { width: 24%; background: #F3F4F6; font-weight: 600; color: #1F2937; }
.pd-list { margin: 0; padding-left: 14pt; font-size: 7.8pt; color: #1F2937; line-height: 1.35; }
ol.pd-list { list-style: decimal; }
ul.pd-list { list-style: none; padding-left: 0; }
.pd-list li { margin-bottom: 1.5pt; }
.pd-tag { display: inline-block; font-size: 7.4pt; font-weight: 700; padding: 0 5pt; border-radius: 3pt; border: 0.75pt solid currentColor; margin-right: 4pt; }
.pd-tag.danger { color: #B91C1C; }
.pd-tag.warning { color: #92400E; }
.pd-tag.info { color: #1E40AF; }
.pd-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 24pt; margin-top: 8pt; }
.pd-sign div { text-align: center; font-size: 9pt; color: #374151; }
.pd-sign .line { border-bottom: 0.75pt dotted #6B7280; height: 16pt; margin-bottom: 2pt; }
.pd-foot { margin-top: 6pt; padding-top: 3pt; border-top: 0.75pt solid #CBD5E1; font-size: 7.6pt; color: #6B7280; display: flex; justify-content: space-between; gap: 10pt; }
.pd-foot span:last-child { white-space: nowrap; }

/* เอกสารพิมพ์: ตารางเวร (Tool 3) และตารางราคา (Tool 2) */
.pd-table.pd-compact th, .pd-table.pd-compact td { padding: 2.2pt 5pt; }
.pd-legend { display: flex; flex-wrap: wrap; gap: 4pt 14pt; font-size: 8pt; color: #374151; margin: 0 0 4pt; }
.pd-legend i { display: inline-block; min-width: 16pt; padding: 0 3pt; margin-right: 4pt; border: 0.75pt solid #94A3B8; border-radius: 2pt; text-align: center; font-style: normal; font-weight: 700; }
.pd-sched { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 7.6pt; }
.pd-sched th, .pd-sched td { border: 0.6pt solid #94A3B8; padding: 1.6pt 0; text-align: center; overflow: hidden; white-space: nowrap; }
.pd-sched thead th { background: #E8EEF7; color: #0A2D6B; font-weight: 700; line-height: 1.15; }
.pd-sched thead th small { display: block; font-weight: 400; font-size: 6.6pt; color: #4B5563; }
.pd-sched thead th.we { background: #DCE3EE; }
.pd-sched .nm { text-align: left; padding-left: 4pt; font-weight: 600; width: 92pt; text-overflow: ellipsis; }
.pd-sched .tot { width: 26pt; font-weight: 600; background: #F9FAFB; }
.pd-sched td.s-D, .pd-sched td.s-M { background: #E8F1FF; color: #0A2D6B; font-weight: 700; }
.pd-sched td.s-A { background: #FEF3C7; color: #78350F; font-weight: 700; }
.pd-sched td.s-N { background: #1E293B; color: #FFFFFF; font-weight: 700; }
.pd-sched td.s-O { color: #9CA3AF; }
.pd-sched td.bad { outline: 1.2pt solid #B91C1C; outline-offset: -1.2pt; }
.pd-sched tr.cov td { background: #F3F4F6; font-weight: 600; }
.pd-sched tr.cov td.short { background: #FEE2E2; color: #991B1B; }
.pd-sched tbody tr { break-inside: avoid; }
.pd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10pt; }
.pd-kv2 th { width: 13%; }
.pd-kv2 td { width: 37%; }
