﻿/* ========================================================================== */
/*  GLOBAL                                                                    */
/* ========================================================================== */

body {
    font: 100% Arial, Helvetica, sans-serif;
    overflow: hidden;
    background-color: white;
}

* {
    margin: 0;
}

/* ========================================================================== */
/*  LAYOUT WRAPPER                                                            */
/* ========================================================================== */

#gesamt {
    width: 100%;
    max-width: 1224px;
    margin: 0 auto;
    background-color: white;
}

#banner {
    display: table;
    width: 100%;
    height: 80px;
    background-color: rgb(0,80,175);
}

#haupt {
    width: 100%;
    max-width: 1224px;
    position: absolute;
    top: 80px;
    bottom: 50px;
    overflow-y: auto;
    background-color: white;
    left: 0;
    right: 0;
    margin: auto;
}

#fuss {
    display: table;
    width: 100%;
    max-width: 1224px;
    position: absolute;
    height: 50px;
    background-color: rgb(0,80,175);
    bottom: 0;
}

#zelle {
    display: table-cell;
    width: 100%;
    padding-left: 2%;
    vertical-align: middle;
    font-size: 24px;
    font-weight: normal;
    color: white;
}

/* ========================================================================== */
/*  BUTTONLEISTE UND DROPDOWNS                                                */
/* ========================================================================== */

#kopfleiste-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2px;
    padding: 6px 0 2px;
    width: 98%;
}

#kopfleiste-buttons button,
#kopfleiste-buttons .dropdown {
    flex: 1;
    box-sizing: border-box;
}

#kopfleiste-buttons button {
    padding: 4px 0;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid rgb(0, 60, 175);
    text-align: center;
}

#kopfleiste-buttons .dropdown {
    position: relative;
    margin-top: -6px;
}

/* Hover */
#kopfleiste-buttons button:hover,
.dropdown-content button:hover {
    color: #fff;
    background-color: #999;
}

/* Dropdown-Inhalt */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 2px;
    width: 98%;
    background-color: #f9f9f9;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1;
    padding: 0;
    box-sizing: border-box;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content button,
.dropdown-content select,
.dropdown-content form {
    width: 100%;
    margin: 4px 0;
    text-align: left;
    box-sizing: border-box;
}

.dropdown-content form {
    border: 1px solid rgb(0, 60, 175);
    padding: 6px;
}

/* ========================================================================== */
/*  ICON                                                                      */
/* ========================================================================== */

.icon {
    display: inline-block;
    font-size: 20px;
    color:black;
    vertical-align: middle;
    margin-left: 4px;
}

/* ========================================================================== */
/*  RESPONSIVE 720px+                                                         */
/* ========================================================================== */

@media only screen and (min-width: 720px) {

    #zentrieren {
        margin-top: 25px;
        width: 748px;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }

    #label {
        margin-top: 8px;
        margin-left: 2%;
        width: 12%;
        float: left;
        font-size:12px;
        font-family: Arial, Helvetica, sans-serif;
    }

    #text {
        border: none;
        margin: 6px 0 0 2%;
        width: 82%;
        float: left;
        padding: 3px;
    }

    table {
        border: 2px solid rgb(0,80,175);
        border-collapse: collapse;
        background-color: #eee;
        font-size:12px;
        width:96%;
        margin-left: 2%;
    }

    td, th {
        padding: 6px 2px;
        text-align: left;
    }

    #gesamtkosten {
        border: 2px solid rgb(0,80,175);
        background-color: #d0eaff;
        margin-left: 2%;
        width: 94%;
        padding: 8px;
        margin-top: 20px;
    }

    #gesamtkosten li {
        margin-bottom: 4px;
        font-size: 14px;
    }
}

/* ========================================================================== */
/*  RESPONSIVE max 900px                                                      */
/* ========================================================================== */

@media only screen and (max-width: 900px) {
    #noshow { display: none; }
    #show   { display: block; }
}

/* ========================================================================== */
/*  RESPONSIVE max 720px                                                      */
/* ========================================================================== */

@media only screen and (max-width: 720px) {

    #zentrieren {
        margin-top: 25px;
        width: 96%;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }

    #label {
        margin-top: 8px;
        margin-left: 2%;
        width: 96%;
        float: left;
        font-size:12px;
        font-family: Arial, Helvetica, sans-serif;
    }

    #text {
        border: none;
        margin: 6px 0 0 2%;
        width: 96%;
        float: left;
        padding: 3px;
    }

    /* Rahmen */
    .tabelle_rahmen {
        width: max-content;
        border: 2px solid black;
        overflow: hidden;
    }

    table {
        border: 2px solid rgb(0,80,175);
        border-collapse: collapse;
        background-color: #eee;
        font-size: 12px;
        width: 96%;
        margin-left: 2%;
    }

    td, th {
        padding: 2px;
        text-align: left;
    }

    th {
        text-orientation: mixed;
        transform: rotate(-90deg);
        height: 90px;
        width: 40px;
        vertical-align: middle;
        padding: 0;
    }
}

