/* ============================================================================
   impresion.css — Informes en papel y PDF por Ctrl+P (A-12).
   Se carga siempre y solo actúa en @media print: sin menú, sin barra,
   sin botones, cifras tabulares alineadas y sin cortes a mitad de fila.
   ========================================================================== */

@page {
  size: A4 portrait;
  margin: 14mm 13mm 16mm;
}

@media print {
  html,
  body {
    height: auto;
    overflow: visible;
    background: #FFFFFF;
    color: #111111;
    font-size: 9.5pt;
  }

  /* Todo lo que no es documento desaparece del papel */
  .menu,
  .barra,
  .pestanas,
  .barra-totales,
  .dialogo,
  .velo,
  .boton,
  .boton-ia,
  .boton-icono,
  .insignia,
  .chat-compositor,
  .chat-panel,
  .acciones-informe,
  .navegacion-informe,
  .sugerencia,
  .aviso-barra,
  [data-no-imprimir] {
    display: none !important;
  }

  .armazon {
    display: block;
    height: auto;
    overflow: visible;
  }

  .contenido {
    display: block;
    height: auto;
    overflow: visible;
  }

  .area {
    display: block;
    overflow: visible;
    padding: 0;
    height: auto;
    max-height: none;
  }

  /* El documento toma el ancho completo de la hoja */
  .informe,
  .informe * {
    max-width: 100%;
  }

  .informe {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: #FFFFFF;
    break-inside: auto;
  }

  .informe-cabecera {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12mm;
    padding-bottom: 4mm;
    margin-bottom: 4mm;
    border-bottom: 1px solid #333333;
  }

  .informe-empresa {
    font-size: 11pt;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .informe-titulo {
    font-size: 10pt;
    font-weight: 600;
    margin-top: 1mm;
  }

  .informe-meta {
    font-size: 8pt;
    color: #444444;
    text-align: right;
    line-height: 1.5;
  }

  .tabla {
    font-size: 8.5pt;
    border-collapse: collapse;
    width: 100%;
  }

  .tabla thead th {
    position: static;
    background: #FFFFFF;
    color: #111111;
    border-bottom: 1px solid #333333;
    padding: 1.6mm 2mm;
  }

  .tabla tbody td {
    padding: 1.2mm 2mm;
    border-bottom: 0.4pt solid #DDDDDD;
  }

  .tabla tbody tr:nth-child(even) {
    background: #FFFFFF;
  }

  .tabla tbody tr.es-total {
    background: #FFFFFF;
    border-top: 1px solid #333333;
  }

  .tabla tbody tr,
  .tabla thead {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  thead {
    display: table-header-group;
  }

  tfoot {
    display: table-row-group;
  }

  .tabla-envoltura {
    overflow: visible;
    max-height: none;
  }

  /* Cifras: tabulares y a la derecha también en papel (§5) */
  .num,
  .cifra,
  td.num,
  th.num {
    font-variant-numeric: tabular-nums;
    text-align: right;
  }

  .positivo { color: #1F6B4C; }
  .negativo { color: #A32B2B; }

  .rejilla-graficos,
  .rejilla-kpi {
    display: none;
  }

  .informe-seccion {
    margin-top: 5mm;
    break-inside: avoid;
  }

  .informe-seccion-titulo {
    font-size: 9pt;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2mm;
    padding-bottom: 1mm;
    border-bottom: 0.5pt solid #BBBBBB;
  }

  .informe-pie {
    margin-top: 6mm;
    padding-top: 2mm;
    border-top: 0.4pt solid #BBBBBB;
    font-size: 7.5pt;
    color: #555555;
    display: flex;
    justify-content: space-between;
    gap: 6mm;
  }

  /* Enlace y URL a la vista: nunca imprimir direcciones */
  a[href]::after { content: ""; }

  .vacio { padding: 4mm; }
}
