* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
/* für Highlighting in input feld*/
.input-error {
    background-color: #ffdddd;
    border: 1px solid #cc0000;
}

input:invalid {
    background-color: #ffdddd;
    border-color: #cc0000;
}

input:valid {
    background-color: #ddffdd;
}

body {
  background-color: rgb(236,221,185);
  font-family: Arial, sans-serif;
  width: 100%;
  height: 100%;
  overflow-x: auto;       /* immer horizontales Scrollen ermöglichen */
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;  /* Scrollbar bleibt sichtbar, verhindert Layout-Sprung */
  scrollbar-color: auto;    /* Firefox */
  scrollbar-width: auto;
}

header {
  background-color: #333;
  color: white;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo {
  font-size: 1.2rem;
  font-weight: bold;
}

/*Tabellenmenü ANFANG*/
.hidden { display: none; }
.has-sub { position: relative; }
.submenu {
    position: absolute; top: 100%; right: 0; left: auto; min-width: 220px;
    background:#fff; border:1px solid #ddd; border-radius:8px;
    list-style:none; padding:.4rem 0; box-shadow:0 6px 18px rgba(0,0,0,.08); z-index:50;
    max-height: 500px;
    overflow-y: scroll;     /* ❗ Scrollbar IMMER anzeigen */
    scrollbar-gutter: stable both-edges
}
.submenu li a { display:block; padding:.4rem .8rem; color:#222; text-decoration:none; }
.submenu li a:hover { background:#f2f2f2; }
/*Tabellenmenü ENDE*/

nav {
  position: relative;
}

.nav-links {
  display: none;
  gap: 16px;
  list-style: none;
  flex-direction: column;
  position: relative;
  right: 0;
  top: 60px;
  background-color: #333;
  width: 200px;
  padding: 10px;
}

.nav-links.open {
  /*display: flex;*/
}

@media (min-width: 769px) {
  .nav-links {
    display: flex;
    flex-direction: row;
    position: static;
    background-color: transparent;
    width: auto;
    padding: 0;
  }
}

.nav-links a {
  color: white;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
}

.nav-links a:hover {
  background-color: #555;
}

.title {
  font-size: 1.5rem;
  font-weight: bold;
  padding-left: 15px;
  margin-top: 10px;
  margin-bottom: 4px;
}

.titleSmall {
    font-size: 1.0rem !important;
    font-weight: normal !important;
    margin-top: 3px;
    margin-bottom: 1px !important;
}

#submitButton {
    padding-left: 15px;
    margin-top: 20px;
    margin-bottom: 4px;
}

.login-btn {
  background-color: #04b;
  padding: 6px 12px;
  border-radius: 4px;
}

.burger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.burger div {
  width: 25px;
  height: 3px;
  background-color: white;
}

@media (max-width: 768px) {
  .burger {
    display: flex;
  }
}

.tablesContainerInput {
       display: flex;
       flex-wrap: wrap;
       gap: 1rem;
       max-height: 100vh;
       align-items: flex-start;
       justify-content: flex-start;     /* ❗️Ganz links beginnen */
       width: fit-content;              /* ❗️passt sich dem Inhalt an */
}

.divTitleSAndForm {
    padding-left: 15px;
}

.form-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr); /* 12-Spalten-Raster */
    gap: 10px; /* Abstand zwischen den Feldern */
    /*max-width: 1000px; /* Begrenzte Breite */
    margin: auto; /* Zentrierung */
}

.form-group {
    display: flex;
    flex-direction: column; /* Label bleibt über dem Feld */
}

.table-wrapper {
  display: block;
  /*break-inside: avoid;*/ /* verhindert Umbruch innerhalb der Tabelle */
  margin: 1px;
  border: 1px solid #333;
  border-radius:5px;
  padding: 1rem;
  width: fit-content;         /* ❗️passt sich dem gesamten Inhalt an */
  max-width: none;            /* ❗️keine Begrenzung durch Seitenbreite */
  box-sizing: border-box;
  flex: 0 0  auto;
}

/*auschalten von Spinnerbuttons in id feldern*/
[id*="_id"]:disabled {
    -moz-appearance: textfield;
}

[id*="_id"]:disabled::-webkit-outer-spin-button,
[id*="_id"]:disabled::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    display: none !important;
}

form [class^="search-wrapper_"] *  {
    padding: 1;
    margin: 0;
}

.table-form {
  display: flex;
  flex-wrap: nowrap;           /* ❗ alle Felder in einer Zeile */
  gap: 10px;
}

.sBDivInput {
  display: flex;
  flex-direction: row;      /* Label über Eingabe */
  min-width: 40px;
  width: fit-content;
  flex: 0 0 auto;
}

.s1BDivInput { /*für Tabellenerweiterungsbutton*/
  display : flex;
  /*overflow-y: auto;*/
  position : relative;
  /*flex-direction: column;      /* Label über Eingabe */
  min-width: 40px;
  justify-content: center;
  /*width: fit-content;*/
  /*flex: 0 0 auto;*/
}

.divInput {
  display: flex;
  flex-direction: row;
  min-width: 40px;
  width: fit-content;
  flex: 0 0 auto;
}

.divInpAndLabelClass {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

input[type="checkbox"] {
    transform: scale(1.5);
    margin: 0 auto;             /* ← Checkbox horizontal ZENTRIERT */
    margin-top: 8px;
    padding-top: 3px;
    display: block;
}

.divInpAndLabelClass:has(input[type="checkbox"]) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.buttonTable {
    position: absolute;
    top: 24px;
    /*margin-top: auto;           /* schiebt den Button nach unten */*/
    /*margin-top: 50px;*/
}

label {
    font-weight: bold;
    margin-bottom: 2px; /* Abstand zwischen Label & Input */
}

input, select {
  padding: 8px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.col-12 {
    grid-column: span 12;
}

.col-10 {
    grid-column: span 10;
}

.col-8 {
    grid-column: span 8;
}

.col-6 {
    grid-column: span 6;
}

.col-5 {
    grid-column: span 5;
}

.col-4 {
    grid-column: span 4;
}

.col-3 {
    grid-column: span 3;
}

.col-2 {
    grid-column: span 2;
}

.tooltip {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #f0f0f0;
  color: #333;
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  margin-top: 4px;
  z-index: 100;
}

@media (max-width: 600px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    right: 0;
    top: 60px;
    background-color: #333;
    width: 200px;
    padding: 10px;
  }

  .nav-links.open {
    display: flex;
  }

  .burger {
    display: flex;
  }

    .form-grid {
        grid-template-columns: repeat(1, 1fr); /* Mobile: eine Spalte */
    }
}