/* ========================================================================== */
/*  INPUTS                                                                    */
/* ========================================================================== */

input.fullwidth:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    width: 95%;
    z-index: 1000;
    font-size: 16px;
}

input[type=text],
input[type=number] {
    width: 100%;
    box-sizing: border-box;
}

input[type=checkbox] {
    width: auto;
}

button {
    padding: 5px 10px;
    cursor: pointer;
}

/* Remove number input arrows */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* ========================================================================== */
/*  SCHALTFLAECHEN                                                            */
/* ========================================================================== */

.schaltflaeche {
    border: 1px solid rgb(0,80,175);
    border-radius: 12px;
    margin-top: 8px;
    margin-left: 2%;
    width: 96%;
    min-height: 28px;
    font-size: 12px;
    line-height: 1.4;
    background-color: rgb(217,217,217);
    cursor: pointer;
    padding: 4px 8px;
    box-sizing: border-box;
}

.schaltflaeche:hover {
    color: #fff;
    background-color: #999;
}

/* ========================================================================== */
/*  TABLE LAYOUT & FIELDSETS                                                  */
/* ========================================================================== */

fieldset {
    background-color:#F2F2F2;
    margin-left: 2%;
    margin-right: 2%;
}

.table-lock {
    pointer-events: none;
    opacity: 0.6;
}

/* ========================================================================== */
/*  KONTAINER KLASSEN                                                         */
/* ========================================================================== */

.container_oben,
.container {
    display: flex;
    justify-content: space-between;
    gap: 2%;
    background-color:white;
    max-width: 1224px;
}

.container_oben {
    width: 100%;
}

.block_oben {
    width: 45%;
    margin-left: 1%;
    border: 1px solid rgb(0, 60, 175);
}

.container {
    padding-top: 0;
    margin-left: 1%;
    width: 97%;
}

.block {
    width: 30%;
    margin: 0 1%;
    border: 1px solid rgb(0, 60, 175);
}

.inputfeld {
    border: 1px solid rgb(0, 60, 175);
    border-radius: 4px;
    padding: 6px;
    width: 100%;
    background-color: white;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    box-sizing: border-box;
}

/* ========================================================================== */
/*  HEADINGS                                                                  */
/* ========================================================================== */

h1, h2, h3, h4 {
    color: #000;
    font-weight: normal;
    margin-left: 2%;
}

h1 { padding: 16px 0 4px; font-size: 24px; }
h2 { padding: 12px 0 4px; font-size: 18px; }
h3 { padding: 8px 0 4px;  font-size: 12px; }
h4 { padding: 3px 0;      font-size: 14px; text-align: center; }

/* ========================================================================== */
/*  PRINT OPTIMIZATION                                                        */
/* ========================================================================== */

@media print {

    /* 1. Layout frei geben */
    html, body, #gesamt, #haupt, #zentrieren {
        position: static !important;
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
    }

    #banner,
    #kopfleiste-buttons,
    #fuss {
        position: static !important;
    }

    button {
        display: none !important;
    }

    body {
        background: white !important;
    }

    /* 2. Tabellen korrekt umbrechen */
    table {
        width: 100% !important;
        border-collapse: collapse;
        table-layout: auto;
        page-break-inside: auto;
    }

    thead {
        display: table-header-group; /* Kopfzeile wiederholen */
    }

    tfoot {
        display: table-footer-group;
    }

    tr {
        page-break-inside: avoid; /* Verschnitt verhindern */
        page-break-after: auto;
        height: auto !important;
        overflow: visible !important;
    }

    td, th {
        page-break-inside: avoid;
        white-space: normal;
        height: auto !important;
        overflow: visible !important;
    }
    
    /* Container umbauen für Druck */
    .container,
    .container_oben {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        page-break-inside: avoid;
        box-sizing: border-box;
    }

    .block,
    .block_oben {
        flex: 1 1 0 !important;     /* flex-grow = 1, flex-basis = 0 */
        margin-right: 1% !important;
        margin-bottom: 8px !important;
        page-break-inside: avoid;
        box-sizing: border-box;
        min-width: 0;               /* verhindert Überlauf */
    }

    /* Letzter Block in jeder Reihe */
    .block:last-child,
    .block_oben:last-child {
        margin-right: 0 !important;
    }
}
