/* Components: Modern Academic & Enterprise Styling (สไตล์ ext.html)
   ดูสวย สะอาด หรูหรา มีมิติ คมชัด รองรับทุกอุปกรณ์
*/

/* Page Head */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
.page-head__sub {
  color: var(--c-ink-3);
  font-size: var(--fs-sm);
  margin-top: 2px;
}
.page-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}
.crumb {
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
  margin-bottom: var(--s-2);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.crumb a { color: var(--c-secondary); }
.crumb a:hover { text-decoration: underline; }

/* Notice Banner (แบบ Top Notice ใน ext.html) */
.notice-banner {
  background: var(--c-surface-container);
  border: 1px solid var(--c-line-soft);
  color: var(--c-primary);
  border-radius: var(--r-lg);
  padding: var(--s-2) var(--s-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  font-size: var(--fs-xs);
  box-shadow: var(--shadow-xs);
}

/* Master Status Banner (ดึงจาก ext.html Hero Section) */
.master-banner {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-secondary) 100%);
  color: #ffffff;
  border-radius: var(--r-xl);
  padding: var(--s-5);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--s-5);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}
.master-banner::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 184, 254, 0.25) 0%, transparent 70%);
  pointer-events: none;
}
.master-banner__left {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  z-index: 1;
}
.master-banner__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r-lg);
  background: rgba(204, 229, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
  color: #cce5ff;
  flex: none;
}
.master-banner__content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.master-banner__title {
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(214, 227, 255, 0.85);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.master-banner__desc {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: #ffffff;
}
.master-banner__metric {
  background: rgba(0, 32, 70, 0.45);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--r-lg);
  padding: var(--s-2) var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-4);
  z-index: 1;
}
.master-banner__metric-val {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}
.master-banner__metric-lbl {
  font-size: var(--fs-xs);
  color: rgba(214, 227, 255, 0.8);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--tap);
  padding: 0 var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--c-line-strong);
  background: var(--c-surface);
  color: var(--c-ink);
  font: inherit;
  font-weight: 600;
  font-size: var(--fs-sm);
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all var(--t-fast);
}
.btn:hover {
  background: var(--c-surface-low);
  border-color: var(--c-ink-dim);
  color: var(--c-primary);
  box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 32, 70, 0.2);
}
.btn--primary:hover {
  background: var(--c-primary-hover);
  border-color: var(--c-primary-hover);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 32, 70, 0.28);
}

.btn--secondary {
  background: var(--c-secondary);
  border-color: var(--c-secondary);
  color: #ffffff;
}
.btn--secondary:hover {
  background: var(--c-secondary-hover);
  border-color: var(--c-secondary-hover);
  color: #ffffff;
}

.btn--danger {
  background: #ffffff;
  border-color: var(--c-danger-line);
  color: var(--c-danger);
}
.btn--danger:hover {
  background: var(--c-danger-bg);
  border-color: var(--c-danger);
  color: var(--c-danger);
}

.btn--danger-solid {
  background: var(--c-danger);
  border-color: var(--c-danger);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(186, 26, 26, 0.2);
}
.btn--danger-solid:hover {
  background: #9b1414;
  border-color: #9b1414;
  color: #ffffff;
}

.btn--ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.btn--ghost:hover {
  background: var(--c-surface-low);
  border-color: transparent;
}

.btn--sm {
  min-height: 34px;
  padding: 0 var(--s-3);
  font-size: var(--fs-xs);
  border-radius: var(--r-sm);
}
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.icon-btn {
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border-radius: var(--r-md);
}

/* Cards & Bento Panels (แบบ ext.html) */
.panel {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--t-fast);
}
.panel + .panel { margin-top: var(--s-5); }
.panel:hover { box-shadow: var(--shadow-md); }

.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--c-line-soft);
  background: #ffffff;
}
.panel__head h2, .panel__head h3 {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--c-primary);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.panel__body { padding: var(--s-5); }
.panel__foot {
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--c-line-soft);
  background: var(--c-surface-low);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  justify-content: flex-end;
  align-items: center;
}
.panel--flush .panel__body { padding: 0; }

/* Grid helpers */
.cols { display: grid; gap: var(--s-5); }
.cols--main-side {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}
.cols--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack > * + * { margin-top: var(--s-4); }

