body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 800px; /* Reduzierte maximale Breite */
    margin: 50px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: #2F4F4F;
}

.info {
    margin-bottom: 30px;
    text-align: center;
}

.info .button {
    margin-right: 10px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.table th {
    background-color: #F0F0F0;
    color: #696969;
}

.table th a {
    color: inherit;
    text-decoration: none;
}

.table .actions {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    text-align: center;
}

.button, .receipt-button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    color: white;
    background-color: #4F2F4F;
    border: none;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    margin: 0 5px;
}

.button:hover, .receipt-button:hover {
    background-color: #6A2F6A;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.form-group label {
    width: 150px; /* Breite der Label */
    font-weight: bold;
    margin-right: 10px;
    color: #2F4F4F;
}

.form-group input, .form-group select, .form-group textarea {
    padding: 12px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    flex: 1; /* Eingabefelder nehmen den verfügbaren Platz ein */
}

.form-group input#kd_number {
    max-width: 150px; /* 8-stellig */
}

.form-group input#amount {
    max-width: 150px; /* 8-stellig */
}

.form-group input#date {
    max-width: 150px; /* 8-stellig */
}

.form-group select#vat {
    max-width: 150px; /* 8-stellig */
}

.form-group select#country {
    max-width: 300px; /* 20-stellig */
}

.form-group input#customer {
    max-width: 300px; /* 20-stellig */
}

.form-group textarea#description {
    max-width: 600px; /* 100-stellig */
    height: 100px;
}

.error-message {
    color: red;
    font-weight: bold;
    margin-bottom: 15px;
}

.receipt-container {
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.1);
}

.receipt-header {
    text-align: center;
    margin-bottom: 30px;
    color: #2F4F4F;
}

.receipt-info {
    margin-bottom: 30px;
}

.receipt-info p {
    margin-bottom: 5px;
    color: #696969;
}

.receipt-info span {
    font-weight: bold;
    color: #000;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
}

.receipt-table th, .receipt-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.receipt-table th {
    background-color: #F0F0F0;
    color: #696969;
    text-align: left;
}

.receipt-table td {
    text-align: right;
}

.receipt-table .beschreibung {
    text-align: left;
}

.receipt-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

.signature {
    font-family: 'Quentin', cursive;
    font-size: 1.5em;
    color: #2F4F4F;
}

@font-face {
    font-family: 'Quentin';
    src: url('quentin.otf') format('opentype');
}

@page {
    size: A4 landscape;
    margin: 0;
}

@media print {
    body {
        margin: 0;
        padding: 0;
    }
    .receipt-container {
        width: 50%; /* Nutzt die halbe Breite von A4 */
        height: auto; /* Passt die Höhe automatisch an */
        margin: 0 auto; /* Zentriert die Container */
        padding: 10mm;
        border: none;
        box-shadow: none;
        page-break-after: avoid;
    }

    .receipt-footer {
        page-break-before: avoid;
    }

    .receipt-button {
        display: none;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    .form-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-group label {
        width: 100%;
        margin-bottom: 5px;
    }

    .form-group input, .form-group select, .form-group textarea {
        width: 100%;
        max-width: none;
    }

    .button, .receipt-button {
        font-size: 14px;
        padding: 10px 16px;
        width: auto;
    }
}
