body {
  margin: 0;
  font-family: Arial, sans-serif;
}

#container {
  display: flex;
  flex-wrap: wrap; /* wichtig für Umbruch */
  min-height: 100vh;
}

#sidebar {
  width: 260px;
  height: 100%;
  display: flex;
  position: fixed;
  flex-direction: column;
  border-right: 1px solid #ccc;
  background: #f8f9fa;
  z-index: 1000;
}

#main {
  flex: 1;
  margin-left: 260px;
  min-height: 0;
  background: #e9ecef;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: auto;
}

.svg-container {
  flex: 1;
  overflow: auto;
  background: #e9ecef;
}

.svg-content {
  display: block;
  background: white;
}

.collapsible {
  cursor: pointer;
}
.content {
  display: none;
  padding-left: 10px;
}

/* Sidebar Menu Fix */

#sidebar-menu {
  position: relative;
  z-index: 10;
  padding: 1px;
  flex-shrink: 0;
}
#footer-menu {
  position: relative;
  z-index: 10;
  padding: 1px;
  flex-shrink: 0;
}
/* Menü-Hauptpunkte */
.menu-bar {
  display: flex;
  justify-content: space-around;
  /*gap: 0.01rem;*/
}

/* Untermenüs */
.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-width: 270px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.menu-item {
  position: relative;
  display: inline-block;
  margin-right: 10px;
  font-size: 14px;
}
.menu-btn,
.menu-item,
.dropdown-item {
  font-size: 14px;
}

.menu-btn {
  background: #f8f9fa;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  /*transition: background 0.2s;*/
}

.menu-btn:hover {
  background: #e0e0e0; /* deutlich dunkleres Grau beim Hover */
  border-color: #888; /* Rahmen wird kräftiger */
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2); /* leichter Glow */
}

/* Untermenü Buttons */
.submenu button {
  display: block;
  width: 100%;
  margin: 0.2rem 0;
  padding: 0.25rem 0.5rem;
  text-align: left;
  background-color: #e9ecef;
  border: none;
  border-radius: 0.2rem;
  cursor: pointer;
}

.submenu button:hover {
  background-color: #dee2e6;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 6px 12px;
  text-align: left;
  font-size: 14px;
  border: none;
  background: none;
  cursor: pointer;
  transition: bac0; /* Abstand oben/unten */
  background-color: #ccc; /* hellgraue Linie */
  border: none;
}

.grid-container {
  flex: 1; /* Nimmt verfügbaren Platz ein */
  overflow-y: auto; /* Scrollbar bei Bedarf */
  min-height: 0; /* Wichtig für flexbox scrolling */
  grid-template-columns: repeat(3, 1fr); /* nur Eingabespalten */
  gap: 0.2rem 0.01rem;
  max-width: 600px;
  margin: 0 auto;
  font-family: sans-serif;
  padding: 1px;
  border-bottom: 1px solid gray;
  border-top: 1px solid gray;
}

.grid-header {
  grid-column: 1 / -1; /* über volle Breite */
  display: grid;
  grid-template-columns: 20px 1fr; /* Farbspalte + Text */
  align-items: center;
  font-weight: normal;
  font-size: 15px;
  color: #555;
  border-top: 1px solid darkgray;
  border-bottom: 1px solid darkgray;
  padding: 1px 1px;
  background-color: rgb(233, 233, 233);
  text-align: center;
}
.label{text-align: center}
.grid-header .color {
  width: 16px;
  height: 14px;
  border: 1px solid black;
}

.grid-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: none;
}

.grid-row > * {
  border-right: 2px solid #ccc;
}
.grid-row > *:last-child {
  border-right: none;
}

.ad-container {
  position: fixed;
  width: 250px;
  height: 140px;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  box-sizing: border-box;
  background-color: transparent;
  flex-shrink: 0;
}

.ad-placeholder {
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  flex-shrink: 0;
  height: 140px;
  min-height: 140px; /* Statt 120px für Konsistenz */
  width: 250px;
  box-sizing: border-box;
  display: block;
  background-color: transparent;
}

.ad-placeholder ins.adsbygoogle {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  display: block;
  box-sizing: border-box;
}

input {
  width: 100%;
  padding: none;
  border: none;
  font-size: 16px;
  text-align: right;
}
input[type="text"] {
  text-align: left;
  font-size: 16px;
}

.colspan-3 {
  grid-column: span 3;
}

.custom-table input:focus,
.custom-table input:hover {
  border-color: #3399ff;
}

/* Farben */
.grid-header.frame .color {
  background-color: #1e5ab6;
} /* Regalrahmen */
.grid-header.beam .color {
  background-color: #ffd700;
} /* Balken */
.grid-header.pallet .color {
  background-color: #d2b48c;
} /* Palette */
.grid-header.support .color {
  background-color: #4caf50;
} /* Stütze */
.grid-header.wall .color {
  background-color: #848484;
}
.grid-header.layout .color {
  background-color: white;
}

.modal {
  display: none; /* bleibt versteckt */
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: rgba(255, 255, 255, 0.8);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  width: auto; /* passt sich Inhalt an */
  height: auto; /* passt sich Inhalt an */
  max-width: 50vw;
  max-height: 80vh;
}

.modal-content ul {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr; /* 3 Spalten */
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
  overflow: auto; /* Scrollbar falls nötig */
  flex-grow: 1; /* füllt den vertikalen Platz */
  /*background-color: aqua;*/
}

.modal-content li {
  padding: 6px 10px;
  cursor: pointer;
  border: 1px solid #ddd;
  border-radius: 5px;
  text-align: center;
}
.modal-content li:hover {
  background: #eee;
  border-color: #aaa;
}

.example-item {
  width: 100%; /* passt sich an Modal-Content an */
  max-width: 100%; /* überschreitet Modal nicht */
  padding: 1px;
  margin-bottom: 1px;
  box-sizing: border-box;
  font-size: 14px;
  background: lightgrey;
}

.example-item.inch-highlight {
  background-color: #fff3cd;
  /*border-left: 4px solid #ff9800; */
}
.close {
  float: right;
  cursor: pointer;
  font-size: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}


@media (max-width: 800px) {
  #container {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #sidebar {
    position: relative;
    width: 100%;
    height: auto;
    border-right: none;
    margin-bottom: 20px;
  }

  #main {
    margin-left: 0;
    width: 100%;
    height: auto;
  }

  .mobile {
    display: grid;
    grid-template-columns: 50% 50%;

  }

  .mobile .grid-header {
    grid-column: 1;
    background-color: white;
    border-right: 1px solid darkgray;
  }
.label {    text-align: left;
    align-items: left; padding-left: 10px
}
  .mobile .grid-row {
    grid-column: 2;
    border-top: 1px solid darkgray;
  border-bottom: 1px solid darkgray;
  }

  .grid-row input[type="number"] {
    width: 100%;
  }
  .grid-row input[type="text"] {

    font-size: 14px;
  }
  .grid-row input {
    margin: 0 auto;
    display: block;
  }
}