@media (max-width: 1100px) {
  .cols--main-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .cols--2, .cols--3 { grid-template-columns: minmax(0, 1fr); }
}

/* Status Badge Pills (สไตล์ Material 3 Soft Containers) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px 3px 10px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--c-neutral-bg);
  color: var(--c-neutral);
  border: 1px solid var(--c-neutral-line);
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge--info {
  background: var(--c-info-bg);
  color: var(--c-info);
  border-color: var(--c-info-line);
}
.badge--warn {
  background: var(--c-warn-bg);
  color: var(--c-warn);
  border-color: var(--c-warn-line);
}
.badge--danger {
  background: var(--c-danger-bg);
  color: var(--c-danger);
  border-color: var(--c-danger-line);
}
.badge--ok {
  background: var(--c-ok-bg);
  color: var(--c-ok);
  border-color: var(--c-ok-line);
}
.badge--outline {
  background: transparent;
  border: 1px solid currentColor;
}
.chip {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
  background: var(--c-surface-low);
  font-weight: 500;
}

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--s-4);
}
.field > label, .field__label {
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--c-ink);
}
.field__hint {
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
}
.req { color: var(--c-danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 8px var(--s-3);
  font: inherit;
  color: var(--c-ink);
  background: #ffffff;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  transition: all var(--t-fast);
}
.textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}
.input:hover, .select:hover, .textarea:hover {
  border-color: var(--c-secondary);
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--c-secondary);
  box-shadow: 0 0 0 3px rgba(0, 99, 152, 0.15);
  outline: none;
}
.input[disabled], .select[disabled] {
  background: var(--c-surface-low);
  color: var(--c-ink-3);
  cursor: not-allowed;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 767px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  min-height: var(--tap);
  padding: var(--s-2) 0;
  cursor: pointer;
}
.check input {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  accent-color: var(--c-secondary);
  flex: none;
}
.check__body small {
  display: block;
  color: var(--c-ink-3);
  font-size: var(--fs-xs);
  margin-top: 2px;
}

.option-card {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  background: #ffffff;
  cursor: pointer;
  min-height: var(--tap);
  box-shadow: var(--shadow-xs);
  transition: all var(--t-fast);
}
.option-card:hover {
  border-color: var(--c-secondary);
  background: var(--c-surface-low);
}
.option-card:has(input:checked) {
  border-color: var(--c-secondary);
  background: var(--c-accent-soft);
  box-shadow: var(--shadow-sm);
}
.option-card input {
  width: 20px;
  height: 20px;
  accent-color: var(--c-secondary);
  flex: none;
  margin-top: 3px;
}

/* Filter Bar */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--c-line-soft);
  background: #ffffff;
  align-items: center;
}
.filters .input, .filters .select {
  width: auto;
  min-width: 150px;
  flex: 1 1 150px;
  max-width: 260px;
  min-height: 38px;
}
.filters .input--search {
  max-width: 320px;
  flex-basis: 220px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: var(--s-1);
  overflow-x: auto;
  border-bottom: 1px solid var(--c-line-soft);
  padding: 0 var(--s-4);
  background: #ffffff;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-3);
  color: var(--c-ink-3);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  font-size: var(--fs-sm);
  font-weight: 600;
  background: none;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--t-fast);
}
.tab:hover { color: var(--c-ink); }
.tab[aria-selected="true"], .tab[aria-current="page"] {
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
  font-weight: 700;
}
.tab__count {
  background: var(--c-surface-container);
  color: var(--c-primary);
  border-radius: var(--r-full);
  padding: 1px 8px;
  font-size: var(--fs-xs);
  font-weight: 700;
}
.tab-panel[hidden] { display: none; }

/* Tables (Clean & Modern with Subtle Gray Borders both Horizontal and Vertical) */
.table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: var(--r-md);
  background: #ffffff;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 12px 18px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  font-size: var(--fs-sm);
}
.table th:last-child,
.table td:last-child {
  border-right: none;
}
.table th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--c-ink-2);
  letter-spacing: 0.02em;
  white-space: nowrap;
  border-bottom: 1px solid #cbd5e1;
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.table tbody tr {
  background: #ffffff;
  transition: background var(--t-fast);
}
.table tbody tr:hover {
  background: #f8fafc;
}

