trabajando en el pdf

This commit is contained in:
2025-10-12 23:28:33 +02:00
parent 99d27cd3ed
commit c15fff73ee
8 changed files with 243 additions and 373 deletions

View File

@ -1,225 +1,144 @@
/* === Fuentes ===
* Para HTML→PDF con OpenHTMLtoPDF, es preferible registrar las TTF en el renderer.
* Aun así, incluimos @font-face por si renderizas en navegador.
* Coloca los TTF en /static/fonts/ y ajusta los nombres si procede.
*/
/* Open Sans (rutas relativas desde css → fonts) */
@font-face {
font-family: "Open Sans";
src: url("/assets/fonts/OpenSans-Regular.ttf") format("truetype");
src: url("../fonts/OpenSans-Regular.ttf") format("truetype");
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: "Open Sans";
src: url("/assets/fonts/OpenSans-SemiBold.ttf") format("truetype");
src: url("../fonts/OpenSans-SemiBold.ttf") format("truetype");
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: "Open Sans";
src: url("/assets/fonts/OpenSans-Bold.ttf") format("truetype");
src: url("../fonts/OpenSans-Bold.ttf") format("truetype");
font-weight: 700;
font-style: normal;
}
:root {
--text: #1f2937;
--muted: #6b7280;
--border: #e5e7eb;
--brand: #0ea5e9; /* azul suave */
--bg-light: #f8fafc; /* gris muy claro */
--ink: #1b1e28;
--muted: #5b6472;
--accent: #0ea5e9; /* azul tira a cyan */
--line: #e6e8ef;
--bg-tag: #f4f7fb;
}
@page {
size: A4;
margin: 18mm 15mm 22mm 15mm;
@bottom-right {
content: "Página " counter(page) " / " counter(pages);
}
margin: 15mm 14mm 18mm 14mm;
@bottom-right { content: "Página " counter(page) " / " counter(pages); }
}
html, body {
font-family: "Open Sans", Arial, sans-serif;
color: var(--text);
color: var(--ink);
font-size: 11pt;
line-height: 1.35;
}
* { box-sizing: border-box; }
.doc-header {
/* Top band */
.topbar {
display: table;
width: 100%;
margin-bottom: 10mm;
border-bottom: 2px solid var(--brand);
border-bottom: 2px solid var(--accent);
padding-bottom: 6mm;
margin-bottom: 6mm;
}
.brand {
display: table-cell;
vertical-align: top;
width: 60%;
}
.logo {
height: 34px;
margin-bottom: 6px;
}
.brand-meta { margin-top: 4px; }
.company-name {
font-weight: 700;
font-size: 12pt;
}
.company-meta {
color: var(--muted);
font-size: 9.5pt;
}
.brand { display: table-cell; width: 60%; vertical-align: top; }
.logo { height: 30px; display: block; margin-bottom: 4px; }
.brand-name { font-weight: 700; }
.brand-meta { color: var(--muted); font-size: 9.5pt; }
.doc-title { display: table-cell; width: 40%; text-align: right; font-weight: 700; letter-spacing: 3px; }
.doc-title {
display: table-cell;
vertical-align: top;
width: 40%;
text-align: right;
}
.title-main {
font-size: 18pt;
font-weight: 700;
letter-spacing: 0.5px;
}
.doc-info {
margin-top: 6px;
margin-left: auto;
font-size: 10pt;
border-collapse: collapse;
}
.doc-info td {
padding: 3px 0 3px 12px;
border-bottom: 1px solid var(--border);
}
.doc-info td:first-child {
color: var(--muted);
padding-left: 0;
}
.right { text-align: right; }
.blocks {
display: table;
/* ficha superior */
.sheet-info {
width: 100%;
table-layout: fixed;
margin-bottom: 8mm;
border-collapse: collapse;
margin: 4mm 0 6mm 0;
font-size: 10.5pt;
}
.block {
display: table-cell;
width: 50%;
padding-right: 6mm;
vertical-align: top;
.sheet-info td {
border: 1px solid var(--line);
padding: 4px 6px;
}
.block:last-child { padding-right: 0; }
.sheet-info .lbl { color: var(--muted); margin-right: 4px; }
.sheet-info .val { font-weight: 700; }
/* Línea título libro */
.line-title {
margin: 3mm 0 5mm 0;
padding: 4px 6px;
background: var(--bg-tag);
border-left: 3px solid var(--accent);
font-size: 10.5pt;
}
.line-title .lbl { color: var(--muted); margin-right: 6px; font-weight: 600; }
/* Specs 2 columnas */
.specs { display: table; width: 100%; table-layout: fixed; margin-bottom: 6mm; }
.specs .col { display: table-cell; width: 50%; padding-right: 6mm; vertical-align: top; }
.specs .col:last-child { padding-right: 0; }
.block-title {
font-weight: 600;
text-transform: uppercase;
font-weight: 700;
color: var(--accent);
font-size: 10pt;
color: var(--brand);
margin-bottom: 2mm;
}
.block-body {
border: 1px solid var(--border);
padding: 4mm;
background: var(--bg-light);
}
.row {
margin-bottom: 2mm;
display: block;
}
.row .label {
display: inline-block;
width: 27%;
color: var(--muted);
}
.row .value {
display: inline-block;
width: 70%;
vertical-align: top;
margin: 2mm 0 1mm 0;
}
.kv { margin: 1mm 0; }
.kv span { color: var(--muted); display: inline-block; min-width: 55%; }
.kv b { font-weight: 600; }
.subblock { margin-top: 3mm; }
.table-section .section-title,
.notes .section-title {
font-weight: 600;
font-size: 10.5pt;
margin: 6mm 0 2mm 0;
}
.services { margin: 0; padding-left: 14px; }
.services li { margin: 1mm 0; }
.items {
width: 100%;
border-collapse: collapse;
font-size: 10.5pt;
}
.items thead th {
text-align: left;
border-bottom: 2px solid var(--brand);
padding: 6px 6px;
background: #eef8fe;
font-weight: 600;
}
.items tbody td {
border-bottom: 1px solid var(--border);
padding: 6px 6px;
vertical-align: top;
}
.items .col-right { text-align: right; }
.items .col-center { text-align: center; }
.items .col-desc .desc { font-weight: 600; }
.items .col-desc .meta { color: var(--muted); font-size: 9.5pt; margin-top: 2px; }
.items .group-header td {
background: var(--bg-light);
color: var(--brand);
font-weight: 600;
}
.totals {
margin-top: 6mm;
display: block;
width: 100%;
}
.totals-table {
margin-left: auto;
border-collapse: collapse;
min-width: 70mm;
}
.totals-table td {
padding: 4px 0 4px 14px;
border-bottom: 1px solid var(--border);
}
.totals-table td:first-child {
color: var(--muted);
padding-left: 0;
}
.totals-table .total-row td {
border-bottom: 2px solid var(--brand);
padding-top: 6px;
padding-bottom: 6px;
}
.totals-table .right { text-align: right; }
.notes .note-text {
border: 1px solid var(--border);
padding: 4mm;
/* Bloque marcapáginas */
.bookmark {
margin-top: 4mm;
border: 1px dashed var(--line);
padding: 3mm;
background: #fff;
font-size: 10pt;
white-space: pre-wrap;
}
.bookmark .bk-title {
font-weight: 700; margin-bottom: 2mm;
}
.doc-footer {
/* Tabla de precios (tiradas) */
.prices {
width: 100%;
border-collapse: collapse;
margin-top: 6mm;
font-size: 10.5pt;
}
.prices thead th {
text-align: left;
padding: 6px;
border-bottom: 2px solid var(--accent);
background: #eef8fe;
font-weight: 700;
}
.prices tbody td {
border-bottom: 1px solid var(--line);
padding: 6px;
}
.prices .col-tirada { width: 22%; font-weight: 700; }
/* Footer */
.footer {
margin-top: 8mm;
border-top: 1px solid var(--line);
padding-top: 4mm;
border-top: 1px solid var(--border);
display: table;
width: 100%;
font-size: 9.5pt;
color: var(--muted);
font-size: 9pt;
}
.footer-left { display: table-cell; }
.footer-right {
display: table-cell;
text-align: right;
}
.footer .address { display: table-cell; width: 45%; }
.footer .privacy { display: table-cell; width: 55%; }
.pv-title { font-weight: 700; margin-bottom: 1mm; color: var(--ink); }
.pv-text { line-height: 1.25; }
/* Compatibilidad PDF (OpenHTMLtoPDF) */
.page-number::after { content: counter(page); }
.page-count::after { content: counter(pages); }
.page-count { margin-top: 2mm; text-align: right; font-size: 9pt; color: var(--muted); }
.page::after { content: counter(page); }
.pages::after { content: counter(pages); }