/* ==========================================================================
    print.css  —  Print rules (hide chrome, keep report/table content)
    ========================================================================== */

@media print {
    body {
        background: #fff !important;
        padding: 0 !important;
    }
    .app { display: block; }
    .topbar,
    .sidebar,
    .sidebar-overlay,
    .sidebar-toggle,
    .mobile-toggle,
    .back-to-top,
    .loading-overlay,
    .filters,
    .actions,
    .mode-buttons,
    .footer,
    .btn,
    .section-title.noprint,
    .search-box,
    .nav,
    .account-menu { display: none !important; }

    .content,
    .app-footer {
        margin-left: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
    }
    .card,
    .content-card {
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }
    table.rep th,
    table th,
    th {
        background: var(--green) !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .table-responsive { overflow: visible !important; width: 100% !important; border: none; }
    .table-scroll { overflow: visible !important; width: 100% !important; border: none; box-shadow: none !important; border-radius: 0 !important; background: transparent !important; }
    table { page-break-inside: auto; }

    /* Admin data tables: keep natural column widths but ALLOW wrapping so no
       column is clipped at the page edge. Wide tables flow across pages. */
    table.data-table {
        width: auto !important;
        min-width: 100% !important;
        background: transparent !important;
        border-collapse: collapse;
        font-size: 11px;
    }
    table.data-table thead th {
        position: static !important;
        border-radius: 0 !important;
        background: var(--green) !important;
    }
    table.data-table tbody td {
        white-space: normal !important;
        word-break: break-word;
        background: transparent !important;
    }
    /* Column sizing helpers: let them shrink/wrap instead of forcing a fixed
       width that could push columns off the page. */
    table.data-table th.col-sm, table.data-table td.col-sm,
    table.data-table th.col-md, table.data-table td.col-md,
    table.data-table th.col-lg, table.data-table td.col-lg { width: auto !important; min-width: 0 !important; }
    table.data-table td.wrap-col,
    table.data-table td.subject-col { white-space: normal !important; max-width: none !important; }

    tr { page-break-inside: avoid; }
    thead { display: table-header-group; }

    /* Charts: reduce footprint for print but keep section visible */
    .charts { display: grid !important; grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; margin-bottom: 10px !important; }
    .chart-box { height: auto !important; min-height: 200px !important; padding: 10px !important; }
    .chart-box canvas { max-height: 180px !important; }
    .chart-box.tall { height: auto !important; min-height: 200px !important; }
    .chart-box.tall canvas { max-height: 180px !important; }
}
