/* ------------------------------------------------------------------ *
 * Print / Save-as-PDF layout for a service sheet.
 * Loaded with media="print", so none of this affects the screen.
 * ------------------------------------------------------------------ */

@page {
  size: A4;
  margin: 14mm 12mm 16mm;
}

body {
  background: #fff;
  /* Roboto on the printed sheet too, not just on screen. */
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 10.5pt;
  line-height: 1.45;
  color: #000;
}

.document, .doc-header, .doc-section, .rich, .doc-parties, .doc-postnotes {
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Everything that is app chrome rather than document.
   .confidential-block is listed explicitly as well as carrying .no-print:
   internal notes must never reach a PDF that goes to a client. */
.topbar,
.sheet-toolbar,
.public-bar,
.share-hint,
.add-note,
.confidential-block,
.card-confidential,
.no-print,
.flash,
.pager,
.filters,
.form-actions {
  display: none !important;
}

.page { max-width: none; margin: 0; padding: 0; }

.document {
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}

/* Links print as plain text; a blue underlined URL on paper is noise. */
.document a { color: #000; text-decoration: none; }

/* ---- header ---- */

.doc-header {
  padding-bottom: 6mm;
  border-bottom: 1.5pt solid #000;
}

.doc-logo { max-height: 22mm; max-width: 62mm; }
.doc-issuer { font-size: 8pt; }
.doc-issuer-name { font-size: 12pt; font-weight: 700; }

/* Date leads, serial is the small filing reference beneath it. */
.doc-date { font-size: 13pt; font-weight: 700; color: #000; }
.doc-serial { font-size: 8pt; font-weight: 400; color: #333; }
.doc-kind { font-size: 7pt; color: #333; }

.doc-draft-banner {
  border: 1pt solid #000;
  background: none;
  color: #000;
}

/* ---- body ---- */

.doc-parties {
  grid-template-columns: repeat(4, 1fr);
  gap: 5mm;
  padding: 5mm 0;
}

.doc-parties h3,
.doc-section h3,
.doc-postnotes h3 {
  font-size: 7.5pt;
  color: #333;
}

.doc-parties p { font-size: 9pt; }
.doc-section { padding: 4mm 0; }
.rich { font-size: 9.5pt; line-height: 1.5; }

/*
 * Long fields flow onto the next page.
 *
 * These sections used to be break-inside: avoid, which meant a "Operațiuni
 * efectuate" longer than the remaining space was pushed whole onto a fresh
 * page — leaving the previous one half empty, and overflowing anyway once the
 * text was longer than a full page. Text is allowed to break now; what is
 * held together is only what would read as broken.
 */
.doc-section {
  break-inside: auto;
  page-break-inside: auto;
}

/* Never leave a heading stranded at the foot of a page, and never break off
   after one line: at least two lines travel with the text either way. */
.doc-section h3 {
  break-after: avoid;
  page-break-after: avoid;
}

.rich p,
.rich li,
.rich div {
  orphans: 2;
  widows: 2;
}

/* A list item or a table row splits badly, so those stay whole even though
   the section around them may break. */
.rich li,
.rich tr,
.rich img {
  break-inside: avoid;
  page-break-inside: avoid;
}

/* A signature block or a single note is small enough to keep intact. The
   notes section as a whole is not, so it may break between notes. */
.postnote,
.sig-block {
  break-inside: avoid;
  page-break-inside: avoid;
}

/*
 * An empty field still appears — "nothing recorded" is information — but it
 * takes one line, not a block the size of the box it was typed into.
 */
.doc-section-empty {
  padding: 1.5mm 0;
  break-inside: avoid;
  page-break-inside: avoid;
}

.doc-section-empty h3 { margin: 0; display: inline; }

.doc-section-empty .rich-empty {
  display: inline;
  margin: 0 0 0 2mm;
  font-size: 9.5pt;
  color: #333;
}

/* ---- signatures ---- */

.doc-signatures {
  grid-template-columns: 1fr 1fr;
  gap: 12mm;
  padding: 8mm 0 2mm;
  break-inside: avoid;
  page-break-inside: avoid;
}

.sig-image { height: 22mm; border-bottom: 0.75pt solid #000; }
.sig-image img { max-height: 21mm; }
.sig-name { font-size: 9pt; }
.sig-time { font-size: 7.5pt; color: #333; }

/* ---- post-intervention notes ---- */

.doc-postnotes {
  background: none;
  border: 0.75pt solid #999;
  border-left: 2pt solid #000;
  margin-top: 6mm;
  padding: 4mm;
}

.doc-postnotes h3 { color: #000; }
.postnotes-caption { font-size: 8pt; color: #333; }
.postnote-meta { font-size: 7.5pt; color: #333; }

.doc-footer {
  margin-top: 6mm;
  padding-top: 3mm;
  border-top: 0.5pt solid #999;
  font-size: 7pt;
  color: #333;
}

/* Force the browser to keep logos and signatures, which it would otherwise
   drop when "background graphics" is off. These are <img>, so they survive,
   but the colour-adjust hint keeps any tinted logo faithful. */
img {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* ---- company hours report ---- */

/* The screen stylesheet stacks tables into cards below 760px, and an A4 page
   is narrower than that — so the report table is put back into rows here. */
.report-table { display: table !important; width: 100%; border: 0; font-size: 8.5pt; background: none; }
.report-table thead { display: table-header-group !important; }
.report-table tbody { display: table-row-group !important; }
.report-table tfoot { display: table-footer-group !important; }
.report-table tr {
  display: table-row !important;
  border: 0;
  box-shadow: none;
  background: none;
  break-inside: avoid;
  page-break-inside: avoid;
}
.report-table th,
.report-table td {
  display: table-cell !important;
  width: auto;
  padding: 1.6mm 2mm;
  border-bottom: 0.5pt solid #999;
  color: #000;
}
.report-table td::before { content: none !important; }
.report-table th { background: none; color: #333; font-size: 7pt; border-bottom: 1pt solid #000; }
.report-table .num { text-align: right; }
.report-table .serial { color: #000; }
.report-table .tag { border: 0.5pt solid #000; background: none; color: #000; }
.report-table .muted { color: #333; }
.report-table .small { font-size: 7.5pt; }
.report-total td,
.report-total td[colspan] {
  display: table-cell !important;
  background: none;
  border-top: 1.5pt solid #000;
  border-bottom: 0;
  font-size: 9.5pt;
}
.report-document .table-wrap { overflow: visible; margin-top: 5mm; }
