/* Shared entity header: labels and values remain left aligned on every statement. */
.statement-meta > div:first-child,
.model-sheet .statement-meta > div:first-child {
 text-align:left;
 justify-self:start;
 margin-left:0;
 min-width:0;
 overflow-wrap:anywhere;
}
.statement-meta > div:first-child strong { text-align:left; }
/* Page proportions and typography of the supplied Liasse des Etats Financiers. */
@media screen {
 .model-sheet { margin:0 auto 18px; background:#fff; color:#111; }
 .model-sheet[data-orientation="portrait"] { max-width:940px; }
 .model-sheet[data-orientation="landscape"] { max-width:1400px; }
 .model-sheet .statement-meta { display:grid; grid-template-columns:minmax(0,2fr) minmax(230px,1fr); gap:10px; padding:17px 20px 0; color:#111; font-family:Arial,sans-serif; font-size:11px; line-height:1.6; }
 .model-sheet .statement-meta > div:last-child { min-width:0; }
 .model-sheet .statement-title { color:#111; text-align:center; font:700 12px Arial,sans-serif; margin:13px 15px 12px; }
 .model-sheet table { border-collapse:collapse; width:100%; font-family:Arial,sans-serif; font-size:11px; color:#111; }
 .model-sheet th,.model-sheet td { padding:5px 4px; border:1px solid #8f9399; vertical-align:middle; }
 .model-sheet thead th,.model-sheet .statement-period th { background:#d9e1f2; color:#111; text-align:center; }
 .model-sheet .label,.model-sheet .description,.model-sheet tbody td:first-child:not(.code) { text-align:left; }
 .model-sheet tr.total { background:#f1f2f3; font-weight:700; }
 .model-sheet td.num { text-align:right; font-variant-numeric:tabular-nums; }
 .model-sheet .entry,.model-sheet .note-detail-input { min-width:65px; width:100%; max-width:130px; font:inherit; padding:5px; }
 .model-sheet .table-wrap { max-height:none; }
 .model-sheet[data-orientation="landscape"] table { min-width:900px; }
 .model-sheet.landscape-preview table { min-width:1250px; }
 .model-sheet .panel-head h2 { color:#111; font:700 11px Arial,sans-serif; }
}
@media print {
 @page brw-portrait { size:A4 portrait; margin:14mm 5mm 10mm 16mm; }
 @page brw-landscape { size:A4 landscape; margin:14mm 5mm 10mm 9mm; }
 .model-sheet[data-orientation="portrait"] { page:brw-portrait; }
 .model-sheet[data-orientation="landscape"] { page:brw-landscape; }
 .model-sheet { color:#000; border:0!important; box-shadow:none!important; border-radius:0!important; font-family:Arial,sans-serif; }
 .model-sheet .table-wrap { overflow:visible!important; max-height:none!important; }
 .model-sheet table { width:100%; min-width:0!important; border-collapse:collapse; font:7pt Arial,sans-serif; }
 .model-sheet th,.model-sheet td { padding:2px 3px!important; border:0.4pt solid #666; }
 .model-sheet th { text-align:center; background:#d9e1f2!important; print-color-adjust:exact; }
 .model-sheet .statement-meta { display:grid; grid-template-columns:2fr 1fr; gap:5px; padding:0; font:6.5pt/1.45 Arial,sans-serif; color:#000; }
 .model-sheet .statement-meta > div:last-child { min-width:0; }
 .model-sheet .statement-title { text-align:center; font:700 8pt Arial,sans-serif; margin:9px 0; }
 .model-sheet td.num { text-align:right; }
 .model-sheet input,.model-sheet textarea { border:0!important; padding:0!important; width:100%; font:inherit; }
 .model-sheet .label { min-width:0!important; text-align:left; }
 .note-page-nav,.note-page-heading,.note-fold > summary,.model-sheet .badge,.model-sheet .note,.model-sheet .search,[data-note-fold$=":links"],[data-note-fold$=":accounts"] { display:none!important; }
 .note-fold-content { display:block!important; }
 .note-fold { border:0; break-inside:auto; }
 .model-sheet tr { break-inside:avoid; }
 .model-sheet thead { display:table-header-group; }
}

@media print {
 @page brw-r4 { size:A4 portrait; margin:10mm; }
 .model-sheet.note-r4 { page:brw-r4; break-inside:avoid; }
 .note-r4 table { font:6.5pt Arial,sans-serif; table-layout:fixed; }
 .note-r4 th,.note-r4 td { padding:1.5px 3px!important; white-space:normal; overflow-wrap:anywhere; }
 .note-r4 th:first-child,.note-r4 td:first-child { width:14%!important; }
 .note-r4 th:nth-child(2),.note-r4 td:nth-child(2) { width:70%!important; }
 .note-r4 th:nth-child(3),.note-r4 td:nth-child(3),.note-r4 th:nth-child(4),.note-r4 td:nth-child(4) { width:8%!important; }
}

/* Printed statement geometry follows the SYSCOHADA normal-system grids. */
.model-sheet .statement-title { letter-spacing:0; font-weight:700; }
.model-sheet .statement-meta { color:#000; }
.model-sheet table { table-layout:fixed; }
.model-sheet th,.model-sheet td { color:#000; }
.model-sheet tbody td.label { text-align:left; white-space:normal; overflow-wrap:break-word; }
.model-sheet tbody td.code,.model-sheet thead th { text-align:center; }
.model-sheet tbody td.num { text-align:right; }
.model-sheet thead th,.model-sheet .statement-period th,.model-sheet tr.total { background:#fff!important; }
@media print {
 .model-sheet th,.model-sheet td { color:#000!important; background:#fff!important; }
 .model-sheet .panel-head,.model-sheet .statement-toolbar { display:none!important; }
 .model-sheet .statement-title { text-align:center; }
}

.model-sheet table[data-statement] thead th:first-child { width:7%; }
.model-sheet table[data-statement] thead th:nth-child(2) { width:44%; }
.model-sheet table[data-statement] thead th:nth-child(3) { width:6%; }
.model-sheet table[data-statement="PASSIF"] thead th:nth-child(2) { width:49%; }
.model-sheet table[data-statement="COMPTE DE RESULTAT"] thead th:nth-child(2),
.model-sheet table[data-statement="TABLEAU DE FLUX DE TRESORERIE"] thead th:nth-child(2) { width:56%; }
.model-sheet .landscape-preview table { table-layout:auto; }

/* Colours retained from the official SYSCOHADA revised printing models. */
.model-sheet table thead th,.model-sheet .statement-period th { background:#91a9c5!important; color:#fff!important; }
.model-sheet table tbody tr.total td { background:#d9d9d9!important; color:#111!important; }
.model-sheet table tbody tr[data-ref="AZ"] td,.model-sheet table tbody tr[data-ref="BK"] td,
.model-sheet table tbody tr[data-ref="BT"] td,.model-sheet table tbody tr[data-ref="DF"] td,
.model-sheet table tbody tr[data-ref="DP"] td,.model-sheet table tbody tr[data-ref="DT"] td,
.model-sheet table tbody tr[data-ref="ZB"] td,.model-sheet table tbody tr[data-ref="ZC"] td,
.model-sheet table tbody tr[data-ref="ZF"] td { background:#002060!important; color:#fff!important; }
.model-sheet table tbody tr[data-ref="BZ"] td,.model-sheet table tbody tr[data-ref="DZ"] td { background:#839a45!important; color:#fff!important; }
.model-sheet td .computed { color:inherit!important; }
@media print { .model-sheet,.model-sheet th,.model-sheet td { print-color-adjust:exact!important; -webkit-print-color-adjust:exact!important; } }

/* Adapt the working view to populated items and the width of formatted amounts. */
.statement-display-controls { display:flex; flex-wrap:wrap; align-items:center; gap:12px 20px; margin:0 0 18px; padding:14px 18px; background:#fff; border:1px solid #dde3ea; border-radius:12px; }
.statement-display-controls label { display:flex; align-items:center; gap:10px; font-size:14px; }
.statement-display-controls span,.statement-display-controls p { font-size:14px; color:#526172; }
.statement-display-controls p { flex-basis:100%; margin:0; }
@media screen {
 .model-sheet table { table-layout:auto; }
 .model-sheet td.num { white-space:nowrap; }
 .model-sheet td.num input,.model-sheet td input.note-detail-input { min-width:9ch; max-width:none; width:100%; }
 .model-sheet .label { overflow-wrap:anywhere; }
 [data-statement-row][hidden],[data-statement-group][hidden] { display:none!important; }
}
@media print {
 .statement-display-controls { display:none!important; }
 [data-statement-row][hidden],[data-statement-group][hidden] { display:table-row!important; }
}

.id-grid label.r1-close-field { flex-direction:row; align-items:center; flex-wrap:wrap; gap:10px; }
.r1-close-field > span { font-weight:600; }
.id-grid .r1-close-field .identity-entry { width:160px; max-width:100%; }

/* Requested R1 values only: activity code, entity name, acronym and phone. */
.id-code-row[data-identity-code="ZE"] [data-field="activityCode"],
.id-code-row[data-identity-code="ZF"] [data-field="legal"],
.id-code-row[data-identity-code="ZF"] [data-field="acronym"],
.id-code-row[data-identity-code="ZG"] [data-field="phone"],
.id-code-row[data-identity-code="ZG"] [data-field="email"],
.id-code-row[data-identity-code="ZG"] [data-field="postalCode"],
.id-code-row[data-identity-code="ZG"] [data-field="postalBox"],
.id-code-row[data-identity-code="ZG"] [data-field="city"] { text-align:center; }

.id-code-row[data-identity-code="ZH"] [data-field="address"] { text-align:center; }

.id-code-row[data-identity-code="ZI"] [data-field="activity"],
.id-code-row[data-identity-code="ZI"] .activity-dropdown-trigger { text-align:center; justify-content:center; }

.id-code-row [data-field="contact"], .id-grid [data-field="contact"] { text-align:center; }

.id-grid [data-field="accountant"] { text-align:center; }

.id-subpanel input[data-identity-list="banks"] { text-align:center; max-width:100%; min-width:0; }

.bank-identification-panel table { table-layout:fixed; min-width:540px; }
.bank-identification-panel th:first-child { width:45%; }
.bank-identification-panel th:last-child { width:110px; }
.bank-identification-panel .bank-name-entry { display:block; width:100%; min-width:0; max-width:100%; box-sizing:border-box; text-align:center; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.4; resize:vertical; overflow:hidden; }

/* Reference and note identifiers: screen and browser A4 printing, all systems. */
.statement-panel table td.code { text-align:center; vertical-align:middle; }
.statement-panel table th:first-child,
.statement-panel table thead tr:first-child th:nth-child(3) { text-align:center; vertical-align:middle; }

/* Notes annexes: grey centred headers, left-aligned rubrics and bold totals. */
[data-notes-format] table tbody [data-note-rubric],
[data-notes-format] table tbody tr[data-statement-group] > * {
 background:#fff!important; color:#000!important; font-weight:400!important;
 text-align:left!important; vertical-align:middle;
}
[data-notes-format] [data-note-rubric] input {
 text-align:left!important; font-weight:400!important; color:#000!important; background:transparent!important;
}
[data-notes-format] table tbody tr.total > * {
 background:#bfbfbf!important; color:#000!important; font-weight:700!important;
}
[data-notes-format] table tbody tr.total input,
[data-notes-format] table tbody tr.total .computed {
 background:transparent!important; color:#000!important; font-weight:700!important;
}
[data-notes-format] table tbody tr[data-statement-group]:not([data-note-total]) > * { background:#fff!important; font-weight:400!important; }
@media print {
 [data-notes-format] table th,[data-notes-format] table td { print-color-adjust:exact!important; -webkit-print-color-adjust:exact!important; }
}

[data-notes-format] table thead th { background:#bfbfbf!important; color:#000!important; text-align:center!important; font-weight:700!important; }

/* Main statements: headings bold; every total and sum uses grey with black bold text. */
.statement-panel table thead th { font-weight:700!important; }
.statement-panel table tbody tr.total > *,
.statement-panel table tbody tr.flow-group > *,
.statement-panel table tbody td.statement-sum {
 background:#bfbfbf!important; color:#000!important; font-weight:700!important;
}
.statement-panel table tbody tr.total input,
.statement-panel table tbody tr.total .computed,
.statement-panel table tbody td.statement-sum .computed {
 color:#000!important; font-weight:700!important; background:transparent!important;
}
@media print {
 .statement-panel table th,.statement-panel table td { print-color-adjust:exact!important; -webkit-print-color-adjust:exact!important; }
}

[data-notes-format] [data-note-amount] { display:block; width:100%; box-sizing:border-box; text-align:right; font-variant-numeric:tabular-nums; }
[data-notes-format] table { table-layout:auto; }
[data-notes-format] table td.num { white-space:nowrap; }
[data-notes-format] input[inputmode="decimal"] { width:100%; max-width:none; box-sizing:border-box; text-align:right; font-variant-numeric:tabular-nums; }
@media screen { [data-notes-format] .table-wrap { overflow-x:auto; } }

/* Notes use the full available width while retaining their model orientation. */
@media screen {
 [data-notes-format] .model-sheet[data-orientation] { max-width:none; width:100%; }
 [data-notes-format] .model-sheet .statement-meta { padding-left:5px; padding-right:5px; }
}
@media print {
 @page brw-note-portrait { size:A4 portrait; margin:8mm 5mm 10mm; }
 @page brw-note-landscape { size:A4 landscape; margin:8mm 5mm 10mm; }
 #content[data-notes-format] { page:brw-note-portrait; }
 [data-notes-format] .model-sheet[data-orientation="portrait"],
 [data-notes-format] .model-sheet.note-r4 { page:brw-note-portrait; }
 [data-notes-format] .model-sheet[data-orientation="landscape"] { page:brw-note-landscape; }
 [data-notes-format] .model-sheet { margin:0; padding:0; max-width:none; width:100%; }
 [data-notes-format] .note-fold-content { padding:0; }
}
