<style>
    .header-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px 24px;
        margin-bottom: 16px;
        font-size: 12px;
    }

    .header-grid .field {
        display: flex;
        gap: 6px;
    }

    .header-grid .label {
        flex: 0 0 auto;
        color: #6b7280;
        white-space: nowrap;
    }

    .header-grid .value {
        flex: 1 1 auto;
        word-break: break-word;
    }

    .header-grid .field.full-width {
        grid-column: 1 / -1;
    }

    table.line-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 16px;
        font-size: 11px;
    }

    table.line-table th,
    table.line-table td {
        border: 1px solid #9ca3af;
        padding: 5px 6px;
        vertical-align: top;
        word-break: break-word;
    }

    table.line-table th {
        background: #f3f4f6;
        font-weight: 600;
        text-align: center;
    }

    table.line-table td.num {
        text-align: right;
        white-space: nowrap;
    }

    table.line-table td.center {
        text-align: center;
    }

    table.line-table td.meta {
        font-size: 10px;
        color: #4b5563;
    }

    .totals {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 12px 24px;
        margin-bottom: 28px;
        font-size: 12px;
        font-weight: 600;
    }

    .signatures {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        margin-top: 32px;
        font-size: 12px;
    }

    .signatures .slot {
        border-top: 1px solid #9ca3af;
        padding-top: 8px;
        min-height: 48px;
    }

    .amount-summary {
        margin: 20px 0 28px;
        padding: 16px 20px;
        border: 1px solid #9ca3af;
        text-align: center;
        font-size: 14px;
    }

    .amount-summary .amount-label {
        color: #6b7280;
        margin-right: 8px;
    }

    .amount-summary .amount-value {
        font-size: 20px;
        font-weight: 700;
        letter-spacing: 0.02em;
    }

    @media print {
        table.line-table thead {
            display: table-header-group;
        }

        table.line-table tr {
            page-break-inside: avoid;
        }
    }
</style>
