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

body {
  margin: 0;
  padding: 60px 10px 10px;
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.5;
}

/* Zentrierter Container mit max. Breite */
.container {
  width: 90%;
  max-width: 1024px;
  margin: 0 auto;
  background: #fff;
  padding: 15px;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Tabellen */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 15px;
}

th, td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}

ul {
  list-style-type: none;
  padding-left: 0;
  margin-left: 0;
}

/* Formularelemente gestalten – nicht mehr automatisch 100% breit */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
button {
  width: auto;
  max-width: 100%;
  padding: 8px 10px;
  font-size: 1rem;
  margin: 5px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
}

/* Für autofill-Hintergrund im Chrome */
input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: #333 !important;
}

/* Um das E-Mail-Feld im Fehlerfall hervorzuheben */
input[type="email"]:invalid {
  border-color: #ff6666;
}

/* Optional: Einheitliches Placeholder-Design */
input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="number"]::placeholder,
input[type="email"]::placeholder {
  color: #888;
  opacity: 1;
  font-style: italic;
}

/* Buttons */
button {
  cursor: pointer;
  background-color: #007bff;
  color: white;
  border: none;
  max-width: 200px;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #0056b3;
}

/* Flexbox für Formularzeilen */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.form-row > * {
  flex: 1 1 150px;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
  body {
    padding: 5px;
    font-size: 14px;
  }

  .container {
    padding: 10px;
  }

  input[type="text"],
  input[type="password"],
  input[type="number"],
  select,
  button {
    max-width: 100%;
  }

  table, th, td {
    font-size: 0.9rem;
  }
}

/* Links (z.B. im Menü) wie Buttons stylen */
ul li a,
a.button-link {
  background-color: #007bff;
  color: #fff !important;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  display: inline-block;
  border: none;
  font-size: 1rem;
  margin: 6px 0;
  transition: background 0.3s;
  font-family: inherit;
}

ul li a:hover,
a.button-link:hover {
  background-color: #0056b3;
  color: #fff !important;
}

/* Nur für Startseite: zentriert Buttons UND Text */
.center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 90vh;
}

/* Buttons im Startseiten-Container */
.center-content button,
.center-content a.button-link {
  width: 100%;
  max-width: 400px;
}

/* NAVBAR oben zentriert */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background-color: #333;
  padding: 10px 0;
  z-index: 1000;
}

/* Links in der Navbar wie Buttons, eigene Klasse */
.navbar .nav-link {
  display: inline-block;
  background-color: #007bff;
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
}

.navbar .nav-link:hover {
  background-color: #0056b3;
}

/* Formular im Navbar */
.navbar form {
  margin: 0;
}

/* Select im Navbar sichtbar und lesbar */
.navbar select {
  background-color: #fff;
  color: #000;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  max-width: 140px;
}

/* Order-spezifische Styles */

.order-location-row {
  margin-bottom: 10px;
}

.order-qty {
  width: 80px;
}

/* Zelle mit Autocomplete-Eingabe + Vorschlagsliste */
.order-input-cell {
  position: relative;
}

/* Vorschlagsliste (Dropdown) */
.suggestions {
  border: 1px solid #ccc;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  border-top: none;
  z-index: 1000;
  box-sizing: border-box;
}

/* Startzustand: versteckt */
.hidden {
  display: none;
}

/* Einzelne Vorschlagszeile */
.suggestion-item {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.95rem;
}

/* Hover-Effekt wie bei Select-Optionen */
.suggestion-item:hover {
  background-color: #007bff;
  color: #fff;
}

/* Eingabefeld für Artikelsuche optisch wie Select/Input */
.input-autocomplete {
  width: 100%;
  max-width: 400px;
  padding: 8px 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  box-sizing: border-box;
}

/* Admin-spezifische Styles */
.admin-page {
  /* ggf. eigene Styles für admin.php */
}

.section {
  margin-bottom: 30px;
}

.admin-error {
  color: red;
}

.admin-success {
  color: green;
}

/* Elemente in voller Breite (statt inline style="width:100%") */
.full-width {
  width: 100%;
  box-sizing: border-box;
}

/* Standort-Select im Order-Formular optisch wie andere Selects */
.order-location-select {
  background-color: #fff;
  color: #000;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  max-width: 400px;
  width: 100%;
  box-sizing: border-box;
}

/* Monatsbericht-spezifische Styles */
.monthly-filter-form {
  margin-bottom: 10px;
}

.monthly-nav {
  margin-bottom: 10px;
}

.monthly-link-active {
  font-weight: bold;
}

/* Artikelverwaltung: Eingabefelder in Tabellen enger machen */
.article-form-table {
  width: auto;
  border-collapse: collapse;
}

.article-input-small {
  width: 110px;
  max-width: 100%;
  box-sizing: border-box;
}

.article-input {
  width: 140px;
  max-width: 100%;
  box-sizing: border-box;
}

/* Inline-Formulare in der Aktionsspalte nebeneinander */
.article-inline-form {
  display: inline-block;
  margin-right: 4px;
}

/* Suchfeld für Artikelverwaltung */
#searchInput {
  width: 220px;
  max-width: 100%;
  margin: 5px 0 10px 0;
}

/* Delete-Button hervorheben */
.button-delete {
  background-color: #dc3545;
}
.button-delete:hover {
  background-color: #b52a37;
}

/* Tabelle der Artikelverwaltung horizontal scrollbar und kompakt */
.article-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

#artikelTable {
  table-layout: auto;
  white-space: nowrap;
}

#artikelTable td:first-child,
#artikelTable th:first-child {
  width: 120px;
}

#artikelTable td:last-child {
  white-space: nowrap;
}

/* Kleinere Buttons in Tabellen */
.table-button {
  padding: 4px 8px;
  font-size: 0.85rem;
}

/* Bestellübersicht: Detailzeilen initial verstecken */
.details-row {
  display: none;
}
