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

body {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: #f2f2f2;
    margin: 0;
    color: #101010;
    line-height: 1.6;
}

.pdf-actions {
    width: min(210mm, calc(100% - 24px));
    margin: 10px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.pdf-actions a,
.pdf-actions button {
    background: #0f3f22;
    color: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-family: inherit;
    border-radius: 8px;
}

.pdf-actions a:focus-visible,
.pdf-actions button:focus-visible,
.documento-head-actions a:focus-visible {
    outline: 3px solid #6fc392;
    outline-offset: 2px;
}

.documento-head-actions {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 14px;
}

.documento-head-actions a {
    background: #0f3f22;
    color: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-family: inherit;
    border-radius: 8px;
}

.documento {
    width: min(210mm, calc(100% - 24px));
    min-height: 297mm;
    margin: 20px auto;
    background: #fff;
    padding: 20mm;
    color: #111;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.pdf-header {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
}

.pdf-header img {
    height: 45px;
}

.pdf-header .logo-der {
    justify-self: end;
    height: 40px;
}

.header-center {
    text-align: center;
}

.doc-tipo {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
}

.doc-org {
    font-size: 12px;
    color: #555;
}

.doc-ref {
    font-size: 12px;
    color: #777;
    margin-top: 3px;
}

.documento-header h1 {
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0 0 5px;
}

.documento-header h2 {
    font-size: 16px;
    color: #2f2f2f;
    margin: 0;
}

.documento-meta {
    font-size: 14px;
    margin-top: 12px;
    line-height: 1.65;
}

.documento-contenido {
    font-size: 15px;
    line-height: 1.72;
    text-align: left;
}

.section {
    margin-bottom: 18px;
}

.bloque {
    margin-bottom: 22px;
}

.bloque-titulo {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px;
}

.bloque .section:last-child,
.bloque .kpis:last-child {
    margin-bottom: 0;
}

.kpis {
    margin: 0 0 18px;
    padding: 0 0 0 20px;
}

.kpis li {
    padding: 4px 0;
    margin-bottom: 6px;
    font-weight: 500;
    list-style: disc;
}

.highlight {
    margin-top: 35px;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    letter-spacing: 0.3px;
}

.pdf-footer {
    margin-top: 40px;
    padding-top: 15px;
    border-top: 1px solid #ccc;
    font-size: 13px;
}

.contacto {
    margin-top: 10px;
    font-style: normal;
}

.bloque,
.kpis,
.pdf-header,
.pdf-footer,
.highlight {
    break-inside: avoid;
    page-break-inside: avoid;
}

h1,
h2,
h3 {
    break-after: avoid;
    page-break-after: avoid;
}

@media (max-width: 800px) {

    .pdf-actions,
    .documento {
        width: calc(100% - 16px);
    }

    .documento {
        min-height: auto;
        padding: 16px;
    }

    .pdf-header {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
    }

    .pdf-header .logo-der,
    .pdf-header .logo-izq {
        justify-self: center;
    }
}

@media print {
    body {
        background: white;
    }

    .pdf-actions {
        display: none;
    }

    .documento-head-actions {
        display: none;
    }

    .documento {
        margin: 0;
        box-shadow: none;
        width: 100%;
    }
}