/* ==================== A4 DOCUMENT TEMPLATES — CV PILAR PELANGI UTAMA ==================== */
.doc-page {
    width: 794px;
    min-height: auto;
    background: #ffffff;
    color: #111827;
    font-family: Arial, 'Plus Jakarta Sans', Helvetica, sans-serif;
    font-size: 11.5px;
    line-height: 1.44;
    position: relative;
    overflow: visible;
    padding: 28px 36px 28px;
    box-sizing: border-box;
}

/* ==================== 1. ORDER PRINTING FORM (Matches Uploaded Image) ==================== */
.opf-page {
    padding: 26px 34px 30px;
    font-family: Calibri, Arial, Helvetica, sans-serif;
    color: #000000;
}
.opf-top-filter {
    width: 430px;
    border-collapse: collapse;
    margin-bottom: 18px;
}
.opf-top-filter td {
    border: 1.5px solid #000;
    background: #dbeafe;
    padding: 5px 8px;
    font-size: 11.5px;
    font-weight: 700;
}
.opf-top-filter td:first-child { width: 145px; }

.opf-title-wrap {
    border-top: 3px double #000;
    border-bottom: 1.5px solid #000;
    text-align: center;
    padding: 7px 0;
    margin-bottom: 14px;
}
.opf-title-wrap h1 {
    margin: 0;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: #000;
}

.opf-meta-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
    font-size: 11.5px;
}
.opf-meta-table td {
    padding: 2.5px 4px;
    vertical-align: top;
    font-weight: 700;
}
.opf-meta-table td:first-child {
    width: 130px;
}

.opf-head-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}
.opf-head-table th {
    border: 1px solid #374151;
    padding: 8px 8px;
    font-size: 11.5px;
    font-weight: 700;
    text-align: center;
    background: #ffffff;
}
.opf-head-table th.qty-col {
    background: #6ea8dc;
    color: #000;
    width: 78px;
}

.opf-item-group {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 9px;
    border: 1px solid #374151;
}
.opf-item-group td {
    padding: 5px 8px;
    font-size: 11.5px;
    vertical-align: middle;
}
.opf-group-main td {
    background: #f1f5f9;
    font-weight: 800;
    border-bottom: 1px solid #64748b;
}
.opf-group-main td.qty-cell {
    background: #9cc2e5;
    text-align: center;
    border-left: 1px solid #374151;
    border-right: 1px solid #374151;
    width: 78px;
    font-size: 12.5px;
}
.opf-sub-row td {
    background: #ffffff;
    font-size: 11px;
}
.opf-sub-row td.sub-label {
    border-left: 1px solid #9ca3af;
    border-bottom: 1px dotted #9ca3af;
    padding-left: 8px;
}
.opf-sub-row:last-child td.sub-label { border-bottom: none; }
.opf-sub-row td.sub-qty {
    background: #e6f0fa;
    text-align: center;
    font-weight: 700;
    border-left: 1px solid #374151;
    border-right: 1px solid #374151;
    border-bottom: 1px dotted #9ca3af;
    width: 78px;
}
.opf-sub-row:last-child td.sub-qty { border-bottom: none; }

/* ==================== 2. CV PILAR INVOICE & SURAT JALAN (EXACT MATCH TO PDF) ==================== */
.pilar-inv-page {
    padding: 26px 32px 30px;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    color: #000000;
    font-size: 11.5px;
}
.pilar-top-row {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 10px;
}
.pilar-left-col { flex: 1.18; }
.pilar-right-col { width: 325px; flex-shrink: 0; }

.pilar-comp-box {
    border: 1.2px solid #000;
    border-radius: 7px;
    padding: 6px 10px;
    margin-left: 88px;
    margin-bottom: 10px;
    min-height: 62px;
}
.pilar-comp-name {
    font-weight: 800;
    font-size: 12px;
    border-bottom: 1.3px dashed #000;
    padding-bottom: 3px;
    margin-bottom: 4px;
    letter-spacing: 0.2px;
}
.pilar-comp-addr {
    font-size: 11px;
    line-height: 1.35;
    white-space: pre-line;
}

