@media print {
    /* Hide non-printable elements */
    nav, .btn, .modal-overlay, .toast-container, .nav-toggle,
    .tab-bar, .filters, #stressTestCard, .form-wizard-progress,
    .import-area, .empty-state, #csvMenu { display: none !important; }

    /* Reset to print-friendly */
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 11pt;
        line-height: 1.4;
    }

    /* Only print the currently active view */
    .view { display: none !important; }
    .view.active { display: block !important; }

    /* Cards and containers */
    .card, .stat-card, .hero-card, .mini-stat, .chart-card {
        background: #fff !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        break-inside: avoid;
    }

    /* Tables */
    .loans-table { min-width: unset !important; font-size: 9pt; }
    .loans-table th { background: #f0f0f0 !important; }
    .loans-table td, .loans-table th { border: 1px solid #ccc !important; padding: 4px 6px; }

    /* Charts print as images natively */
    canvas { max-width: 100%; height: auto !important; }

    /* Header for print (locale-aware, driven by #printHeader in HTML) */
    .print-header {
        display: block !important;
        font-size: 14pt;
        font-weight: 700;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid #000;
    }

    /* Force light colors */
    * { color: #000 !important; background: transparent !important; }
    .stat-card, .hero-card, .mini-stat, .card { background: #fff !important; }
    .font-mono { font-family: 'Courier New', monospace; }

    /* Add page margin */
    @page { margin: 1.5cm; }
}
