/* ═══════════════════════════════════════════════
   Compras – Document Detail / PDF Preview
   "Paper on dark desk" aesthetic with --pv-* tokens.
   ═══════════════════════════════════════════════ */

/* ── Paper Container ─────────────────────────── */
.po-document {
    background: white;
    color: #1a202c;
    padding: 20px 30px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;

    /* Paper-on-dark-desk shadow */
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.55),
        0 4px 16px rgba(0, 0, 0, 0.35),
        0 0 100px rgba(0, 0, 0, 0.15);

    margin-top: 1.5rem;
    font-size: 0.7rem;
    position: relative;
}

/* Subtle paper edge highlight */
.po-document::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

/* ── Document Header ─────────────────────────── */
.doc-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 2px solid #dce2ea;
    padding-bottom: 10px;
}

.company-name {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.02em;
}

/* ── Header Bars (Green) ─────────────────────── */
.po-header-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    margin-bottom: 15px;
}

.po-header-bar-cell {
    background: #4A5D23;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color: white;
    padding: 5px 15px;
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
}

.po-header-bar-cell--right {
    text-align: right;
}

/* ── Info Grid (Top Section) ─────────────────── */
.po-info-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 20px;
    margin-bottom: 20px;
}

.po-info-label {
    background: #EDF2F7;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 2px 8px;
    font-size: 12px;
}

.po-info-value {
    border: 1px solid #E2E8F0;
    padding: 2px 8px;
    font-size: 12px;
}

.po-info-value--bold {
    font-weight: bold;
}

/* ── Data Table — Booktabs Look ──────────────── */
.doc-table {
    width: 100%;
    border-collapse: collapse;
}

.doc-table thead {
    border-top: 2.5px solid #2D3748;
    border-bottom: 1.5px solid #2D3748;
}

.doc-table th {
    background: #f0f4f8;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color: #2d3748;
    padding: 6px 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: left;
}

.doc-table td {
    border-bottom: 1px solid #edf2f7;
    color: #2d3748;
    padding: 6px 8px;
    font-size: 0.7rem;
}

.doc-table tbody tr:last-child td {
    border-bottom: 1.5px solid #2D3748;
}

/* Numeric alignment */
.doc-table .price-cell {
    text-align: right;
    white-space: nowrap;
    font-feature-settings: 'tnum' 1;
}

.doc-table .center-cell {
    text-align: center;
}

/* ── Footer ──────────────────────────────────── */
.doc-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 40px;
}

/* ── Totals ──────────────────────────────────── */
.totals-area {
    min-width: 280px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.82rem;
}

.total-row--grand {
    border-top: 1.5px solid #1a202c;
    padding-top: 10px;
    margin-top: 4px;
}

.main-total {
    font-weight: 800;
    font-size: 1.1rem;
    font-feature-settings: 'tnum' 1;
}

.val-box {
    background: #f7fafc;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    font-weight: bold;
}

/* ── Summary Table (Bottom Totals) ───────────── */
.po-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.po-summary-table td {
    padding: 4px;
    font-size: 13px;
}

.po-summary-table .text-right {
    text-align: right;
}

.po-summary-table .text-bold {
    font-weight: bold;
}

.po-summary-table .grand-total-row {
    border-top: 1.5px solid #000;
}

.po-summary-table .grand-total-row td {
    padding: 8px 4px;
    font-weight: 900;
}

.po-summary-table .grand-total-value {
    font-size: 15px;
}

/* ── No-break class for print ────────────────── */
.no-break {
    page-break-inside: avoid;
}