/* ตารางแบบมีเส้นตารางล้อมรอบแนวตั้ง-แนวนอน (Grid / Report Table) สไตล์เส้นบางสีเทา */
.table--bordered,
.table-grid {
  border-collapse: collapse;
  border: 1px solid #cbd5e1;
}
.table--bordered th, .table--bordered td,
.table-grid th, .table-grid td {
  border: 1px solid #e2e8f0;
}
.table--bordered th,
.table-grid th {
  border-bottom: 1px solid #cbd5e1;
  background: #f8fafc;
}
.table .cell-main {
  font-weight: 600;
  color: var(--c-primary);
  text-decoration: none;
  display: inline-block;
}
.table .cell-main:hover {
  color: var(--c-secondary);
  text-decoration: underline;
}
.table .cell-sub {
  display: block;
  color: var(--c-ink-3);
  font-size: var(--fs-xs);
  margin-top: 2px;
}
.table .actions {
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 767px) {
  .table--stack thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td {
    display: block; width: 100%;
  }
  .table--stack tr {
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--c-line);
    margin-bottom: var(--s-2);
    border-radius: var(--r-md);
    background: #ffffff;
    box-shadow: var(--shadow-xs);
  }
  .table--stack td {
    padding: 4px 0;
    border: 0;
    display: flex;
    gap: var(--s-3);
    justify-content: space-between;
    text-align: right;
  }
  .table--stack td::before {
    content: attr(data-label);
    color: var(--c-ink-3);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-align: left;
    flex: none;
  }
  .table--stack td.cell-title {
    display: block;
    text-align: left;
    padding-bottom: var(--s-2);
    border-bottom: 1px dashed var(--c-line-soft);
    margin-bottom: 6px;
  }
  .table--stack td.cell-title::before { content: none; }
  .table--stack td.actions {
    justify-content: flex-end;
    padding-top: var(--s-2);
  }
  .table--stack td.actions::before { content: none; }
}

/* Description List */
.dl {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: var(--s-3) var(--s-4);
  margin: 0;
  font-size: var(--fs-sm);
}
.dl dt { color: var(--c-ink-3); font-weight: 500; }
.dl dd { margin: 0; font-weight: 600; color: var(--c-ink); }
@media (max-width: 520px) {
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dd { margin-bottom: var(--s-3); }
}

/* Callouts */
.callout {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--c-line);
  border-left-width: 4px;
  background: #ffffff;
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-xs);
}
.callout--info {
  border-left-color: var(--c-info);
  background: var(--c-info-bg);
  border-color: var(--c-info-line);
}
.callout--warn {
  border-left-color: var(--c-warn);
  background: var(--c-warn-bg);
  border-color: var(--c-warn-line);
}
.callout--danger {
  border-left-color: var(--c-danger);
  background: var(--c-danger-bg);
  border-color: var(--c-danger-line);
}
.callout--ok {
  border-left-color: var(--c-ok);
  background: var(--c-ok-bg);
  border-color: var(--c-ok-line);
}
.callout--gate {
  border-left-color: var(--c-primary);
  background: var(--c-surface-container);
  border-color: var(--c-surface-highest);
}
.callout strong { display: block; margin-bottom: 2px; color: var(--c-ink); }
.note-open {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-secondary);
  background: var(--c-surface-high);
  border: 1px solid var(--c-secondary-container);
  padding: 1px 7px;
  border-radius: var(--r-sm);
  display: inline-block;
}

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 var(--s-4) var(--s-5);
  font-size: var(--fs-sm);
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-secondary);
  box-shadow: 0 0 0 3px var(--c-secondary-container);
}
.timeline li::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 22px;
  bottom: 0;
  width: 2px;
  background: var(--c-line);
}
.timeline li:last-child::after { display: none; }
.timeline li.is-pending::before {
  background: #ffffff;
  border: 2px solid var(--c-line-strong);
  box-shadow: none;
}
.timeline time, .timeline .when {
  display: block;
  color: var(--c-ink-3);
  font-size: var(--fs-xs);
  margin-top: 2px;
}

