/* Farmer Statement Print Styles - TTTC Format */

.statement-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 16px;
}

.statement-page {
    width: 210mm;
    min-height: 297mm;
    padding: 10mm 12mm;
    margin: 0 auto 24px;
    background: #ffffff;
    color: #111;
    font-family: "Arial", "Roboto", sans-serif;
    font-size: 10pt;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

/* ===== HEADER ===== */
.statement-header {
    margin-bottom: 4mm;
}

.statement-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2mm;
}

.statement-season-label {
    font-size: 10pt;
    min-width: 80px;
}

.statement-company-name {
    font-size: 11pt;
    font-weight: 700;
    text-align: center;
    flex: 1;
    text-transform: uppercase;
}

.statement-logo-container {
    min-width: 80px;
    text-align: right;
}

.statement-logo {
    height: 14mm;
    width: auto;
    object-fit: contain;
}

.statement-header-sub {
    font-size: 10pt;
    line-height: 1.6;
    margin-top: 2mm;
}

/* ===== GROWER DETAILS ===== */
.grower-detail-grid {
    border: 1px solid #bbb;
    margin-bottom: 4mm;
}

.grower-detail-row {
    display: flex;
    border-bottom: 1px solid #ddd;
}

.grower-detail-row:last-child {
    border-bottom: none;
}

.grower-detail-cell {
    flex: 1;
    padding: 1.5mm 3mm;
    font-size: 9.5pt;
    border-right: 1px solid #ddd;
}

.grower-detail-cell:last-child {
    border-right: none;
}

.detail-label {
    color: #888;
    font-size: 9pt;
}

/* ===== SECTIONS ===== */
.statement-section {
    margin-bottom: 5mm;
}

.section-title {
    font-size: 10pt;
    font-weight: 600;
    margin-bottom: 2mm;
    color: #222;
}

/* ===== TABLES ===== */
.statement-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9.5pt;
    margin-bottom: 2mm;
}

.statement-table th,
.statement-table td {
    border: 1px solid #ccc;
    padding: 1.5mm 2mm;
    vertical-align: top;
}

.statement-table th {
    background: #d9e2f3;
    text-align: left;
    font-weight: 600;
    font-size: 9pt;
}

.align-right {
    text-align: right;
}

.align-center {
    text-align: center;
}

.totals-footer-row {
    background: #f0f0f0;
    font-weight: 600;
}

/* ===== BATCH GROUPS ===== */
.batch-header {
    font-size: 9pt;
    font-weight: 600;
    margin: 3mm 0 1mm;
    color: #333;
}

.batch-grand-total {
    font-size: 9pt;
    font-style: italic;
    color: #555;
    margin-top: 2mm;
}

/* ===== FINANCIAL SUMMARY ===== */
.financial-summary-table td {
    font-size: 9.5pt;
}

.summary-bold-row {
    background: #f0f0f0;
}

.due-to-grower-row {
    background: #fce4ec;
}

.due-to-grower-row td {
    font-weight: 700;
    color: #c62828;
}

/* ===== LOAN PLACEHOLDER ===== */
.loan-placeholder {
    border: 1px dashed #bbb;
    padding: 3mm;
    font-size: 9.5pt;
    color: #555;
}

/* ===== FOOTER ===== */
.statement-footer {
    margin-top: 6mm;
    display: flex;
    justify-content: space-between;
    font-size: 8pt;
    color: #888;
    border-top: 1px solid #ddd;
    padding-top: 2mm;
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: #ffffff;
    }

    .statement-toolbar {
        display: none;
    }

    .statement-page {
        margin: 0;
        width: auto;
        min-height: auto;
        box-shadow: none;
        padding: 0;
    }

    .statement-table th {
        background: #d9e2f3 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .totals-footer-row {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .due-to-grower-row {
        background: #fce4ec !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    thead {
        display: table-header-group;
    }

    tr {
        page-break-inside: avoid;
    }

    .statement-logo {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page {
        size: A4;
        margin: 10mm;
    }
}
