/* Бланки документов: экранный превью и печать A4 */

.doc-preview {
    background: #e8ecf2;
    border-radius: var(--gz-radius, 12px);
    padding: 1.25rem;
}

.doc-sheet {
    max-width: 210mm;
    margin: 0 auto;
    background: #fff;
    color: #111;
    border: 1px solid #c5cdd8;
    box-shadow: 0 8px 28px rgba(20, 33, 61, .12);
    padding: 12mm 14mm;
    font-family: "Times New Roman", Times, serif;
    font-size: 11pt;
    line-height: 1.35;
}

.doc-sheet-head {
    text-align: center;
    margin-bottom: 10px;
}

.doc-sheet-title {
    font-size: 14pt;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 4px;
}

.doc-sheet-sub {
    font-size: 9pt;
    color: #444;
    margin: 0;
}

.doc-sheet-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 10px 0 14px;
    font-size: 11pt;
}

.doc-field {
    margin: 0 0 6px;
}

.doc-field b {
    font-weight: 700;
}

.doc-line {
    display: inline-block;
    min-width: 3em;
    border-bottom: 1px solid #111;
    padding: 0 2px;
}

.doc-line-wide {
    min-width: 12em;
}

.doc-section {
    border: 1px solid #111;
    padding: 8px 10px;
    margin: 8px 0;
}

.doc-section-title {
    font-weight: 700;
    font-size: 10.5pt;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.doc-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
}

.doc-sign-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.doc-sign {
    font-size: 10pt;
}

.doc-sign-line {
    margin-top: 18px;
    border-bottom: 1px solid #111;
    min-height: 1.2em;
}

.doc-sign-hint {
    font-size: 8.5pt;
    color: #555;
    text-align: center;
    margin-top: 2px;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9.5pt;
    margin-top: 8px;
}

.doc-table th,
.doc-table td {
    border: 1px solid #111;
    padding: 4px 5px;
    vertical-align: top;
}

.doc-table th {
    background: #f3f3f3;
    font-weight: 700;
    text-align: center;
}

.doc-journal-table-wrap {
    max-height: none;
}

.doc-muted {
    color: #666;
    font-size: 9pt;
}

@media (max-width: 640px) {
    .doc-grid-2,
    .doc-sign-row {
        grid-template-columns: 1fr;
    }

    .doc-sheet {
        padding: 12px;
        font-size: 10pt;
    }
}

@media print {
    @page {
        size: A4;
        margin: 10mm 12mm;
    }

    body * {
        visibility: hidden !important;
    }

    .doc-print-root,
    .doc-print-root * {
        visibility: visible !important;
    }

    .doc-print-root {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: #fff;
        padding: 0;
        margin: 0;
    }

    .doc-preview {
        background: transparent !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        display: block !important;
    }

    .doc-sheet {
        max-width: none;
        width: 100%;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        page-break-after: always;
    }

    .doc-sheet:last-child {
        page-break-after: auto;
    }

    .doc-table th {
        background: transparent !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
