/**
 * Gate Pass — Print Stylesheet
 * PT Maximos Global Logistik
 */

/* ------------------------------------------------------------------ */
/* Hide non-print elements                                             */
/* ------------------------------------------------------------------ */
@media print {
    .no-print,
    nav,
    .navbar,
    .gp-sidebar,
    .gp-bottom-nav,
    .page-sidebar,
    aside,
    header.navbar,
    footer,
    .btn:not(.btn-print),
    .gp-touch,
    [data-htmx-loading],
    #gp-toast-container,
    #sse-status {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-family: 'Inter', Arial, sans-serif;
    }

    a {
        color: inherit !important;
        text-decoration: none !important;
    }

    .page-wrapper {
        margin: 0 !important;
        padding: 0 !important;
    }

    .page {
        display: block !important;
    }
}

/* ------------------------------------------------------------------ */
/* Label Thermal Print — 100mm × 150mm                                 */
/* ------------------------------------------------------------------ */
@media print {
    .gp-print-label-wrapper,
    [data-print-type="label"] {
        page-break-after: always;
    }

    .gp-label-thermal {
        width: 100mm;
        height: 150mm;
        padding: 4mm;
        box-sizing: border-box;
        font-family: Arial, sans-serif;
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }

    .gp-label-thermal .gp-label-qr {
        display: block;
        width: 60mm;
        height: 60mm;
        margin: 0 auto 4mm;
    }

    .gp-label-thermal .gp-label-qr img,
    .gp-label-thermal .gp-label-qr svg {
        width: 100%;
        height: 100%;
    }

    .gp-label-thermal .gp-label-id {
        font-size: 22pt;
        font-weight: 900;
        text-align: center;
        letter-spacing: 1px;
        margin-bottom: 2mm;
    }

    .gp-label-thermal .gp-label-type {
        font-size: 14pt;
        font-weight: 700;
        text-align: center;
        text-transform: uppercase;
        margin-bottom: 3mm;
    }

    .gp-label-thermal .gp-label-meta {
        font-size: 10pt;
        border-top: 1px solid #000;
        padding-top: 2mm;
    }

    .gp-label-thermal .gp-label-meta table {
        width: 100%;
        border-collapse: collapse;
    }

    .gp-label-thermal .gp-label-meta td {
        padding: 1mm 0;
        vertical-align: top;
    }

    .gp-label-thermal .gp-label-meta td:first-child {
        font-weight: 700;
        width: 35mm;
    }
}

/* ------------------------------------------------------------------ */
/* Surat Jalan — A4 Portrait                                           */
/* ------------------------------------------------------------------ */
@media print {
    .gp-print-surat-jalan,
    [data-print-type="surat-jalan"] {
        page-break-after: always;
    }
}

@page {
    size: A4 portrait;
    margin: 15mm 20mm;
}

@media print {
    .gp-surat-jalan {
        width: 100%;
        font-family: Arial, sans-serif;
        font-size: 10pt;
        color: #000;
    }

    .gp-surat-jalan .gp-sj-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 6mm;
        border-bottom: 2px solid #000;
        padding-bottom: 4mm;
    }

    .gp-surat-jalan .gp-sj-logo {
        height: 14mm;
    }

    .gp-surat-jalan .gp-sj-title {
        font-size: 16pt;
        font-weight: 900;
        text-align: right;
    }

    .gp-surat-jalan .gp-sj-table {
        width: 100%;
        border-collapse: collapse;
        margin: 4mm 0;
    }

    .gp-surat-jalan .gp-sj-table th,
    .gp-surat-jalan .gp-sj-table td {
        border: 1px solid #333;
        padding: 2mm 3mm;
        font-size: 9pt;
        vertical-align: top;
    }

    .gp-surat-jalan .gp-sj-table th {
        background: #f0f0f0;
        font-weight: 700;
        text-align: center;
    }

    .gp-surat-jalan .gp-sj-qr {
        position: fixed;
        bottom: 20mm;
        right: 20mm;
        width: 30mm;
        height: 30mm;
    }

    .gp-surat-jalan .gp-sj-signature {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10mm;
        margin-top: 10mm;
    }

    .gp-surat-jalan .gp-sj-signature > div {
        text-align: center;
        border-top: 1px solid #000;
        padding-top: 2mm;
        font-size: 9pt;
    }
}

/* ------------------------------------------------------------------ */
/* Report — A4 Landscape                                               */
/* ------------------------------------------------------------------ */
@media print {
    .gp-print-report [data-print-type="report"] {
        page-break-inside: avoid;
    }
}

@page :first {
    /* Use landscape for report pages when print-report class present */
}

@media print {
    .gp-print-report {
        font-family: Arial, sans-serif;
        font-size: 9pt;
        color: #000;
    }

    .gp-print-report h2 {
        font-size: 13pt;
        font-weight: 900;
        margin-bottom: 4mm;
        border-bottom: 1px solid #000;
        padding-bottom: 2mm;
    }

    .gp-report-table,
    .gp-print-report table {
        width: 100%;
        border-collapse: collapse;
        page-break-inside: auto;
    }

    .gp-report-table th,
    .gp-print-report table th {
        background: #e8e8e8;
        font-weight: 700;
        font-size: 8pt;
        text-align: left;
        border: 1px solid #666;
        padding: 2mm;
    }

    .gp-report-table td,
    .gp-print-report table td {
        border: 1px solid #aaa;
        padding: 1.5mm 2mm;
        font-size: 8pt;
        vertical-align: top;
    }

    .gp-report-table tr:nth-child(even) td,
    .gp-print-report table tr:nth-child(even) td {
        background: #f8f8f8;
    }

    /* No decorative badges/pills in reports */
    .gp-report-table .badge,
    .gp-print-report .badge {
        background: none !important;
        color: inherit !important;
        font-weight: 700;
        border: 1px solid currentColor;
        padding: 0 2px;
        font-size: 7pt;
    }
}
