<?php
/**
 * Report view styles (front-end Reports screen).
 *
 * The reports are generated by the same PHP as the backend report page, which
 * styles them with `assets/admin/css/style.css` plus the `.invoice-box` rules the
 * print screens use. The dashboard loads neither, so the report rendered unstyled.
 *
 * Everything below is the report-relevant subset of those stylesheets, prefixed
 * with `.wcrb-report-view` so it reproduces the backend look without leaking into
 * the rest of the dashboard (or into the invoice/receipt screens).
 *
 * Loaded only on `?screen=reports` — see MYACCOUNT_FOLDER_URL usages in
 * class-wcrb_myaccount_dashboard.php.
 *
 * @package computer-repair-shop
 */

/* ===== Report region: white panel, so the sheet (and any table wider than it)
   always sits on white rather than the dashboard's grey backdrop ===== */
.wcrb-report-view {
    background: #fff;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .65rem;
    padding: 1.25rem 1rem;
    box-shadow: 0 4px 16px rgba(16, 42, 84, .05);
    overflow-x: auto;
}

/* ===== A4 sheet (mirrors the invoice / receipt print view) ===== */
.wcrb-report-view .invoice-box,
.wcrb-report-view .report-container {
    max-width: 800px;
    margin: 0 auto 1.5rem;
    padding: 30px;
    border: 1px solid #eee;
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(0, 0, 0, .15);
    background-color: #fff;
    font-size: 12px;
    line-height: 1.4;
    color: #555;
}

.wcrb-report-view .invoice-box:after {
    clear: both;
    display: table;
    content: "";
}

/* ===== Report header (same head on every report, like the backend) ===== */
.wcrb-report-view .report-container .company_info {
    position: relative;
    padding-top: 10px;
    padding-bottom: 10px;
    margin: auto;
    border-bottom: 1px solid #ededed;
    text-align: right;
    display: flex;
}

.wcrb-report-view .report-container .company_info img {
    height: 55px;
    width: auto;
}

.wcrb-report-view .invoice-box .address-side h2,
.wcrb-report-view .invoice-box .address-side p,
.wcrb-report-view .report-container .company_info .address-side h2,
.wcrb-report-view .report-container .company_info .address-side p {
    margin-top: 0;
    margin-bottom: 5px;
}

.wcrb-report-view .company_logo_wrap { text-align: left; }

.wcrb-report-view .company_logo_wrap,
.wcrb-report-view .address-side {
    flex: 1;
    align-self: center;
}

.wcrb-report-view .wc-rb-report-title h2 {
    font-size: 1.4em;
    margin-top: 10px;
    margin-bottom: 10px;
    text-align: center;
    font-weight: 600;
    color: #333;
}

.wcrb-report-view .wc-rb-report-title h1 {
    font-size: 18px;
    margin-bottom: 10px;
}

.wcrb-report-view .wc-rb-report-period p {
    margin-top: 10px;
    margin-bottom: 10px;
}

.wcrb-report-view .wc-rb-report-period p span.statementPeriod {
    float: right;
    text-align: right;
}

.wcrb-report-view .wc-rb-report-period p:after {
    clear: both;
    display: table;
    width: 100%;
    content: '';
}

/* ===== Tables ===== */
.wcrb-report-view .invoice-box table {
    width: 100%;
    line-height: inherit;
    text-align: left;
}

.wcrb-report-view .invoice-box table td {
    padding: 5px;
    vertical-align: top;
}

.wcrb-report-view .invoice-box table tr td:nth-child(2) {
    text-align: right;
}

.wcrb-report-view .invoice-box table .special_head td:nth-child(2) {
    text-align: left;
}

.wcrb-report-view .invoice-box table tr.heading td,
.wcrb-report-view .invoice-box table tr.heading th {
    background: #eee;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
}

.wcrb-report-view .invoice-box table tr.item-row td {
    border-bottom: 1px solid #eee;
}

.wcrb-report-view .invoice-box table tr.item-row td:nth-child(2) {
    text-align: left;
}

.wcrb-report-view .invoice-box table tr.item-row td:last-child {
    text-align: right;
}

.wcrb-report-view .invoice-box table tr.total td:nth-child(2) {
    border-top: 2px solid #eee;
    font-weight: bold;
}

.wcrb-report-view .invoice-box table tr.information table td {
    padding-bottom: 15px;
}

.wcrb-report-view .invoice-box table tr.item-row:last-child > td {
    border-bottom: 0;
}

.wcrb-report-view .invoice-items,
.wcrb-report-view .invoice_totals,
.wcrb-report-view .invoice_headers {
    font-size: 12px;
    line-height: 1.4;
}

/* Foundation-ish tables used by the built-in generators */
.wcrb-report-view .wc_table th {
    text-align: left;
    padding: 4px;
    border: 1px solid #f1f1f1;
    background: #f1f1f1;
}

.wcrb-report-view .wc_table td {
    text-align: left;
    padding: 6px;
    background: #fff;
    border: 1px solid #fff;
}

.wcrb-report-view .grey-bg {
    background-color: #f7f7f7;
    width: 100%;
}

.wcrb-report-view .no-padding-table { margin-top: 0; }

/* ===== Totals block: bordered, right-aligned, floats right ===== */
.wcrb-report-view .invoice_totals table {
    border: 1px solid #ededed;
    max-width: 250px;
    text-align: right;
    float: right;
    margin-bottom: 15px;
}

.wcrb-report-view .invoice_totals table tr td:nth-child(2),
.wcrb-report-view .invoice_totals table tr th:first-child {
    text-align: right;
}

.wcrb-report-view .invoice_totals:after {
    clear: both;
    display: table;
    content: "";
}

/* ===== Print button (same markup the generators print) ===== */
.wcrb-report-view .button.hidden-print {
    margin-top: 35px;
    float: right;
}

.wcrb-report-view button.button,
.wcrb-report-view input[type="submit"].button,
.wcrb-report-view .button.button-primary {
    display: inline-block;
    width: auto;
    padding: .5rem 1.1rem;
    border: 0;
    border-radius: .35rem;
    background: #063e70;
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
}

/* ===== Print ===== */
@media print {
    .wcrb-report-view {
        background: transparent !important;
        border: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    .wcrb-report-view .invoice-box,
    .wcrb-report-view .report-container {
        box-shadow: none !important;
        border: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
        border-radius: 0 !important;
    }

    .wcrb-report-view .button.hidden-print,
    .wcrb-report-view .hidden-print {
        display: none !important;
    }
}
