body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Roboto, sans-serif;
  background-color: #f7f9fc;
  color: #212529;
  line-height: 1.6;
  cursor: default;
  text-decoration: none;
}

.container {
  max-width: 800px;
  margin: 1rem auto;
  padding: 2rem;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

p {
  margin: 0;
}

h1 {
  text-align: center;
  font-size: 3.2rem;
  color: #0077cc;
  margin: 0;
  margin-bottom: 1.5rem;
  letter-spacing: -2px;
}

h2 {
  color: #0077cc;
}

hr {
  margin-top: 2rem;
  margin-bottom: 2rem;
  height: 1px;
  border: none;
  background-color: #ebebeb;
}
.hero-image {
  /* display: block; */
  max-width: 100%;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.item-spalte {
  flex: 1 1 0;
}

p.intro {
  font-size: 1.1rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
  color: #333;
}

p.info {
  font-size: 0.95rem;
  /* margin-top: 2rem; */
  margin-bottom: 2rem;
  color: #555;
}

.validation {
  text-align: center;
}

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

.file-label {
  margin-bottom: 0.5rem;
  font-weight: bold;
}

input[type="file"] {
  margin-bottom: 1rem;
  background-color: #ffffff;
  color: #212529;
  padding: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.drop-zone {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 2px dashed #0077cc;
  padding: 3rem;
  border-radius: 12px;
  background-color: #f0f4f8;
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
}

.drop-zone:hover {
  background-color: #e3effb;
}

.drop-zone::before {
  top: -14px;
  left: 17px;
  position: absolute;
  font-size: 0.9rem;
  padding-inline-start: 5px;
  padding-inline-end: 5px;
  background: #ffffff;
  color: #bbbbbb;
  content: "Rechnung hochladen";
  border-radius: 5px;
}

.drop-label {
  color: #0077cc;
  font-size: 1.1rem;
  cursor: pointer;
  pointer-events: none; /* mach es für Mausklicks durchlässig */
  display: block;
}

.drop-zone.dragover {
  background-color: #d0e9ff;
  border-color: #005fa3;
}

button {
  background-color: #0077cc;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: #005fa3;
}

.result-box {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: #f1f3f5;
  border-radius: 8px;
  max-height: 70vh;
  overflow-y: auto;
  border: 1px solid #ddd;
}

a.button {
  display: inline-block;
  background-color: #0077cc;
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.2s ease;
}

a.button:hover {
  background-color: #005fa3;
}

ul {
  list-style: none;
  padding-left: 1.2rem;
}
.info ul {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

.info li {
  position: relative;
  padding-left: 1.2em;
  margin-bottom: 0.3rem;
}

.info li::before {
  content: ">"; /* Benutzerdefiniertes Symbol */
  position: absolute;
  left: 0;
  color: #333; /* oder z. B. var(--primary-color) */
  font-weight: bold;
}

/* === Lade-Overlay === */
.loading-overlay {
  display: none;
  position: fixed;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  justify-content: center;
  align-items: center;
  color: #0077cc;
  font-size: 1.5rem;
  font-family: sans-serif;
}

.loading-container {
  position: relative;
  align-items: center;
  justify-content: center;
  display: flex;
  flex-direction: column;
  margin: 2rem;
}

.loading-spinner {
  border: 4px solid #ddd;
  border-top: 4px solid #0077cc;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}
#loading-pic {
  width: 165px;
  box-shadow: 1px 1px 5px grey;
}
.line {
  position: absolute;
  top: -1%;
  left: -5%;
  width: 110%;
  height: 2px;
  background-color: rgb(10, 230, 10);
  box-shadow: 0px 0px 6px 2px greenyellow;
  animation: scan 3s linear alternate infinite;
}

@keyframes scan {
  0% {
    top: -1%;
  }
  100% {
    top: 101%;
  }
}

footer {
  text-align: center;
  margin-bottom: 1rem;
}

a {
  text-decoration: none;
  color: inherit;
}

footer a:hover {
  text-shadow: 1px 1px 5px #555;
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 1rem;
}

#positionen {
  width: 100%;
  border-collapse: collapse;
}

#positionen tbody {
  vertical-align: text-top;
}

#positionen td {
  padding-inline-end: 5px;
}

#summen {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}
#summen th {
  font-weight: bold;
}
#summen td {
  text-align: right;
  width: 10rem;
}

.bl-tabelle {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.bl-tabelle thead {
  background-color: #eaeaea;
  text-align: left;
}

.bl-tabelle th,
.bl-tabelle td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #ddd;
}

.bl-tabelle tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.bl-tabelle td:first-child {
  font-weight: 700;
}

#kopfdaten {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
#kopfdaten th {
  font-weight: bold;
  width: 30%;
  text-align: left;
}
#kopfdaten td {
  padding-inline-start: 1rem;
}
#kopfdaten tr {
  vertical-align: top;
}
.nicht_zugeordnet {
  background-color: #ffe0e0;
  color: #900;
  font-style: italic;
}
.nicht_zugeordnet::before {
  content: "❌ ";
  color: #c00; /* optional für rote Farbe */
  margin-right: 4px;
}
.zugeordnet::before {
  content: "✅ ";
  color: #090; /* optional für grüne Farbe */
  margin-right: 4px;
}

.optional {
  display: none;
}

.container-2spalten {
  display: flex;
  flex-direction: row;
  /* gap: 1rem; */
  justify-content: space-between;
}

.invalid {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
}
.valid {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
}

.blocktext {
  text-align: justify;
}

.linke-spalte {
  width: 45%;
  font-size: 0.9rem;
  position: relative;
}
.rechte-spalte {
  font-size: 0.9rem;
  width: 42%;
  overflow-wrap: normal;
}