/* Stepper */
.stepper {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}
.stepper li {
  flex: 1;
  position: relative;
  text-align: center;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-ink-3);
  padding-top: 36px;
  min-width: 0;
}
.stepper li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 2px solid var(--c-line-strong);
  font-weight: 700;
  font-size: var(--fs-xs);
  z-index: 1;
}
.stepper li::after {
  content: "";
  position: absolute;
  top: 13px;
  left: calc(-50% + 14px);
  right: calc(50% + 14px);
  height: 2px;
  background: var(--c-line-strong);
}
.stepper li:first-child::after { display: none; }
.stepper li.is-done { color: var(--c-primary); }
.stepper li.is-done::before {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #ffffff;
  content: "✓";
}
.stepper li.is-done::after, .stepper li.is-current::after {
  background: var(--c-primary);
}
.stepper li.is-current {
  color: var(--c-secondary);
  font-weight: 700;
}
.stepper li.is-current::before {
  border-color: var(--c-secondary);
  color: var(--c-secondary);
  box-shadow: 0 0 0 4px var(--c-secondary-container);
}
.stepper li.is-stop::before {
  background: var(--c-danger);
  border-color: var(--c-danger);
  color: #ffffff;
  content: "!";
}
.stepper li.is-stop { color: var(--c-danger); font-weight: 700; }
@media (max-width: 520px) { .stepper li { font-size: 0.7rem; } }

/* Photo Slots (หลักฐานก่อน/หลัง) */
.photo-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
.photo-slot {
  border: 2px dashed var(--c-line-strong);
  border-radius: var(--r-lg);
  background: var(--c-surface-low);
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-4);
  text-align: center;
  transition: all var(--t-fast);
}
.photo-slot__label { font-weight: 700; font-size: var(--fs-sm); color: var(--c-primary); }
.photo-slot__state { font-size: var(--fs-xs); color: var(--c-ink-3); }
.photo-slot.is-filled {
  border-style: solid;
  border-color: var(--c-ok);
  background: #f0faf4;
}
.photo-slot.is-filled .photo-slot__state { color: var(--c-ok); font-weight: 600; }
@media (max-width: 420px) { .photo-pair { grid-template-columns: minmax(0, 1fr); } }

/* Category Block ในใบงาน */
.cat {
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  transition: all var(--t-fast);
}
.cat + .cat { margin-top: var(--s-4); }
.cat:hover { box-shadow: var(--shadow-sm); }
.cat__head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-3);
  align-items: center;
  justify-content: space-between;
  padding: var(--s-3) var(--s-4);
  background: var(--c-surface-low);
  border-bottom: 1px solid var(--c-line-soft);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.cat__body { padding: var(--s-3) var(--s-4) var(--s-4); font-size: var(--fs-sm); }
.cat__meta { color: var(--c-ink-3); font-size: var(--fs-xs); }
.item-list {
  margin: var(--s-2) 0 0;
  padding: 0;
  list-style: none;
}
.item-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  padding: 8px var(--s-3);
  border-radius: var(--r-md);
  background: var(--c-surface-low);
  margin-bottom: 6px;
  font-size: var(--fs-sm);
  font-weight: 500;
}
.item-list li:last-child { margin-bottom: 0; }

/* Queue */
.queue { list-style: none; margin: 0; padding: 0; }
.queue li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--c-line-soft);
  transition: background var(--t-fast);
}
.queue li:hover { background: #f8fbff; }
.queue li:last-child { border-bottom: 0; }
.queue__main { flex: 1 1 260px; min-width: 0; }
.queue__title {
  font-weight: 700;
  text-decoration: none;
  color: var(--c-primary);
  font-size: var(--fs-md);
}
.queue__title:hover { color: var(--c-secondary); text-decoration: underline; }

/* Bar Progress Charts (รายงานผู้บริหาร) */
.bar-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 56px;
  gap: var(--s-3);
  align-items: center;
  padding: 8px 0;
  font-size: var(--fs-sm);
  font-weight: 500;
}
.bar-track {
  height: 12px;
  background: var(--c-surface-container);
  border-radius: var(--r-full);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--c-secondary);
  border-radius: var(--r-full);
  width: calc(var(--v, 0) * 1%);
  transition: width 0.6s ease;
}
.bar-fill--warn { background: #e0b04a; }
.bar-fill--danger { background: var(--c-danger); }
@media (max-width: 520px) {
  .bar-row { grid-template-columns: minmax(0, 1fr) 48px; }
  .bar-row .bar-track { grid-column: 1 / -1; order: 3; }
}

/* Dialog / Modal */
dialog.dialog {
  border: 0;
  padding: 0;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop);
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  color: var(--c-ink);
  background: #ffffff;
}
dialog.dialog::backdrop {
  background: rgba(13, 28, 46, 0.5);
  backdrop-filter: blur(4px);
}
.dialog__head {
  padding: var(--s-5) var(--s-5) var(--s-2);
}
.dialog__head h2 { font-size: var(--fs-lg); }
.dialog__body {
  padding: var(--s-2) var(--s-5) var(--s-5);
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.dialog__foot {
  padding: var(--s-3) var(--s-5);
  background: var(--c-surface-low);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--s-2);
  border-top: 1px solid var(--c-line-soft);
}

