/* DRUCK-LAYOUT MIT EXAKTEN SPALTENBREITEN */
@media print {

    .nonprintable,
    header,
    footer,
    nav,
    .header,
    .footer,
    button,
    input[type="button"],
    input[type="submit"] {
        display: none !important;
    }

    html,
    body,
    main,
    .content,
    .container,
    .container_inhalt,
    .raster-container,
    .admin-box {
        display: block !important;
        position: static !important;
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background-color: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
        border: none !important;
    }

    table,
    table.auswertung_tabelle {
        display: table !important;
        width: 100% !important;
        border-collapse: collapse !important;
        position: static !important;
    }

    tr {
        display: table-row !important;
        page-break-inside: auto !important
            /* Verhindert das Aufteilen von Zeilen über Seiten hinweg */
        ;
        break-inside: auto !important
            /* Moderne Alternative zu page-break-inside */
        ;
    }

    td,
    th {
        display: table-cell !important;
        padding: 4px !important;
        font-size: 16px !important;
        /* Etwas kleinere Schrift spart Platz */
        border: 1px solid #ccc !important;
        /* Feine Linien für die Lesbarkeit */
        white-space: nowrap !important;
        /* Verhindert den automatischen Zeilenumbruch */
        overflow: hidden !important;
        /* Versteckt den Text, der über den Rand ragt */
        text-overflow: ellipsis !important;
        /* Fügt die "..." am Ende ein */
    }

    /* NEU: Millimetergenaue Breitenverteilung für die Spalten im Druck */
    table.auswertung_tabelle th:nth-child(1),
    table.auswertung_tabelle td:nth-child(1) {
        width: 100px !important;
        font-family: monospace;
    }

    /* SKU */

    table.auswertung_tabelle th:nth-child(2),
    table.auswertung_tabelle td:nth-child(2) {
        width: 100px !important;
        font-family: monospace;
    }

    /* EAN */

    table.auswertung_tabelle th:nth-child(3),
    table.auswertung_tabelle td:nth-child(3) {
        width: 50px !important;
        text-align: right;
    }

    /* Vor Inventur */

    table.auswertung_tabelle th:nth-child(4),
    table.auswertung_tabelle td:nth-child(4) {
        width: 50px !important;
        text-align: right;
    }

    /* Gezählt */

    table.auswertung_tabelle th:nth-child(5),
    table.auswertung_tabelle td:nth-child(5) {
        width: 50px !important;
        text-align: right;
    }

    /* Differenz */

    table.auswertung_tabelle th:nth-child(6),
    table.auswertung_tabelle td:nth-child(6) {
        width: auto !important;
        /* Nimmt sich vollautomatisch den gesamten restlichen Platz! */
        text-align: left !important;
    }

    /* Artikelbezeichnung */
    thead {
        display: table-header-group !important;
    }

    tfoot {
        display: table-footer-group !important;
    }

    /* Definiert den Fußzeilen-Bereich für den Druck */
    @page {
        @bottom-right {
            content: "Seite " counter(page) " von " counter(pages);
            padding-bottom: 30px;
        }
    }

    /* SCHWARZ-WEIß-GRAU UMWELT-DRUCKMODUS (ECO PRINT STYLES) */

    .seite_ueberschrift {
        display: none !important;
    }

    .printable,
    #printonly {
        display: block !important;
    }

    /* Zwingt den Drucker zu reinem Schwarz-Weiß und spart teuren Toner */
    /* (Zusammengeführt oben mit allgemeinen layout-Einstellungen) */

    /* Tabellenkopf-Druck: Stahlblau wird zu umweltschonendem Rein-Weiß/Hellgrau */
    #auswertung th {
        background-color: #e2e8f0 !important;
        /* Sehr helles, toner-schonendes Grau */
        color: #000000 !important;
        border-bottom: 2px solid #000000 !important;
        font-weight: bold !important;
    }

    #auswertung td {
        border-bottom: 1px solid #cccccc !important;
        color: #000000 !important;
    }

    #auswertung tr:nth-of-type(odd) {
        background-color: #f7fafc !important;
        /* Ganz zartes Grau für Zeilenwechsel auf Papier */
    }
}