/* ---------- PAGE + GLOBAL ---------- */

/* ---------- PAGE + GLOBAL ---------- */

@page {
  size: A4;
  margin: 10mm 10mm 18mm 10mm;
}

* {
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  font-size: 10px;
  color: #000;
}

/* ---------- BODY BACKGROUND ---------- */

/* Screen preview (grey workspace) */
body.screen {
  background: #e5e5e5;
}

/* PDF render (pure white) */
body.pdf {
  background: #ffffff;
}

/* ---------- PAGE WRAPPER ---------- */

.page {
  page-break-after: always;
  background: #ffffff;
  padding: 4mm;
  min-height: 270mm;
  margin: 0 auto 12px;   /* spacing ONLY for screen */
}

/* Remove spacing between pages in PDF */
body.pdf .page {
  margin-bottom: 0 !important;
}

/* Last page handling */
.page:last-of-type {
  page-break-after: auto;
}


/* ---------- FRAME ---------- */

.frame,
.frontframe,
.tableofContent {
  width: 190mm;
  margin: 8mm auto 6mm;
}

.frame {
  border: 1.5px solid #000;
}

.frame-inner {
  padding: 0;
}

/* ---------- GENERIC HELPERS ---------- */

table {
  border-collapse: collapse;
}

.font-center { text-align: center; }
.font-bold { font-weight: bold; }

.small-note { font-size: 8px; }

/* ---------- TABLE WIDTH NORMALISATION ---------- */

.testref-table,
.meta-table,
.checklist-table,
.sign-table,
.doc-info-table,
.front-table,
.rtu-type-table,
.bc-table,
.testsheet-table {
  width: 100%;
}

/* ---------- HEADER ---------- */

.top-header {
  display: flex;
  align-items: center;
  padding: 6px 10px 2px;
  border-bottom: 1px solid #000;
}

.top-header-titles {
  flex: 1;
  text-align: center;
  font-weight: bold;
  line-height: 1.3;
}

.top-header-titles div:nth-child(1),
.top-header-titles div:nth-child(2) {
  font-size: 12px;
}

.top-header-titles div:nth-child(3) {
  font-size: 11px;
}

.top-header-logo img {
  height: 30px;
}

.header-right {
  width: 260px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
}

.piwsd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

/* ---------- DOC INFO ---------- */

.doc-info-table {
  font-size: 9px;
}

.doc-info-table td {
  border: 1px solid #000;
  padding: 2px 4px;
}

.doc-info-center,
.doc-info-right {
  font-weight: bold;
}

.doc-info-center { text-align: center; }
.doc-info-right { text-align: right; }

/* ---------- SECTION BARS ---------- */

.section-bar,
.satsection-bar {
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  font-weight: bold;
}

.section-bar {
  font-size: 9px;
  background: #f2f2f2;
  padding: 3px 4px;
}

.satsection-bar {
  font-size: 14px;
  background: #fff;
  padding: 12px 6px;
}

/* ---------- META ---------- */

.meta-table {
  font-size: 9px;
  margin-bottom: 2px;
}

.meta-table td {
  border: 1px solid #000;
  padding: 2px 4px;
}

.meta-label {
  width: 25%;
  font-weight: bold;
  white-space: nowrap;
}

/* ---------- CHECKLIST ---------- */

.check-note {
  font-size: 9px;
  padding: 3px 4px;
  border-bottom: 1px solid #000;
}

.checklist-table {
  font-size: 9px;
}

.checklist-table th,
.checklist-table td {
  border: 1px solid #000;
  padding: 2px 3px;
  vertical-align: top;
}

.checklist-table th {
  background: #cbcbcb;
  font-weight: bold;
  text-align: center;
}

.checklist-no { width: 4%; text-align: center; }
.checklist-ok,
.checklist-ni { width: 5%; text-align: center; }
.checklist-remarks { width: 18%; }

.group-row td {
  background: #f9f9f9;
  font-weight: bold;
}

/* ---------- OBSERVATION & SIGN ---------- */

.observations-row td {
  padding: 6px 0 12px;
}

.observations-label {
  font-weight: bold;
  padding-bottom: 4px;
}

.observations-empty,
.sign-empty {
  height: 28mm;
}

.sign-table {
  font-size: 9px;
  margin-top: 6px;
}

.sign-table td {
  border: 1px solid #000;
  padding: 3px 4px;
  vertical-align: top;
}