.pilar-party-block {
    display: flex;
    align-items: stretch;
}
.pilar-party-labels {
    width: 88px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    font-size: 11px;
    padding-top: 6px;
}
.pilar-party-lbl-item {
    display: flex;
    justify-content: space-between;
    padding-right: 8px;
}
.pilar-party-merged-box {
    flex: 1;
    border: 1.2px solid #000;
    border-radius: 7px;
    overflow: hidden;
}
.pilar-party-half {
    padding: 5px 9px;
    font-size: 11px;
    line-height: 1.35;
    min-height: 56px;
}
.pilar-party-half.top-half {
    border-bottom: 1.3px dashed #000;
}
.pilar-party-half strong {
    display: block;
    font-size: 11.5px;
    font-weight: 800;
    margin-bottom: 2px;
}

.pilar-doc-title {
    margin: 0 0 4px;
    font-size: 28px;
    font-weight: 400;
    text-align: right;
    letter-spacing: 0.8px;
    line-height: 1.1;
}
.pilar-meta-box {
    border: 1.2px solid #000;
    border-radius: 7px;
    overflow: hidden;
}
.pilar-meta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.pilar-meta-table td {
    width: 50%;
    padding: 5px 8px;
    vertical-align: top;
    border-bottom: 1.3px dashed #000;
    border-right: 1.3px dashed #000;
    height: 44px;
}
.pilar-meta-table tr:last-child td { border-bottom: none; }
.pilar-meta-table td:last-child { border-right: none; }
.pilar-meta-lbl { font-size: 10px; display: block; margin-bottom: 3px; }
.pilar-meta-val { font-size: 10.2px; text-align: center; display: block; font-weight: 700; white-space: nowrap; }

.pilar-items-table {
    width: 100%;
    border-collapse: collapse;
    border: 1.2px solid #000;
    margin-bottom: 8px;
}
.pilar-items-table th {
    border: 1.2px solid #000;
    padding: 5px 6px;
    font-size: 11.5px;
    font-weight: 600;
    text-align: center;
    background: #ffffff;
}
.pilar-items-table td {
    border-left: 1.2px solid #000;
    border-right: 1.2px solid #000;
    padding: 4px 6px;
    font-size: 11.2px;
    vertical-align: top;
}
.pilar-items-spacer td {
    height: 145px;
}

.pilar-bottom-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}
.pilar-bottom-left { flex: 1.45; }
.pilar-bottom-right { width: 245px; flex-shrink: 0; }

.pilar-say-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 12px;
}
.pilar-say-lbl {
    width: 36px;
    font-size: 11.5px;
    padding-top: 5px;
    flex-shrink: 0;
}
.pilar-say-box {
    flex: 1;
    border: 1.2px solid #000;
    border-radius: 7px;
    padding: 5px 10px;
    font-size: 11.2px;
    min-height: 30px;
}

