* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  background: #f4f5f7;
  color: #1d1d1f;
}

h2 { margin: 16px 0 8px; }
h3 { margin: 16px 0 6px; }
main { padding: 16px; max-width: 1200px; margin: 0 auto; }

button, input, select {
  font: inherit;
  padding: 8px 12px;
  border: 1px solid #b8bcc4;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: default; }
button.primary { background: #1f6feb; color: #fff; border-color: #1f6feb; }
button.gefahr { color: #b42318; border-color: #f1b5b0; }
button.klein { padding: 4px 10px; min-width: 36px; }
input, select { cursor: text; }
input[type="checkbox"] { width: 20px; height: 20px; }

a { color: #1f6feb; }

table { width: 100%; border-collapse: collapse; background: #fff; }
td, th { padding: 8px; border-bottom: 1px solid #e3e5e8; vertical-align: middle; }
td.r { text-align: right; white-space: nowrap; }
tr.summe td { font-weight: bold; border-top: 2px solid #1d1d1f; }
tr.gedruckt td:first-child { color: #6b7280; }
.mengen span { display: inline-block; min-width: 28px; text-align: center; }
.hinweis { color: #6b7280; }

/* Kopfzeile */
.kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: #1d2430;
  color: #fff;
}
.kopf .titel { font-size: 1.2em; }
.kopf nav { display: flex; gap: 12px; flex: 1; }
.kopf nav a { color: #fff; text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.kopf nav a:hover { background: #2f3a4b; }
.kopf .benutzer { display: flex; gap: 8px; align-items: center; }
.kopf .benutzer button { background: transparent; color: #fff; border-color: #fff; }

/* Kacheln (Tische, Produkte) */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.kachel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  padding: 10px;
  text-align: center;
  font-size: 1em;
}
.kachel .nr { font-weight: bold; font-size: 1.15em; }
.kachel .info { color: #6b7280; margin-top: 4px; }
.kachel.belegt { background: #fff4d6; border-color: #e0b84d; }
.klein-kacheln .kachel { min-height: 70px; }

/* Bestellansicht */
.bestell-layout { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
.positionen { background: #fff; padding: 12px; border-radius: 8px; }
.aktionen { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.aktionen button { padding: 14px; font-size: 1.05em; }

/* Abrechnung & Verwaltung */
.zeile { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.reiter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.reiter a { padding: 6px 12px; border-radius: 6px; background: #e6e9ef; text-decoration: none; color: #1d1d1f; }
.reiter a.aktiv { background: #1f6feb; color: #fff; }
.formular {
  display: grid;
  gap: 10px;
  max-width: 480px;
  background: #fff;
  padding: 16px;
  border-radius: 8px;
}
.formular label { display: flex; flex-direction: column; gap: 4px; }
.formular label:has(input[type="checkbox"]) { flex-direction: row; align-items: center; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; padding: 28px; border-radius: 10px; width: min(360px, 92vw); box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.login-box h1 { margin-top: 0; text-align: center; }
.login-box form { display: grid; gap: 12px; }
.login-box label { display: flex; flex-direction: column; gap: 4px; }
.fehler { color: #b42318; min-height: 1.2em; margin: 0; }

/* Benachrichtigungen */
.meldung {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #1d2430;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  z-index: 10;
}
.meldung.fehler { background: #b42318; }

@media (max-width: 800px) {
  .bestell-layout { grid-template-columns: 1fr; }
}