/* Toast */
.toast-region {
  position: fixed;
  right: var(--s-4);
  bottom: var(--s-4);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  max-width: calc(100vw - 32px);
}
.toast {
  background: var(--c-primary);
  color: #ffffff;
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  animation: toast-in var(--t-base) ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* Empty State */
.empty {
  padding: var(--s-6) var(--s-4);
  text-align: center;
  color: var(--c-ink-3);
}
.empty strong {
  display: block;
  color: var(--c-primary);
  margin-bottom: var(--s-1);
  font-size: var(--fs-md);
}

/* Utilities */
.mt-1 { margin-top: var(--s-1); }
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.block { display: block; }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.plain-list { margin: 0; padding-left: var(--s-5); }

a.panel-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: all var(--t-fast);
}
a.panel-link:hover {
  border-color: var(--c-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
a.panel-link h2 { color: var(--c-primary); }
a.panel-link:hover h2 { color: var(--c-secondary); }

.action-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  margin-top: var(--s-5);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  z-index: 10;
}

/* ==========================================================================
   UX Additions: Non-IT Friendly Form Configurer & Bento Tracking
   ========================================================================== */

/* Type Selector Cards (สำหรับ Non-IT ให้เลือกชนิดข้อมูลเข้าใจง่าย) */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--s-3);
  margin-top: 6px;
}
.type-card {
  border: 2px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: var(--s-3) var(--s-2);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--t-fast);
  user-select: none;
}
.type-card:hover {
  border-color: var(--c-secondary-container);
  background: var(--c-surface-low);
  transform: translateY(-2px);
}
.type-card.is-active,
.type-card:has(input[type="radio"]:checked) {
  border-color: var(--c-secondary);
  background: #f0f7ff;
  box-shadow: 0 0 0 2px rgba(0, 99, 152, 0.15);
}
.type-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--c-surface-container);
  color: var(--c-secondary);
  display: grid;
  place-items: center;
  font-size: 20px;
}
.type-card.is-active .type-card__icon,
.type-card:has(input[type="radio"]:checked) .type-card__icon {
  background: var(--c-secondary);
  color: #ffffff;
}
.type-card__title {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--c-ink);
}
.type-card__desc {
  font-size: 11px;
  color: var(--c-ink-3);
  line-height: 1.3;
}

/* Smart Unit Chips (ปุ่มลัดเลือกหน่วยนับยอดนิยม) */
.unit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.unit-chip {
  padding: 4px 12px;
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--c-surface-low);
  border: 1px solid var(--c-line);
  border-radius: var(--r-full);
  color: var(--c-ink-2);
  cursor: pointer;
  transition: all var(--t-fast);
}
.unit-chip:hover {
  background: var(--c-surface-high);
  color: var(--c-primary);
  border-color: var(--c-secondary-container);
}
.unit-chip.is-active {
  background: var(--c-secondary);
  color: #ffffff;
  border-color: var(--c-secondary);
}

/* Friendly Option Check/Toggle */
.opt-card {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: #ffffff;
  cursor: pointer;
  transition: all var(--t-fast);
}
.opt-card:hover {
  background: var(--c-surface-low);
  border-color: var(--c-line-strong);
}
.opt-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--c-secondary);
  cursor: pointer;
}
.opt-card__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.opt-card__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-ink);
}
.opt-card__desc {
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
}