.pilar-sig-desc {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.pilar-sig-col {
    width: 140px;
    flex-shrink: 0;
    font-size: 11.5px;
}
.pilar-sig-space {
    height: 76px;
    display: flex;
    align-items: center;
}
.pilar-sig-space img {
    max-height: 74px;
    max-width: 135px;
    object-fit: contain;
}
.pilar-desc-wrap {
    flex: 1;
}
.pilar-desc-label {
    font-size: 11px;
    margin-bottom: 2px;
    padding-left: 4px;
}
.pilar-desc-box {
    border: 1.2px solid #000;
    border-radius: 7px;
    padding: 7px 10px;
    min-height: 66px;
    font-size: 11px;
    white-space: pre-line;
}

.pilar-totals-top {
    border: 1.2px solid #000;
    border-radius: 7px;
    padding: 6px 10px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.pilar-tot-line {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}
.pilar-tot-line .lbl { text-align: right; width: 105px; }
.pilar-totals-grand {
    border: 1.5px solid #000;
    border-radius: 7px;
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    font-weight: 800;
}

/* ==================== 3. QUOTATION & REPORT SHARED STYLES ==================== */
.kop-pilar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #0f2942;
    padding-bottom: 10px;
    margin-bottom: 14px;
    position: relative;
}
.kop-pilar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 3px;
    background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981, #0ea5e9, #6366f1);
}
.kop-pilar-brand { display: flex; align-items: center; gap: 12px; }
.kop-pilar-brand img { height: 54px; width: auto; object-fit: contain; }
.kop-pilar-brand h1 { margin: 0; font-size: 16.5px; font-weight: 800; color: #0f2942; }
.kop-pilar-brand p { margin: 2px 0 0; font-size: 10.8px; color: #475569; white-space: pre-line; line-height: 1.35; }
.kop-pilar-right { text-align: right; }
.kop-pilar-right h2 { margin: 0; font-size: 18px; font-weight: 800; color: #0f2942; }
.kop-pilar-right span {
    display: inline-block;
    margin-top: 4px;
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fdba74;
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 11px;
}

.q-meta-grid { display: flex; justify-content: space-between; gap: 22px; margin-bottom: 12px; }
.q-to { flex: 1.15; }
.q-info { flex: 0.95; }
.q-info-table { width: 100%; border-collapse: collapse; }
.q-info-table td { padding: 1.5px 4px; vertical-align: top; }
.q-info-table td:first-child { width: 96px; font-weight: 600; }

.q-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 16px;
    margin: 6px 0 10px;
    padding: 7px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 11px;
}
.q-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; }
.q-table th, .q-table td { border: 1px solid #9ca3af; padding: 6px 8px; text-align: left; font-size: 11.2px; }
.q-table th { background: #f3f4f6; font-weight: 700; color: #111827; }
.q-table .tr { text-align: right; }
.q-table .tc { text-align: center; }

.q-bottom-split { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-top: 10px; }
.q-bottom-terms { flex: 1.65; min-width: 0; }
.q-bottom-sig {
    flex: 0.85;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #fcfcfd;
}
.q-terms { margin-top: 4px; font-size: 10.4px; white-space: pre-line; line-height: 1.42; color: #1f2937; }
.q-closing { margin-top: 8px; font-size: 10.8px; white-space: pre-line; line-height: 1.4; color: #374151; }
.sig-img-wrap { height: 78px; display: flex; align-items: center; justify-content: center; margin: 4px 0; }
.sig-img-wrap img { max-height: 76px; max-width: 140px; object-fit: contain; }
.sig-name { font-weight: 700; font-size: 11.8px; border-top: 1px solid #374151; padding-top: 3px; min-width: 145px; }
.sig-title { font-style: italic; font-size: 10.8px; color: #374151; }

.fin-summary-pdf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 14px; }
.fin-box-pdf { border: 1px solid #cbd5e1; border-radius: 8px; padding: 9px 12px; background: #f8fafc; }
.fin-box-pdf span { font-size: 11px; color: #475569; display: block; }
.fin-box-pdf strong { font-size: 14.5px; display: block; margin-top: 4px; }

.sj-sign-col { width: 200px; text-align: center; }
.sj-sign-space { height: 76px; display: flex; align-items: center; justify-content: center; }
.sj-sign-space img { max-height: 74px; max-width: 140px; object-fit: contain; }
.sj-sign-line { border-top: 1px solid #374151; padding-top: 4px; font-weight: 700; font-size: 11.5px; }

/* ==================== PRINT MEDIA RULES ==================== */
.print-only-container { display: none; }
@media print {
    @page { size: A4 portrait; margin: 0; }
    body > *:not(#print-only-container) { display: none !important; }
    #print-only-container { display: block !important; width: 100%; background: #fff; }
    .doc-page { width: 100%; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
