/* Star SACCO — formal print stylesheet (v1.6). Loaded only by the print layout. */
@page { size: A4 portrait; margin: 14mm 14mm 16mm; @bottom-right { content: counter(page) " / " counter(pages); font: 8pt "Noto Sans", sans-serif; color: #555; } }
@page a4l { size: A4 landscape; margin: 12mm 12mm 14mm; }
@page a5 { size: A5 portrait; margin: 9mm 9mm 11mm; }
@page thermal { size: 80mm 297mm; margin: 4mm 3mm; @bottom-right { content: none; } }
body.paper-a4l .sheet { page: a4l; }
body.paper-a5 .sheet { page: a5; }
body.paper-80mm .sheet { page: thermal; }

.print-doc { background: color-mix(in srgb, var(--primary) 10%, #fff); color: #111; font-size: 10.5pt; line-height: 1.45; }
.print-doc.is-embed { background: #fff; }
.print-actions { position: sticky; top: 0; z-index: 5; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .6rem 1rem; background: #fff; border-bottom: 1px solid #ddd; }
.sheet { background: #fff; margin: 1.25rem auto; padding: 14mm; max-width: 210mm; min-height: 270mm; box-shadow: 0 2px 14px rgba(0,0,0,.12); display: flex; flex-direction: column; }
.paper-a4l .sheet { max-width: 297mm; min-height: 190mm; }
.paper-a5 .sheet { max-width: 148mm; min-height: 190mm; padding: 9mm; font-size: 9.5pt; }
.paper-80mm .sheet { max-width: 80mm; min-height: 0; padding: 4mm 3mm; font-size: 8.5pt; }
.is-embed .sheet { margin: 0; box-shadow: none; }
.print-page { flex: 1; max-width: none; margin: 0; padding: 0; }

/* Letterhead */
.letterhead { display: grid; grid-template-columns: auto 1fr auto; gap: 4mm; align-items: center; padding-bottom: 3mm; border-bottom: 2.5px solid var(--primary); margin-bottom: 4mm; }
.letterhead::after { content: ""; grid-column: 1 / -1; height: 1px; background: var(--accent); margin-top: -2mm; }
.lh-logo { width: 18mm; height: 18mm; object-fit: contain; }
.lh-name strong { display: block; font-size: 14pt; line-height: 1.2; color: var(--primary-strong); }
.lh-name span { display: block; font-size: 11pt; font-weight: 600; }
.lh-name em { display: block; font-size: 8.5pt; color: #555; font-style: normal; }
.lh-contact { text-align: right; font-size: 8pt; color: #333; display: flex; flex-direction: column; gap: .5mm; max-width: 75mm; }
.paper-a5 .lh-name strong { font-size: 12pt; } .paper-a5 .lh-logo { width: 14mm; height: 14mm; }
.paper-80mm .letterhead { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 1mm; }
.paper-80mm .lh-contact { text-align: center; max-width: none; }
.paper-80mm .lh-logo { width: 12mm; height: 12mm; }
.paper-80mm .lh-name strong { font-size: 10.5pt; }

/* Title band */
.doc-band { display: flex; justify-content: space-between; align-items: flex-end; gap: 4mm; margin: 2mm 0 5mm; flex-wrap: wrap; }
.doc-band .doc-title { margin: 0; font-size: 15pt; letter-spacing: .06em; text-transform: uppercase; color: #111; }
.lang-am .doc-band .doc-title { letter-spacing: 0; text-transform: none; }
.doc-ref { display: flex; gap: 6mm; margin: 0; font-size: 9pt; }
.doc-ref div { display: flex; flex-direction: column; } .doc-ref dt { color: #555; font-size: 7.5pt; text-transform: uppercase; letter-spacing: .05em; } .doc-ref dd { margin: 0; font-weight: 700; }
.paper-80mm .doc-band { flex-direction: column; align-items: center; text-align: center; }
.paper-80mm .doc-band .doc-title { font-size: 11pt; }

/* Body elements */
.print-doc h1, .print-doc h2, .print-doc h3 { color: #111; }
.print-page > .doc-head, .print-page > header.doc-head { display: none; } /* legacy per-view headers replaced by the letterhead */
.print-doc .doc-table, .print-doc table { width: 100%; border-collapse: collapse; margin: 0 0 4mm; font-size: inherit; }
.print-doc table th, .print-doc table td { border: 1px solid #9a9a9a; padding: 1.4mm 2mm; color: #111; background: #fff; text-align: left; vertical-align: top; position: static; }
.print-doc table thead th { background: color-mix(in srgb, var(--primary) 7%, #fff); font-weight: 700; }
.print-doc table th[scope="row"] { width: 38%; background: color-mix(in srgb, var(--primary) 3%, #fff); font-weight: 600; }
.print-doc .num, .print-doc td.num, .print-doc th.num { text-align: right; font-variant-numeric: tabular-nums; }
.print-doc .amount-box { border: 2px solid #111; padding: 2mm 4mm; display: inline-block; font-size: 13pt; font-weight: 800; }
.paper-80mm table th, .paper-80mm table td { border: 0; border-bottom: 1px dashed #999; padding: 1mm 0; }
.paper-80mm table th[scope="row"] { width: 45%; background: none; }
.signatures { display: grid; grid-template-columns: repeat(auto-fit, minmax(45mm, 1fr)); gap: 8mm; margin-top: 12mm; break-inside: avoid; }
.signatures > div { display: flex; flex-direction: column-reverse; gap: 1mm; font-size: 8.5pt; }
.sig-line { display: block; border-bottom: 1px solid #111; height: 10mm; }
.paper-80mm .signatures { grid-template-columns: 1fr; gap: 4mm; margin-top: 5mm; }
.stamp-box { border: 1.5px dashed #888; width: 32mm; height: 32mm; display: grid; place-items: center; color: #888; font-size: 7.5pt; text-align: center; }
.stamp-reversed { display: inline-block; border: 3px solid var(--danger); color: var(--danger); font-weight: 800; padding: 1mm 4mm; transform: rotate(-6deg); text-transform: uppercase; letter-spacing: .1em; }
.doc-foot { margin-top: 6mm; padding-top: 2mm; border-top: 1px solid #bbb; font-size: 7.5pt; color: #555; display: flex; flex-direction: column; gap: 1mm; }
.doc-foot p { margin: 0; }
.doc-note { color: #333; }
.form-blank .line { display: block; border-bottom: 1px solid #333; min-height: 7mm; }
.form-blank .grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3mm 6mm; }
.form-blank .grid.three { grid-template-columns: repeat(3, 1fr); }
.form-blank label { font-size: 8pt; color: #333; display: block; }
.form-blank .box { display: inline-block; width: 3.5mm; height: 3.5mm; border: 1px solid #333; vertical-align: -0.5mm; margin-right: 1mm; }
.form-blank fieldset { border: 1px solid #999; padding: 3mm; margin: 0 0 4mm; break-inside: avoid; }
.form-blank legend { font-weight: 700; padding: 0 2mm; }

/* Generic page printing (?print=1): keep the information, drop the controls */
.print-generic .print-page form:not(.keep-print), .print-generic .print-page .actions, .print-generic .print-page .page-title .actions,
.print-generic .print-page button, .print-generic .print-page .btn, .print-generic .print-page .pager, .print-generic .print-page .filter-bar,
.print-generic .print-page .tabs, .print-generic .print-page nav, .print-generic .print-page .export-menu, .print-generic .print-page .no-print,
.print-generic .print-page input[type="search"], .print-generic .print-page .perm-tools, .print-generic .print-page .breadcrumbs, .print-generic .print-page .tile { display: none !important; }
.print-generic .print-page .card, .print-generic .print-page .table-wrap { box-shadow: none; border: 0; padding: 0; background: none; overflow: visible; }
.print-generic .print-page .page-title h1 { font-size: 14pt; margin: 0 0 3mm; }
.print-generic .print-page a { color: inherit; text-decoration: none; }
.print-generic .print-page .badge { border: 1px solid #777; background: none !important; color: #111 !important; }
.print-generic .print-page .grid, .print-generic .print-page .cards { gap: 3mm; }

@media print {
  html, body, .print-doc { background: #fff !important; }
  .no-print, .print-actions { display: none !important; }
  .sheet { margin: 0; padding: 0; box-shadow: none; max-width: none; min-height: 0; }
  thead { display: table-header-group; } tfoot { display: table-footer-group; }
  tr, .signatures, .doc-band, .letterhead, fieldset { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.doc-sub { margin: 1mm 0 0; font-size: 9pt; color: #444; }
.print-generic .print-page .page-title > a, .print-generic .print-page .page-title .back { display: none !important; }
.print-doc td.nowrap, .print-doc th.nowrap, .stmt td:nth-child(-n+2) { white-space: nowrap; }
.print-doc .matrix td, .print-doc .matrix th { padding: .6mm 1mm; font-size: 7.5pt; }
.print-doc .matrix-wrap { overflow: visible; }
.paper-80mm .amount-box { font-size: 11pt; padding: 1mm 2mm; white-space: nowrap; }
.paper-80mm .doc-table th[scope="row"] { width: 38%; }

/* v2.4.0: one signature line (app.css adds a top border to .sig-line for screen forms) */
.print-doc .sig-line { border-top: 0; padding-top: 0; position: relative; }
.print-doc .sig-img { position: absolute; left: 0; bottom: 1mm; max-height: 14mm; max-width: 100%; object-fit: contain; }
/* v2.4.0: application form head with photo box, attached ID images */
.print-form-head { display: grid; grid-template-columns: 1fr 35mm; gap: 4mm; align-items: start; }
.print-form-head .doc-table { margin: 0; }
.print-form-head + .doc-table { margin-top: -1px; }
.print-photo { width: 35mm; height: 45mm; border: 1.5px dashed #888; display: grid; place-items: center; overflow: hidden; color: #888; font-size: 7.5pt; text-align: center; background: #fff; }
.print-photo img { width: 100%; height: 100%; object-fit: cover; }
.print-docs { margin-top: 6mm; break-before: auto; }
.print-doc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5mm; margin-bottom: 4mm; }
.print-doc-figure { margin: 0; border: 1px solid #9a9a9a; padding: 2mm; break-inside: avoid; display: flex; flex-direction: column; gap: 1.5mm; }
.print-doc-figure img { width: 100%; max-height: 85mm; object-fit: contain; background: #fafafa; }
.print-doc-figure.doc-id_copy { grid-column: 1 / -1; }
.print-doc-figure.doc-id_copy img { max-height: 110mm; }
.print-doc-figure figcaption { font-size: 8pt; color: #333; }
.paper-80mm .print-doc-grid, .paper-a5 .print-doc-grid { grid-template-columns: 1fr; }
.print-form-head .doc-table th[scope="row"], .print-form-head + .doc-table th[scope="row"] { width: 48mm; }

/* v2.8.1 — boxed paper application form (public "Download the paper form"). One A4 page, six-column grid. */
.pf { font-size: 9.5pt; }
.pf-intro { margin: 0 0 3.5mm; font-size: 9pt; color: #333; }
.pf-sec { margin: 0 0 3.5mm; break-inside: avoid; }
.pf-h { display: flex; align-items: center; gap: 2.2mm; margin: 0 0 1.6mm; font-size: 10.5pt; font-weight: 700; color: #111; }
.pf-n { display: inline-grid; place-items: center; width: 5.4mm; height: 5.4mm; border-radius: 50%; background: var(--primary); color: #fff; font-size: 8pt; font-weight: 800; flex: none; }
.pf-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid #555; border-left: 1px solid #555; }
.pf-cell { position: relative; min-height: 12.5mm; padding: 1.2mm 2mm 1.4mm; border-right: 1px solid #555; border-bottom: 1px solid #555; display: flex; flex-direction: column; justify-content: space-between; gap: 1mm; min-width: 0; }
.pf-s2 { grid-column: span 2; } .pf-s3 { grid-column: span 3; } .pf-s6 { grid-column: span 6; }
.pf-l { font-size: 7.2pt; font-weight: 700; color: #333; line-height: 1.2; }
.pf-opts { display: flex; flex-wrap: wrap; gap: 1mm 4.5mm; font-size: 8.8pt; }
.pf-opt { display: inline-flex; align-items: center; white-space: nowrap; }
.pf .box { display: inline-block; flex: none; width: 3.4mm; height: 3.4mm; border: 1px solid #333; border-radius: .6mm; margin-right: 1.4mm; vertical-align: -.5mm; }
.pf-date { font-size: 9pt; color: #555; letter-spacing: .04em; }
.pf-with-photo { display: grid; grid-template-columns: minmax(0, 1fr) 30mm; gap: 3mm; align-items: stretch; }
.pf-photo { border: 1px dashed #777; display: grid; place-items: center; text-align: center; font-size: 7.5pt; color: #555; min-height: 38mm; }
.pf-decl p { display: flex; align-items: flex-start; gap: 1mm; margin: 0 0 2.5mm; font-size: 8.8pt; }
.pf-decl p .box { margin-top: .6mm; }
.pf-sign .pf-cell { min-height: 16mm; }
.pf-office { margin-top: 4mm; padding: 2mm 2.5mm 2.5mm; background: color-mix(in srgb, var(--primary) 5%, #fff); border: 1.5px solid var(--primary); border-radius: 1.5mm; break-inside: avoid; }
.pf-oh { margin: 0 0 1.6mm; font-size: 8.5pt; font-weight: 700; color: var(--primary-strong, var(--primary)); }
.pf-office .pf-grid { background: #fff; }
.pf-office .pf-cell { min-height: 10.5mm; }
.lang-am .pf-l { font-size: 7.6pt; }
@media screen and (max-width: 640px) {
  .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-s2, .pf-s3 { grid-column: span 1; } .pf-s6 { grid-column: span 2; }
  .pf-with-photo { grid-template-columns: 1fr; } .pf-photo { min-height: 30mm; width: 30mm; }
}
/* Ethiopic script needs taller lines: keep the Amharic form on one page too. */
.lang-am .pf-cell { min-height: 11.6mm; padding-block: 1mm 1.2mm; }
.lang-am .pf-sec { margin-bottom: 2.8mm; }
.lang-am .pf-h { margin-bottom: 1.2mm; }
.lang-am .pf-sign .pf-cell { min-height: 14mm; }
.lang-am .pf-office { margin-top: 3mm; }
.lang-am .pf-decl p { line-height: 1.5; }
/* Small screens: the on-screen preview of any printable sheet must not overflow the phone width. */
.lh-contact { overflow-wrap: anywhere; min-width: 0; }
@media screen and (max-width: 640px) {
  .sheet { padding: 6mm 5mm; margin: .75rem .5rem; min-height: 0; }
  .letterhead { grid-template-columns: auto 1fr; }
  .lh-contact { grid-column: 1 / -1; text-align: left; max-width: none; }
  .doc-band .doc-title { font-size: 12pt; overflow-wrap: anywhere; }
}
