/* ============================================================================
 * print.css
 * ----------------------------------------------------------------------------
 * ========================================================================= */


/* ============================================================================
* @page – Seitenränder / Format
* ========================================================================= */
@page {
  size: A4;
  margin: 2cm 1.5cm;
}

/* ============================================================================
 * Basis
 * ========================================================================= */
html,
body {
  background: #fff !important;
  color: #000 !important;
  font-size: 12pt;
  line-height: 1.4;
}

/* Farben für Druck erzwingen (z. B. Rahmen, Hintergründe) */
* {
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* Hyperlinks unterstreichen & URL ausgeben */
a {
  color: #000;
  text-decoration: underline;
}

a[href^="http"]::after {
  content: " (" attr(href) ")";
  font-size: 0.8em;
  color: #555;
}

/* Keine unnötigen Seitenbrüche innerhalb von Blöcken */
h1, h2, h3, h4, h5, h6 {
  break-after: avoid-page;
  page-break-after: avoid;
}

p, li, img {
  break-inside: avoid-page;
  page-break-inside: avoid;
}

div:has(> h2) + .table-root,
div:has(> h1) + .table-root {
  break-before: avoid;
  page-break-before: avoid;
}

/* ============================================================================
 * Tabellen – fließender Druck, keine eigenen Seiten
 * ----------------------------------------------------------------------------
 * Auf dem Screen scrollen Tabellen (HeroUI: .table-root / .scroll-table).
 * Beim Druck werden die Scroll-Container aufgelöst, damit der komplette
 * Inhalt ausgegeben wird, und die Spaltenbreiten auf A4 Hochformat
 * skaliert. Zeilen bleiben ungespalten, der Tabellenkopf wiederholt sich
 * auf jeder Seite.
 * ========================================================================= */
table {
  width: 100%;
  border-collapse: collapse;
  break-inside: auto !important;
  page-break-inside: auto !important;
}

thead {
  display: table-header-group;
}

tr {
  break-inside: avoid-page;
  page-break-inside: avoid;
}

/* Scroll-Container auflösen – nur sichtbarer Teil würde sonst gedruckt */
.table-root,
.scroll-table,
[class*="overflow-auto"] {
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
  min-width: 0 !important;
  width: 100% !important;
  margin-bottom: 2rem;
}

/* Sticky-Header beim Drucken deaktivieren */
.scroll-table th {
  position: static !important;
}

/* Erzwungene Min-Zellenbreiten aufheben → Spalten skalieren auf A4 */
.inline-end-items td,
.inline-end-items th {
  min-width: 0 !important;
  width: auto !important;
}

.up-to-four-columns td:not(:first-child),
.up-to-six-columns td:not(:first-child) {
  width: auto !important;
}

/* Spaltenreiche Tabellen kompakter + Umlagen statt Abschneiden */
.inline-end-items .table__cell,
.inline-end-items .table__column,
.up-to-six-columns .table__cell,
.up-to-six-columns .table__column {
  padding: 0.3rem !important;
  white-space: normal !important;
}

th, td {
  border: 1px solid #ccc;
  padding: 0.25rem 0.5rem;
  min-width: 0 !important;
  height: auto !important;
}

/* ============================================================================
 * Form Elemente
 * ========================================================================= */

[data-slot="input-wrapper"] {
  border: none;
}


input::placeholder, textarea::placeholder {
  color: transparent;
}

/* ============================================================================
 * Komponenten
 * ========================================================================= */
.input {
  border: none;
  box-shadow: none;
}

.combo-box__trigger {
  visibility: hidden;
}

/* ============================================================================
 * Layout
 * ========================================================================= */
[data-testid="topbar"], [data-testid="topbar"] * {
  color: black;
  background: transparent;
}

/* ============================================================================
 * Print-spezifische Utilities / Ad-hoc-Regeln
 * ========================================================================= */
.print-page-break {
  break-before: page;
  page-break-before: always;
}