/* 
   Jasper Finance Forensic Artifact Theme - v0.2.0
   Optimized for high-density auditable data.
   Supports WeasyPrint & xhtml2pdf Fallback.
*/

@page {
    size: a4 portrait;
    margin: 1.0cm;
}

body {
    font-family: "Helvetica", "Arial", sans-serif;
    line-height: 1.4;
    color: #1a202c;
    background-color: #ffffff;
    margin: 0;
    padding: 0;
    font-size: 9pt; /* Denser baseline */
}

/* --- Metadata Dashboard (Page 1 Start) --- */
.metadata-dashboard {
    border: 1.5pt solid #2d3748;
    margin-bottom: 20pt;
    background-color: #f7fafc;
}

.dashboard-header {
    background-color: #2d3748;
    color: #ffffff;
    padding: 8pt 12pt;
    font-weight: bold;
    font-size: 11pt;
    text-transform: uppercase;
    letter-spacing: 1pt;
}

.dashboard-body {
    padding: 10pt;
    display: table;
    width: 100%;
}

.dashboard-column {
    display: table-cell;
    width: 50%;
    vertical-align: top;
}

.meta-row {
    margin-bottom: 4pt;
    display: block;
}

.meta-label {
    font-weight: bold;
    color: #4a5568;
    width: 100pt;
    display: inline-block;
}

.meta-value {
    font-family: monospace;
}

/* --- Forensic Ledger / Status Labels --- */
.ledger-entry {
    font-weight: bold;
    padding: 2pt 6pt;
    border-radius: 2pt;
    font-size: 8pt;
}

.status-passed { background-color: #c6f6d5; color: #22543d; border: 1pt solid #2f855a; }
.status-failed { background-color: #fed7d7; color: #822727; border: 1pt solid #c53030; }
.status-warning { background-color: #fefcbf; color: #744210; border: 1pt solid #d69e2e; }

/* --- Tables (Evidence & Inference) --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12pt;
    margin-top: 8pt;
    table-layout: auto;
    font-size: 8pt;
    max-width: 100%;
}

th {
    background-color: #2d3748;
    color: #ffffff;
    text-align: left;
    padding: 6pt 5pt;
    border: 0.5pt solid #1a202c;
    font-weight: bold;
    font-size: 8pt;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    min-width: 40pt;
}

td {
    padding: 5pt 5pt;
    border: 0.5pt solid #cbd5e0;
    font-size: 8pt;
    vertical-align: top;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
    min-width: 35pt;
}

/* Explicit numeric-cell alignment utility */
td.numeric,
th.numeric {
    text-align: right;
}

/* Alternate row colors for readability */
tr:nth-child(even) {
    background-color: #f7fafc;
}

tr:nth-child(odd) {
    background-color: #ffffff;
}

/* --- Forensic Sections --- */
.forensic-section {
    margin-bottom: 25pt;
    page-break-inside: auto; /* Allow tables to split */
}

.section-title {
    font-size: 14pt;
    font-weight: bold;
    color: #2d3748;
    border-bottom: 2pt solid #2d3748;
    padding-bottom: 4pt;
    margin-bottom: 10pt;
}

/* --- Inference Specifics --- */
.evidence-tag {
    display: inline-block;
    background-color: #ebf8ff;
    color: #2b6cb0;
    border: 0.5pt solid #bee3f8;
    padding: 1pt 4pt;
    font-family: monospace;
    font-size: 8pt;
    margin: 1pt;
}

.logic-path {
    font-style: italic;
    color: #4a5568;
}

/* --- Narrative (Secondary) --- */
.synthesis-content {
    color: #2d3748;
    font-size: 9.5pt;
    line-height: 1.6;
}

/* --- Markdown Styling in Synthesis --- */
.synthesis-content strong {
    font-weight: bold;
    color: #1a202c;
}

.synthesis-content em {
    font-style: italic;
    color: #4a5568;
}

.synthesis-content h2 {
    font-size: 12pt;
    font-weight: bold;
    color: #2d3748;
    margin-top: 14pt;
    margin-bottom: 10pt;
    border-bottom: 1.5pt solid #2d3748;
    padding-bottom: 6pt;
}

.synthesis-content h3 {
    font-size: 10pt;
    font-weight: bold;
    color: #1a202c;
    margin-top: 12pt;
    margin-bottom: 8pt;
}

/* Callout boxes - styled as simple bold sections with clear spacing */
.synthesis-content p strong:first-child {
    display: block;
    margin-bottom: 6pt;
    color: #1a4d8a;
    font-size: 10pt;
}

/* Tables within synthesis content */
.synthesis-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12pt 0;
    font-size: 8pt;
    table-layout: auto;
    max-width: 100%;
    display: table;
}

.synthesis-content table th {
    background-color: #2d3748;
    color: #ffffff;
    font-weight: bold;
    border: 0.5pt solid #1a202c;
    padding: 6pt 5pt;
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    min-width: 40pt;
}

.synthesis-content table td {
    background-color: #ffffff;
    font-weight: normal;
    border: 0.5pt solid #cbd5e0;
    padding: 5pt 5pt;
    text-align: left;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    min-width: 35pt;
}

.synthesis-content table td:nth-child(n+3),
.synthesis-content table th:nth-child(n+3) {
    text-align: right;
}

.synthesis-content table tr:nth-child(even) {
    background-color: #f7fafc;
}

/* --- Utilities --- */
.text-right { text-align: right; }
.bold { font-weight: bold; }
.monospace { font-family: monospace; }
.v-spacer { height: 15pt; }

/* Number formatting - align right for currency/metrics */
.numeric {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: 400;
}

/* Page Breaking Rules */
.page-break { page-break-before: always; }
h1, h2, h3 { page-break-after: avoid; }
table { page-break-inside: auto; }
tr { page-break-inside: avoid; page-break-after: auto; }
/* Utility */
.text-success { color: #38a169; font-weight: bold; }
.text-danger { color: #e53e3e; font-weight: bold; }
.no-break { page-break-inside: avoid; }
.footer-hash { font-family: monospace; font-size: 8pt; color: #a0aec0; }