/* Live Preview Box (กล่องแสดงตัวอย่างสดสำหรับ User Non-IT) */
.live-preview {
  border: 2px dashed var(--c-secondary-container);
  border-radius: var(--r-lg);
  background: #f7faff;
  padding: var(--s-4);
  position: relative;
}
.live-preview__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-secondary);
  background: #ffffff;
  border: 1px solid var(--c-secondary-container);
  border-radius: var(--r-sm);
  padding: 2px 8px;
  margin-bottom: var(--s-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Category Grid & Cards (สำหรับ categories.html) */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--s-4);
}
.cat-card {
  border: 1px solid var(--c-line);
  border-radius: var(--r-xl);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  transition: all var(--t-fast);
}
.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--c-secondary-container);
}
.cat-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.cat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-lg);
  background: var(--c-surface-container);
  color: var(--c-primary);
  display: grid;
  place-items: center;
  font-size: 24px;
  flex: none;
}
.cat-card__title {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1.2;
}
.cat-card__desc {
  font-size: var(--fs-sm);
  color: var(--c-ink-3);
  min-height: 38px;
}
.cat-card__meta {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  background: var(--c-surface-low);
  border-radius: var(--r-md);
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
}
.cat-card__items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

/* Timeline V2 (สไตล์หรูหรา 4 ขั้นตอนแบบ ext.html) */
.timeline-v2 {
  position: relative;
  list-style: none;
  padding: 0 0 0 32px;
  margin: 0;
}
.timeline-v2::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  bottom: 24px;
  width: 2px;
  background: var(--c-surface-highest);
}
.timeline-v2__item {
  position: relative;
  padding-bottom: var(--s-5);
}
.timeline-v2__item:last-child {
  padding-bottom: 0;
}
.timeline-v2__dot {
  position: absolute;
  left: -32px;
  top: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  background: #ffffff;
  border: 2px solid var(--c-line-strong);
  color: var(--c-ink-3);
  z-index: 1;
}
.timeline-v2__item.is-done .timeline-v2__dot {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #ffffff;
}
.timeline-v2__item.is-active .timeline-v2__dot {
  background: var(--c-secondary-container);
  border-color: var(--c-secondary);
  color: var(--c-primary);
  box-shadow: 0 0 0 4px var(--c-secondary-fixed);
}
.timeline-v2__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: 3px;
}
.timeline-v2__title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--c-ink);
}
.timeline-v2__item.is-active .timeline-v2__title {
  color: var(--c-secondary);
}
.timeline-v2__desc {
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
  line-height: 1.5;
}
.timeline-v2__time {
  font-size: 11px;
  color: var(--c-ink-3);
  margin-top: 4px;
  display: block;
}

/* Staff Assignment Card */
.staff-card {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-lg);
  background: var(--c-surface-low);
  border: 1px solid var(--c-line-soft);
}
.staff-card__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--c-primary-container);
  color: var(--c-on-primary, #ffffff);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: var(--fs-xs);
  flex: none;
}
.staff-card__info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.staff-card__name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-ink);
}
.staff-card__role {
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
}

/* Venue Image Preview Card (ตาม ext.html) */
.venue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-4);
  margin-top: var(--s-3);
}
.venue-photo {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  height: 170px;
  background: var(--c-surface-container);
  border: 1px solid var(--c-line-soft);
  box-shadow: var(--shadow-xs);
}
.venue-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.venue-photo:hover img {
  transform: scale(1.04);
}
.venue-photo__overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--s-2) var(--s-3);
  background: linear-gradient(to top, rgba(0, 32, 70, 0.85) 0%, transparent 100%);
  color: #ffffff;
  font-size: var(--fs-xs);
  font-weight: 600;
}

/* ==========================================================================
   Official Government Document Section & Form Item Rows (แบบรูปที่ 4)
   ========================================================================== */
.doc-section-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--r-md);
  margin-top: var(--s-4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}