.sign-name-row td {
  border-top: none;
}

.signature {
  text-align: center;
  height: 30px;
}

.footer-note {
  width: 190mm;
  margin: 0 auto;
  font-size: 7px;
  text-align: center;
  line-height: 1.3;
}

/* ---------- FRONT PAGE ---------- */

.front-page {
  font-size: 12px;
}

.front-title-block {
  text-align: center;
  line-height: 1.4;
}

.front-table th,
.front-table td {
  border: 1px solid #000;
  padding: 4px 6px;
  vertical-align: middle;
}

.front-spacer { height: 80px; }
.front-spacer2 { height: 320px; }

/* ---------- RTU TYPE ---------- */

.rtu-type-table td {
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  padding: 4px 6px;
  text-align: center;
}

.rtu-type-table td:first-child { border-left: none; }
.rtu-type-table td:last-child { border-right: none; }

/* ---------- IMAGE ---------- */

.PictureEmpty { height: 50mm; }

.pictureWidth {
  width: 33%;
  text-align: center;
}

.pictureWidth .photo-cell {
  max-width: 100%;
  max-height: 150px;
  object-fit: contain;
}

/* ---------- SITE DRAWING ---------- */

.site-drawing-pdf{
  position: relative;
  border: 0;
  background: #fff;
  overflow: visible; /* ✅ allow outside room */
}

.site-room-pdf{
  position:relative;
  left:64px;
  top:20px;
  width:545px;
  height:329px;
  border:1.5px solid #000;
}


.site-node-pdf {
  position: absolute;
  border: 1px solid #000;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
}


.site-node-RTU { background: #eee; font-weight: bold; }
.site-node-FEEDER { border-style: dashed; }

.site-node-DOOR {
  background: #fff;
  height: 32px !important;
  line-height: 32px;
  font-size: 7pt;
  padding: 0 4px;
  border-top: 2px solid #fff;
  border-bottom: 2px solid #fff;
}

/* ---------- PIWSD ---------- */

.piwsd-frame { font-size: 9px; line-height: 1.25; }

.piwsd-section-bar {
  font-size: 10px;
  font-weight: 700;
  border-bottom: 1px solid #000;
  padding: 3px 0;
  text-align: center;
}

.piwsd-note,
.piwsd-meta {
  font-size: 8.5px;
}

.piwsd-note {
  margin: 6px 0;
  padding: 0 2px;
}

.piwsd-table {
  font-size: 8px;
}

.piwsd-table th,
.piwsd-table td {
  padding: 0;
  text-align: center;
}

.piwsdsign-empty { height: 20mm; }
.piwsdobservations-empty { height: 10mm; }

/* ---------- BC / TESTSHEET ---------- */

.bc-table th,
.testsheet-table th {
  background: #cbcbcb;
  font-weight: bold;
  text-align: center;
}

.bc-table th,
.bc-table td {
  padding: 2px 3px;
}

.testsheet-table th,
.testsheet-table td {
  border: 1px solid #000;
  height: 20px;
  padding: 2px 3px;
  vertical-align: middle;
  font-size: 9px;
}

/* ---------- VERTICAL TEXT ---------- */

.font-vertical{
  text-orientation: mixed;
  white-space: nowrap;
  vertical-align: middle;
  text-align: center;
  transform: rotate(270deg); 
  transform-origin: center;
  
}
/* TNB's representative signature & stamp */

.btn {
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary {
  background: #4f4f4f;
  color: #ffffff;
}

.btn-primary {
  background: #A77B1E;
  color: #ffffff;
}

.btn-primary:hover {
  background: #5A3E16;
}

.TNBVerification {
  text-align: center;
  background: #ffffff;
  padding: 4mm;
  border-radius: 16px;
  margin: 12px 12px 12px 12px;
}

.btn-download {
  display: inline-block;
  padding: 10px 18px;
  background: #A77B1E;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-radius: 6px;
}

.btn-download:hover {
  background: #5A3E16;
}

.field-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
  border-radius: 16px;
  width: 40%;
  margin-left: auto;
  margin-right: auto;
}

.field-label {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-main);
}

.field-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.rejection-card {
  max-width: 900px;
  margin: 0 auto 20px;
  padding: 16px 20px;
  border: 1px solid #e3c7c7;
  border-radius: 12px;
  background: #fff6f6;
}

