/*
 * Modern report presentation with print-safe A4 and receipt output.
 * This is a visual layer only; report data and print triggers stay intact.
 */

:root {
    --rp-bg: #f8f6f3;
    --rp-surface: #ffffff;
    --rp-ink: #20242c;
    --rp-muted: #6d7480;
    --rp-line: #ebe7e2;
    --rp-primary: #ee3f2b;
    --rp-primary-dark: #c92518;
    --rp-primary-soft: #fff0ed;
}

html {
    min-height: 100%;
    background:
        radial-gradient(circle at 8% 12%, rgba(255, 183, 43, .14), transparent 26rem),
        radial-gradient(circle at 92% 0, rgba(238, 63, 43, .10), transparent 30rem),
        var(--rp-bg);
}

body.report-modern {
    box-sizing: border-box;
    width: min(1100px, calc(100% - 36px)) !important;
    min-height: auto !important;
    height: auto !important;
    margin: 28px auto !important;
    padding: 32px !important;
    border: 1px solid rgba(224, 218, 211, .92);
    border-radius: 22px;
    color: var(--rp-ink);
    background: var(--rp-surface);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 13px;
    line-height: 1.45;
    box-shadow: 0 24px 65px rgba(77, 45, 33, .14);
    -webkit-font-smoothing: antialiased;
}

body.report-modern *,
body.report-modern *::before,
body.report-modern *::after {
    box-sizing: border-box;
}

body.report-modern > div[align="center"]:first-of-type {
    margin: -32px -32px 24px;
    padding: 27px 32px 23px;
    border-bottom: 1px solid var(--rp-line);
    border-radius: 22px 22px 0 0;
    background:
        radial-gradient(circle at 92% 0, rgba(238, 63, 43, .14), transparent 13rem),
        linear-gradient(135deg, #fffaf8, #fbfaf8);
    text-align: left !important;
}

body.report-modern > div[align="center"]:first-of-type h1,
body.report-modern > div[align="center"]:first-of-type h2 {
    margin: 0;
    color: var(--rp-ink);
    font-size: 24px;
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: -.035em;
}

body.report-modern > div[align="center"]:first-of-type h1::before,
body.report-modern > div[align="center"]:first-of-type h2::before {
    width: 42px;
    height: 42px;
    margin-right: 12px;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(145deg, #ff624d, #c92518);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    font-size: 17px;
    content: "↗";
    box-shadow: 0 10px 22px rgba(201, 37, 24, .23);
}

body.report-modern > table:not(.css-data_table):first-of-type {
    width: auto;
    min-width: 330px;
    margin: 0 0 22px;
    padding: 11px 14px;
    border: 1px solid var(--rp-line);
    border-radius: 13px;
    background: #fbfaf8;
}

body.report-modern > table:not(.css-data_table):first-of-type td {
    padding: 3px 9px;
    color: var(--rp-muted);
}

body.report-modern > table:not(.css-data_table):first-of-type td:first-child {
    color: var(--rp-ink);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .035em;
    text-transform: uppercase;
}

body.report-modern .css-data_table {
    width: 100%;
    margin: 0;
    border: 1px solid var(--rp-line) !important;
    border-radius: 15px;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: hidden;
    font-size: 12px;
}

body.report-modern .css-data_table th {
    padding: 12px 11px;
    border: 0 !important;
    border-bottom: 1px solid #e2dcd6 !important;
    color: var(--rp-muted);
    background: #fbf9f7;
    font-size: 10px !important;
    font-weight: 900;
    letter-spacing: .05em;
    text-align: left;
    text-transform: uppercase;
}

body.report-modern .css-data_table td {
    padding: 10px 11px !important;
    border: 0 !important;
    border-bottom: 1px solid #f0ece8 !important;
    color: #3b4048;
    background: #fff;
    vertical-align: middle;
}

body.report-modern .css-data_table tr:nth-child(even) > td {
    background: #fdfcfb;
}

body.report-modern .css-data_table tr:hover > td {
    background: #fff7f5;
}

body.report-modern .css-data_table tr:has(td[colspan]) > td {
    color: var(--rp-ink);
    background: #fff9f7;
    font-weight: 750;
}

body.report-modern .css-data_table tr:last-child > td {
    border-bottom: 0 !important;
    color: var(--rp-primary-dark);
    background: var(--rp-primary-soft);
    font-size: 13px;
    font-weight: 900;
}

body.report-modern .css-data_table td[align="right"] {
    font-variant-numeric: tabular-nums;
}

body.report-modern .css-no_print {
    margin: 22px 0 0;
    padding: 18px 0 0;
    border-top: 1px solid var(--rp-line);
}

body.report-modern .css-no_print hr {
    display: none;
}

body.report-modern #print_report,
body.report-modern button {
    min-height: 43px;
    padding: 10px 18px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--rp-primary), var(--rp-primary-dark));
    font-family: inherit;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .02em;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(201, 37, 24, .22);
}

body.report-modern #print_report:hover,
body.report-modern button:hover {
    filter: brightness(.96);
    transform: translateY(-1px);
}

body.report-modern.report-modern--ticket {
    width: min(390px, calc(100% - 24px)) !important;
    margin: 18px auto !important;
    padding: 20px !important;
    border-radius: 18px;
    font-size: 12px;
}