.doc-section-card__head {
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.doc-section-card__head h2 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--c-primary);
  margin: 0;
}
.doc-section-card__head .supervisor-meta {
  font-size: 12.5px;
  color: #475569;
}
.doc-section-card__desc {
  padding: 8px 18px;
  font-size: 12.5px;
  color: #64748b;
  background: #fafafa;
  border-bottom: 1px dashed #e2e8f0;
}
.doc-section-card__body {
  padding: 14px 18px;
}
.doc-item-table {
  width: 100%;
  border-collapse: collapse;
}
.doc-item-table tr {
  border-bottom: 1px dashed #e2e8f0;
  transition: background 0.15s ease;
}
.doc-item-table tr:last-child {
  border-bottom: none;
}
.doc-item-table tr:hover {
  background: #f8fafc;
}
.doc-item-table td {
  padding: 8px 6px;
  vertical-align: middle;
  font-size: 13.5px;
  color: #334155;
}
.doc-item-table .td-check {
  width: 32px;
  text-align: center;
}
.doc-item-table .td-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--c-primary);
}
.doc-item-table .td-name {
  font-weight: 500;
  color: #1e293b;
}
.doc-item-table .td-dots {
  color: #94a3b8;
  letter-spacing: 1px;
  user-select: none;
  font-family: monospace;
}
.doc-item-table .td-input {
  width: 100px;
  text-align: right;
}
.doc-item-table .td-input .input {
  min-height: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  text-align: center;
  font-weight: 600;
}
.doc-item-table .td-unit {
  width: 70px;
  font-size: 13px;
  color: #64748b;
  padding-left: 8px;
}

/* Document Paper (A4 style look & feel) */
.doc-sheet {
  background: #ffffff;
  border: 1px solid #dbe2ea;
  border-radius: var(--r-lg);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  position: relative;
}
.doc-sheet__header {
  padding: 12px 18px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1.5px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.doc-sheet__title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--c-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.doc-sheet__meta {
  font-size: 11.5px;
  color: #475569;
  font-weight: 500;
}
.doc-sheet__subbar {
  padding: 6px 18px;
  background: #fbfcfe;
  font-size: 11.5px;
  color: #64748b;
  border-bottom: 1px dashed #e2e8f0;
}
.doc-sheet__body {
  padding: 6px 18px 16px;
}
.doc-cat-divider {
  padding: 8px 12px 5px;
  margin-top: 10px;
  background: rgba(0, 51, 102, 0.03);
  border-left: 3px solid var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.doc-cat-divider h3 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--c-primary);
}

/* Info card clean metadata list */
.meta-card {
  background: #ffffff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.meta-list {
  display: flex;
  flex-direction: column;
}
.meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13.5px;
  line-height: 1.5;
}
.meta-row:last-child {
  border-bottom: none;
}
.meta-row__label {
  color: #64748b;
  font-weight: 500;
  flex-shrink: 0;
  width: 110px;
}
.meta-row__value {
  color: #1e293b;
  font-weight: 600;
  text-align: right;
  flex-grow: 1;
  word-break: break-word;
}

/* Polished Timeline */
.timeline-card {
  background: #ffffff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.timeline-list {
  list-style: none;
  margin: 0;
  padding: 18px 20px 14px;
}
.timeline-item {
  position: relative;
  padding-left: 28px;
  padding-bottom: 20px;
}
.timeline-item:last-child {
  padding-bottom: 4px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.15);
  z-index: 2;
}
.timeline-item.is-danger::before {
  background: var(--c-danger);
  box-shadow: 0 0 0 3px rgba(186, 26, 26, 0.15);
}
.timeline-item.is-ok::before {
  background: var(--c-ok);
  box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.15);
}
.timeline-item::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 16px;
  bottom: 0;
  width: 1.5px;
  background: #e2e8f0;
}
.timeline-item:last-child::after {
  display: none;
}
.timeline-item__title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}
.timeline-item__meta {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

/* ==========================================================================
   Clean Document Summary Table (แสดงเฉพาะที่เลือก เรียบร้อย เป็นระเบียบ ไม่ใช้ input)
   ========================================================================== */
.doc-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}
.doc-summary-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 11.5px;
  padding: 8px 12px;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #cbd5e1;
  text-align: left;
}
.doc-summary-table th.num {
  text-align: right;
}
.doc-summary-table td {
  padding: 8px 12px;
  font-size: 12.5px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}
