/* Print Styles for Financial Reports */
@media print {
    /* Reset and Base Styles */
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body {
        font-family: 'Arial', sans-serif !important;
        font-size: 12px !important;
        line-height: 1.4 !important;
        color: #000 !important;
        background: white !important;
        margin: 0 !important;
        padding: 15px !important;
    }

    /* Hide non-printable elements */
    .no-print,
    .btn,
    .page-actions,
    .premium-btn-group,
    .navbar,
    .sidebar,
    .footer,
    .breadcrumb,
    .pagination,
    .modal,
    .tooltip,
    .popover,
    .alert,
    .dropdown-menu,
    .btn-group,
    .form-control,
    .input-group,
    .search-container,
    .filter-container,
    .sort-container,
    .action-buttons,
    .edit-btn,
    .delete-btn,
    .view-btn,
    .card-actions,
    .table-actions,
    .d-print-none {
        display: none !important;
    }

    /* Page Layout */
    @page {
        size: A4;
        margin: 1cm;
        @top-center {
            content: "تقرير مالي - " attr(data-report-title);
        }
        @bottom-center {
            content: "صفحة " counter(page) " من " counter(pages);
        }
    }

    /* Print Header */
    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
    }

    .print-header h1 {
        font-size: 18px !important;
        font-weight: bold !important;
        margin: 0 0 5px 0 !important;
        color: #000 !important;
    }

    .print-header .company-info {
        font-size: 10px !important;
        color: #666 !important;
        margin-bottom: 5px;
    }

    .print-header .report-date {
        font-size: 10px !important;
        color: #666 !important;
    }

    /* Tables */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-bottom: 20px !important;
        font-size: 11px !important;
    }

    table th,
    table td {
        border: 1px solid #000 !important;
        padding: 6px 8px !important;
        text-align: right !important;
        vertical-align: top !important;
    }

    table th {
        background-color: #f0f0f0 !important;
        font-weight: bold !important;
        font-size: 11px !important;
    }

    table tr:nth-child(even) {
        background-color: #f9f9f9 !important;
    }

    /* Cards for Print */
    .card {
        border: 1px solid #000 !important;
        margin-bottom: 15px !important;
        page-break-inside: avoid !important;
        background: white !important;
    }

    .card-header {
        background-color: #f0f0f0 !important;
        border-bottom: 1px solid #000 !important;
        padding: 8px 12px !important;
        font-weight: bold !important;
        font-size: 12px !important;
    }

    .card-body {
        padding: 10px 12px !important;
    }

    /* Statistics Summary */
    .stats-summary {
        display: flex !important;
        justify-content: space-between !important;
        margin-bottom: 20px !important;
        border: 1px solid #000 !important;
        padding: 10px !important;
    }

    .summary-item {
        text-align: center !important;
        flex: 1 !important;
    }

    .summary-value {
        font-size: 14px !important;
        font-weight: bold !important;
        color: #000 !important;
    }

    .summary-label {
        font-size: 10px !important;
        color: #666 !important;
    }

    /* Financial Cards Grid */
    .financial-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 20px !important;
    }

    .stat-card {
        border: 1px solid #000 !important;
        padding: 10px !important;
        text-align: center !important;
        background: white !important;
    }

    .stat-card h3 {
        font-size: 14px !important;
        font-weight: bold !important;
        margin: 5px 0 !important;
        color: #000 !important;
    }

    .stat-card h5 {
        font-size: 10px !important;
        margin: 0 0 5px 0 !important;
        color: #666 !important;
    }

    /* Project Cards */
    .project-card,
    .expense-card,
    .distribution-card,
    .retained-profit-card {
        border: 1px solid #000 !important;
        margin-bottom: 10px !important;
        padding: 10px !important;
        page-break-inside: avoid !important;
        background: white !important;
    }

    /* Amounts and Currency */
    .amount-display,
    .currency-display {
        font-weight: bold !important;
        color: #000 !important;
    }

    .usd-amount {
        font-size: 9px !important;
        color: #666 !important;
    }

    /* Progress Bars */
    .progress {
        display: none !important;
    }

    /* Icons */
    svg,
    .icon {
        display: none !important;
    }

    /* Text Utilities */
    .text-success,
    .text-warning,
    .text-danger,
    .text-info,
    .text-primary {
        color: #000 !important;
    }

    .text-muted {
        color: #666 !important;
    }

    /* Page Breaks */
    .page-break {
        page-break-before: always !important;
    }

    .no-page-break {
        page-break-inside: avoid !important;
    }

    /* Print Footer */
    .print-footer {
        display: block !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 9px !important;
        color: #666 !important;
        border-top: 1px solid #000;
        padding-top: 5px;
        background: white;
    }

    /* Responsive Print Layout */
    .row {
        display: block !important;
    }

    .col-lg-3,
    .col-lg-4,
    .col-lg-6,
    .col-md-3,
    .col-md-4,
    .col-md-6,
    .col-sm-6,
    .col-12 {
        width: 100% !important;
        float: none !important;
        display: block !important;
        margin-bottom: 10px !important;
    }

    /* Dashboard Specific */
    .dashboard-print .financial-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Projects Print */
    .projects-print .project-card {
        display: inline-block !important;
        width: 48% !important;
        margin-right: 2% !important;
        vertical-align: top !important;
    }

    /* Expenses Print */
    .expenses-print .expense-card {
        display: inline-block !important;
        width: 48% !important;
        margin-right: 2% !important;
        vertical-align: top !important;
    }

    /* Hide empty states */
    .empty-state {
        display: none !important;
    }

    /* Print-specific content */
    .print-only {
        display: block !important;
    }

    /* Ensure proper spacing */
    h1, h2, h3, h4, h5, h6 {
        margin-top: 15px !important;
        margin-bottom: 10px !important;
        color: #000 !important;
    }

    p {
        margin-bottom: 8px !important;
    }

    /* Table responsiveness for print */
    .table-responsive {
        overflow: visible !important;
    }

    /* Force black text for all content */
    * {
        color: #000 !important;
    }

    .text-white {
        color: #000 !important;
    }

    /* Additional Print Optimizations */
    .btn-premium-primary,
    .btn-premium-secondary,
    .btn,
    button {
        display: none !important;
    }

    /* Ensure proper table formatting */
    .table-responsive table {
        font-size: 10px !important;
    }

    .table-responsive th,
    .table-responsive td {
        padding: 4px 6px !important;
        border: 1px solid #000 !important;
    }

    /* Print-specific layout adjustments */
    .container-fluid {
        padding: 0 !important;
    }

    .row {
        margin: 0 !important;
    }

    .col-lg-3,
    .col-lg-4,
    .col-lg-6,
    .col-md-3,
    .col-md-4,
    .col-md-6 {
        padding: 0 5px !important;
    }

    /* Improve readability */
    .small,
    small {
        font-size: 9px !important;
    }

    /* Hide interactive elements */
    .dropdown,
    .modal,
    .tooltip,
    .popover,
    .collapse,
    .navbar-toggler {
        display: none !important;
    }

    /* Print Totals Styling */
    .table-dark,
    tfoot.table-dark {
        background-color: #f0f0f0 !important;
        color: #000 !important;
        border: 2px solid #000 !important;
    }

    .table-dark th {
        background-color: #e0e0e0 !important;
        color: #000 !important;
        font-weight: bold !important;
        border: 1px solid #000 !important;
    }

    /* Totals Cards */
    .border-primary,
    .border-success,
    .border-info,
    .border-warning {
        border: 2px solid #000 !important;
    }

    .bg-primary,
    .bg-success,
    .bg-info,
    .bg-warning {
        background-color: #f0f0f0 !important;
        color: #000 !important;
    }

    .text-primary,
    .text-success,
    .text-info,
    .text-warning {
        color: #000 !important;
    }

    /* Progress bars for print */
    .progress {
        display: none !important;
    }

    /* Ensure totals are prominent */
    .fw-bold {
        font-weight: bold !important;
    }

    .h4, .h5 {
        font-size: 14px !important;
        font-weight: bold !important;
    }
}