body.report-modern.report-modern--ticket > div[align="center"]:first-of-type {
    margin: -20px -20px 18px;
    padding: 22px 20px 18px;
    border-radius: 18px 18px 0 0;
    text-align: center !important;
}

body.report-modern.report-modern--ticket > .center:first-child {
    margin: -20px -20px 18px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--rp-line);
    border-radius: 18px 18px 0 0;
    background:
        radial-gradient(circle at 85% 0, rgba(238, 63, 43, .15), transparent 10rem),
        #fff9f7;
}

body.report-modern.report-modern--ticket > .center:first-child h3,
body.report-modern.report-modern--ticket > .center:first-child h4 {
    margin: 2px 0;
    color: var(--rp-ink);
    font-weight: 900;
}

body.report-modern.report-modern--ticket > div[align="center"]:first-of-type h1,
body.report-modern.report-modern--ticket > div[align="center"]:first-of-type h2 {
    font-size: 18px;
}

body.report-modern.report-modern--ticket > div[align="center"]:first-of-type h1::before,
body.report-modern.report-modern--ticket > div[align="center"]:first-of-type h2::before {
    width: 34px;
    height: 34px;
    margin: 0 auto 9px;
    display: flex;
    font-size: 14px;
}

body.report-modern.report-modern--ticket > table:not(.css-data_table):first-of-type {
    width: 100%;
    min-width: 0;
    margin-bottom: 15px;
    padding: 8px;
}

body.report-modern.report-modern--ticket .css-data_table {
    font-size: 10px;
}

body.report-modern.report-modern--ticket .css-data_table th,
body.report-modern.report-modern--ticket .css-data_table td {
    padding: 7px 5px !important;
}

body.report-modern.report-modern--ticket > table:not(.css-data_table) {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

body.report-modern.report-modern--ticket > table:not(.css-data_table) th,
body.report-modern.report-modern--ticket > table:not(.css-data_table) td {
    padding: 6px 4px;
    border-bottom: 1px solid #f0ece8;
}

body.report-modern.report-modern--ticket > table:not(.css-data_table) th {
    color: var(--rp-muted);
    background: #fbf9f7;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

body.report-modern.report-modern--ticket .no-print {
    margin-top: 16px;
    padding-top: 15px;
    border-top: 1px solid var(--rp-line);
    text-align: center;
}

@media (max-width: 700px) {
    body.report-modern {
        width: calc(100% - 20px) !important;
        margin: 10px auto !important;
        padding: 18px !important;
        border-radius: 16px;
    }

    body.report-modern > div[align="center"]:first-of-type {
        margin: -18px -18px 18px;
        padding: 21px 18px 18px;
        border-radius: 16px 16px 0 0;
    }

    body.report-modern > div[align="center"]:first-of-type h1,
    body.report-modern > div[align="center"]:first-of-type h2 {
        font-size: 19px;
    }

    body.report-modern .css-data_table {
        display: block;
        overflow-x: auto;
    }
}

@media print {
    @page {
        margin: 10mm;
    }

    html {
        background: #fff !important;
    }

    body.report-modern {
        width: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        color: #000 !important;
        background: #fff !important;
        font-family: Arial, Helvetica, sans-serif !important;
        box-shadow: none !important;
    }

    body.report-modern > div[align="center"]:first-of-type {
        margin: 0 0 6mm !important;
        padding: 0 0 4mm !important;
        border-radius: 0 !important;
        background: #fff !important;
        text-align: center !important;
    }

    body.report-modern > div[align="center"]:first-of-type h1,
    body.report-modern > div[align="center"]:first-of-type h2 {
        color: #000 !important;
        font-size: 17pt !important;
    }

    body.report-modern > div[align="center"]:first-of-type h1::before,
    body.report-modern > div[align="center"]:first-of-type h2::before {
        display: none !important;
    }

    body.report-modern > table:not(.css-data_table):first-of-type {
        margin-bottom: 4mm;
        padding: 0;
        border: 0;
        background: #fff;
    }

    body.report-modern .css-data_table {
        border: 1px solid #333 !important;
        border-radius: 0;
        font-size: 9pt;
    }

    body.report-modern .css-data_table th,
    body.report-modern .css-data_table td {
        padding: 2.2mm 2mm !important;
        border-right: 1px solid #777 !important;
        border-bottom: 1px solid #777 !important;
        color: #000 !important;
        background: #fff !important;
    }

    body.report-modern .css-no_print {
        display: none !important;
    }

    body.report-modern .no-print {
        display: none !important;
    }

    body.report-modern.report-modern--ticket {
        width: 80mm !important;
        font-size: 9pt !important;
    }

    body.report-modern.report-modern--ticket .css-data_table {
        border: 0 !important;
        font-size: 8pt;
    }

    body.report-modern.report-modern--ticket .css-data_table th,
    body.report-modern.report-modern--ticket .css-data_table td {
        padding: 1mm .7mm !important;
        border-right: 0 !important;
    }

    body.report-modern.report-modern--ticket > .center:first-child {
        margin: 0 0 3mm !important;
        padding: 0 0 2mm !important;
        border-radius: 0 !important;
        background: #fff !important;
    }
}
