/* =========================================================================
   Reports Print Stylesheet
   Applied only when printing (media="print" on the <link>)
   Converts Chicane V3 dark theme to clean white print layout
   ========================================================================= */

@media print {
    /* --- Hide UI chrome --- */
    nav,
    .toast-container,
    .report-controls,
    .report-no-print,
    .sidebar,
    .modal-overlay,
    .progress-bar,
    .progress-bar-indeterminate {
        display: none !important;
    }

    /* --- Override dark theme to white --- */
    :root {
        --bg: #fff !important;
        --surface-1: #fff !important;
        --surface-2: #f8f9fa !important;
        --border: #dee2e6 !important;
        --text: #212529 !important;
        --text-muted: #6c757d !important;
        --text-ghost: #adb5bd !important;
        --main: #2563eb !important;
    }

    html, body {
        background: #fff !important;
        color: #212529 !important;
        font-size: 10pt !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    main {
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        max-width: 100% !important;
    }

    /* --- Report container --- */
    .report-printable {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .report-printable .v3-card {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin-bottom: 12pt !important;
        box-shadow: none !important;
    }

    /* --- Tables --- */
    .report-printable .data-table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 9pt !important;
    }

    .report-printable .data-table th {
        background: #f0f0f0 !important;
        color: #212529 !important;
        border: 1px solid #ccc !important;
        padding: 4pt 6pt !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        font-size: 8pt !important;
    }

    .report-printable .data-table td {
        border: 1px solid #ddd !important;
        padding: 3pt 6pt !important;
        color: #212529 !important;
    }

    .report-printable .data-table tbody tr:nth-child(even) {
        background: #f8f9fa !important;
    }

    .report-printable .data-table thead {
        display: table-header-group !important;
    }

    .report-printable .data-table tr {
        page-break-inside: avoid !important;
    }

    /* --- Badges in print: keep colour backgrounds --- */
    .report-printable .badge {
        border: 1px solid currentColor !important;
        font-size: 8pt !important;
        padding: 1pt 4pt !important;
    }

    .report-printable .badge-success { background: #d1fae5 !important; color: #065f46 !important; }
    .report-printable .badge-error { background: #fee2e2 !important; color: #991b1b !important; }
    .report-printable .badge-warning { background: #fef3c7 !important; color: #92400e !important; }
    .report-printable .badge-info { background: #dbeafe !important; color: #1e40af !important; }

    /* --- Page breaks --- */
    .report-section {
        page-break-inside: avoid !important;
    }

    .page-break {
        page-break-before: always !important;
    }

    .report-header {
        page-break-after: avoid !important;
    }

    /* --- Activity Gantt bars: ensure colours print --- */
    .gantt-drive { background: #F44336 !important; }
    .gantt-work { background: #FF9800 !important; }
    .gantt-available { background: #2196F3 !important; }
    .gantt-rest { background: #4CAF50 !important; }
    .gantt-assumed-rest { background: #5FBFA9 !important; }
    .gantt-poa { background: #9C27B0 !important; }
    .gantt-drive-oos { background: #795548 !important; }

    /* --- RAG badges --- */
    .rag-red { background: #fee2e2 !important; color: #991b1b !important; }
    .rag-amber { background: #fef3c7 !important; color: #92400e !important; }
    .rag-green { background: #d1fae5 !important; color: #065f46 !important; }

    /* --- Signature block --- */
    .signature-block {
        border: 1px solid #999 !important;
        page-break-inside: avoid !important;
    }

    .signature-line {
        border-bottom: 1px dotted #999 !important;
    }

    /* --- Report header/footer --- */
    .report-print-header {
        margin-bottom: 12pt !important;
    }

    .report-print-footer {
        font-size: 8pt !important;
        color: #6c757d !important;
        border-top: 1px solid #ccc !important;
        padding-top: 4pt !important;
        margin-top: 12pt !important;
    }
}