#invoice_type {
  font-size: 1.5rem;
  font-weight: bold;
  text-transform: uppercase;
}

/* === Fehler-Tabellenstil für Validierung === */
.tbl-errors {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background-color: #fff5f5;
  border: 1px solid #e0b4b4;
  font-family: sans-serif;
  font-size: 0.75rem;
  box-shadow: 2px 2px 4px 1px grey;
}

.tbl-errors thead {
  background-color: #f8d7da;
  color: #721c24;
  font-weight: bold;
}

.tbl-errors th,
.tbl-errors td {
  border: 1px solid rgb(224, 180, 180);
  padding: 0.6rem 0.8rem;
  text-align: left;
}

.tbl-errors tr.error {
  background-color: #fbfbe9;
}

.tbl-errors td {
  vertical-align: top;
}

.tbl-warning {
  background-color: #fbfbe9;
}

/* Fehler-Tabelle */
.validation-errors h3 {
  color: #b22222;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.result-fußzeile {
  font-size: 0.7rem;
  color: rgb(128, 128, 128);
  margin-top: 2rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.border-text {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 10px;
  padding-top: 15px;
  padding-bottom: 15px;
  position: relative;
  transition: 0.3s;
  text-align: left;
}
.border-text:hover {
  box-shadow: 3px 3px 5px #ddd;
}

.border-text::before {
  top: -9px;
  left: 17px;
  position: absolute;
  font-size: 0.7rem;
  padding-inline-start: 5px;
  padding-inline-end: 5px;
  background: #ffffff;
  color: #bbbbbb;
}

#invoiceMetaData {
  font-size: 0.85rem;
  margin: auto;
  margin-top: 1rem;
  width: 400px;
}

#invoiceMetaData::before {
  content: "Rechnungseckdaten";
}

#tableMetaData {
  text-align: left;
  font-size: 0.8rem;
}

#tableMetaData th {
  width: 100px;
}

#Adressat::before {
  content: "Rechnungsempfänger";
}

#Ansprechpartner-Käufer::before {
  content: "Ansprechpartner-Käufer";
}

#Lieferadresse::before {
  content: "Lieferadresse";
}

#container-positionen {
  margin-top: 4rem;
  margin-bottom: 2rem;
}
#container-positionen::before {
  content: "Positionen";
}

#container-zahlung {
  font-size: 0.85rem;
  max-width: calc(
    (800px - 4rem - 3rem) / 2
  ); /* hälfte containerbreite abzgl. padding und gap zwischen Spalten */
  overflow-wrap: anywhere;
}
#container-zahlung::before {
  content: "Zahlungsbedingungen";
}

#container-bemerkungen {
  margin-top: 4rem;
  margin-bottom: 2rem;
  font-size: 0.85rem;
}
#container-bemerkungen::before {
  content: "Bemerkungen";
}

#container-bemerkungen ul {
  margin-top: 0rem;
  margin-bottom: 0rem;
  padding-inline-start: 0;
}

#container-anlagen {
  margin-top: 4rem;
  margin-bottom: 2rem;
  font-size: 0.85rem;
}
#container-anlagen::before {
  content: "Anlagen zur Rechnung";
}

#div-summen {
  padding: 10px;
}

#container-zahl-sum {
  display: flex;
  margin-top: 2rem;
  margin-bottom: 4rem;
  justify-content: space-between;
  gap: 3rem;
}

#bankverbindungen td {
  padding-inline: 0.5rem;
  line-height: 0.8rem;
}

#test {
  overflow: scroll; /* PDF-Anlagen Bezeichnung sind zu lang */
}

#validierung {
  transition: 1s ease-out background-color;
  animation: fading-valid 3s ease-out;
}

/* #validierung:hover {
  background-color: rgb(77 255 0 / 35%);
} */

#attachments-list {
  line-height: 2rem;
}

@keyframes fading-valid {
  0% {
    background-color: #ffffff;
  }
  40% {
    background-color: rgb(77 255 0 / 35%);
  }
  100% {
    background-color: #ffffff;
  }
}

#validierung-invalid {
  transition: 1s ease-out background-color;
  animation: fading-invalid 3s ease-out;
}

/* #validierung-invalid:hover {
  background-color: rgb(224 180 180 / 35%);
} */

#savePdfBtn {
  display: flex;
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  width: 50px;
  height: 50px;
  padding: 0;
  padding-bottom: 5px;
  border-radius: 50%;
  border: 5px solid rgb(255 255 255);
  font-size: 2rem;
  align-items: center;
  justify-content: center;
}

@keyframes fading-invalid {
  0% {
    background-color: #ffffff;
  }
  40% {
    background-color: rgb(224 180 180 / 35%);
  }
  100% {
    background-color: #ffffff;
  }
}

@media print {
  .no-print {
    display: none !important;
  }

  #print-area {
    background: #fff;
    overflow: hidden;
    box-shadow: none;
  }
}

@media (max-width: 600px) {
  .container-2spalten {
    flex-direction: column-reverse;
    align-items: center;
    gap: 3rem;
  }

  .linke-spalte {
    width: inherit;
    font-size: 0.85rem;
  }
  .rechte-spalte {
    width: inherit;
  }

  .border-text {
    width: 80vw;
  }

  #invoiceMetaData {
    width: inherit;
  }

  .valid {
    font-size: 1.2rem;
  }

  #positionen {
    font-size: 0.7rem;
  }

  #container-zahl-sum {
    flex-direction: column-reverse;
    font-size: 0.85rem;
  }

  /* Druck-Button ausblenden */
  #savePdfBtn {
    display: none;
  }
}