.doc-summary-table tr:hover td {
  background: #f8fafc;
}
.doc-summary-table tr:last-child td {
  border-bottom: none;
}
.doc-summary-table .col-idx {
  width: 38px;
  color: #94a3b8;
  font-size: 11.5px;
  text-align: center;
}
.doc-summary-table .col-name {
  font-weight: 500;
  color: #1e293b;
}
.doc-summary-table .col-amount {
  text-align: right;
  white-space: nowrap;
}
.doc-summary-table .col-amount strong {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--c-primary);
  font-size: 13.5px;
  margin-right: 4px;
}
.doc-summary-table .col-amount span.unit {
  color: #64748b;
  font-size: 12px;
}

/* ==========================================================================
   MFU Official A4 Print Simulation (@media print & Modal Preview)
   ========================================================================== */
.print-only {
  display: none !important;
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-family: var(--f-base), 'Bai Jamjuree', 'TH Sarabun New', sans-serif !important;
    font-size: 13pt !important;
    line-height: 1.5 !important;
  }
  @page {
    size: A4 portrait;
    margin: 20mm 15mm 20mm 15mm;
  }
  .app__sidebar,
  .sidebar,
  .app-header,
  .page-head,
  .notice-banner,
  .master-banner,
  .cols--main-side > aside,
  .skip-link,
  #venue-gallery-heading,
  section[aria-labelledby="venue-gallery-heading"],
  .dialog,
  button,
  .btn {
    display: none !important;
  }
  .app, .app__body, .content, .cols, .cols--main-side, .cols--main-side > div {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }
  .doc-sheet {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
}

/* Print Sheet Container (A4 Layout) */
.mfu-a4-doc {
  background: #ffffff;
  color: #1e293b;
  font-family: var(--f-base), 'Bai Jamjuree', sans-serif;
  line-height: 1.55;
  width: 100%;
}
.mfu-a4-doc__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 2px solid #003366;
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.mfu-a4-doc__logo-box {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mfu-a4-doc__emblem {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #003366;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  border: 2px solid #d4af37;
  flex-shrink: 0;
}
.mfu-a4-doc__org h1 {
  font-size: 16px;
  font-weight: 800;
  color: #003366;
  margin: 0;
  line-height: 1.25;
}
.mfu-a4-doc__org p {
  font-size: 12px;
  color: #475569;
  margin: 3px 0 0 0;
}
.mfu-a4-doc__docno {
  text-align: right;
  font-size: 11.5px;
  color: #334155;
}
.mfu-a4-doc__docno strong {
  display: block;
  font-size: 14.5px;
  color: #003366;
  font-weight: 700;
}
.mfu-a4-doc__title {
  text-align: center;
  margin: 16px 0;
}
.mfu-a4-doc__title h2 {
  font-size: 17px;
  font-weight: 800;
  color: #003366;
  margin: 0;
  letter-spacing: 0.02em;
}
.mfu-a4-doc__title span {
  font-size: 12px;
  color: #64748b;
  display: block;
  margin-top: 3px;
}
.mfu-a4-doc__meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12.5px;
  margin-bottom: 16px;
}
.mfu-a4-doc__meta-item {
  display: flex;
  gap: 8px;
}
.mfu-a4-doc__meta-item span.lbl {
  color: #64748b;
  min-width: 105px;
  font-weight: 500;
}
.mfu-a4-doc__meta-item span.val {
  color: #0f172a;
  font-weight: 600;
}
.mfu-a4-doc__sec-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #003366;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 4px;
  margin: 16px 0 8px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mfu-a4-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 16px;
}
.mfu-a4-table th, .mfu-a4-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 10px;
}
.mfu-a4-table th {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 700;
  text-align: center;
}
.mfu-a4-table td.text-center { text-align: center; }
.mfu-a4-table td.text-right { text-align: right; }
.mfu-a4-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 28px;
  padding-top: 10px;
  page-break-inside: avoid;
}
.mfu-a4-signature-box {
  text-align: center;
  font-size: 12px;
  color: #334155;
  line-height: 1.6;
}
.mfu-a4-signature-box .sign-line {
  margin: 40px auto 6px;
  width: 180px;
  border-bottom: 1px dotted #475569;
}



