/* Allgemeines Layout */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #e5e5e5;
  margin: 0;
}

/* Content-Container */
.page {
  background: #ffffff;
  max-width: 1200px;
  margin: 80px auto 20px; /* genug Abstand wegen Topbar */
  padding: 20px 30px;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
  border-radius: 8px;
  box-sizing: border-box;
}

h1, h2 {
  margin-top: 0;
}

label {
  display: block;
  margin-bottom: 10px;
}

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  margin-top: 4px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

button {
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  background: #2c7be5;
  color: #fff;
  cursor: pointer;
}
button:hover {
  background: #1b5bbf;
}

table.list,
table.week-grid {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

table.list th, table.list td,
table.week-grid th, table.week-grid td {
  border: 1px solid #ddd;
  padding: 8px;
  vertical-align: top;
}

.week-grid .cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.week-grid .hint {
  font-size: 0.8rem;
  color: #666;
}

.actions {
  margin-top: 15px;
  display: flex;
  gap: 10px;
}

.week-nav {
  margin-bottom: 15px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.page-narrow {
  max-width: 480px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.alert {
  padding: 10px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.alert-error {
  background: #ffe5e5;
  border: 1px solid #ffb3b3;
  color: #900;
}

.alert-success {
  background: #e3ffe5;
  border: 1px solid #9cd9a1;
  color: #155724;
}

.topbar {
  background: #2c7be5;
  color: #fff;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-radius: 6px;
}

.topbar a {
  color: #fff;
  text-decoration: none;
  margin-left: 12px;
  font-weight: 500;
}

.topbar a:hover {
  text-decoration: underline;
}

.topbar-left {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Dashboard Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 20px;
}

.card {
  background: #ffffff;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 0 6px rgba(0,0,0,0.06);
  box-sizing: border-box;
}

.card h2 {
  margin-top: 0;
}

/* Kompakte Wochenübersicht im Dashboard */
.week-grid.compact td,
.week-grid.compact th {
  font-size: 0.9rem;
}

/* Slot-Anzeigen */
.slot-empty {
  color: #999;
  font-style: italic;
}

.slot-max {
  color: #2c7be5;
  font-size: 0.9rem;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.btn-primary,
.btn-outline {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  text-align: center;
}

.btn-primary {
  background: #2c7be5;
  color: #fff;
  border: 1px solid #2c7be5;
}

.btn-primary:hover {
  background: #1b5bbf;
}

.btn-outline {
  background: #fff;
  color: #2c7be5;
  border: 1px solid #2c7be5;
}

.btn-outline:hover {
  background: #e9f2ff;
}

/* Liste offene Slots */
.open-slots {
  list-style: disc;
  padding-left: 20px;
  margin: 6px 0 0 0;
  font-size: 0.9rem;
}

/* Mobile: Dashboard einspaltig */
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}


/* Auf großen Screens z.B. 75% Breite */
@media (min-width: 1024px) {
  .page {
    max-width: 75%;
  }
}

/* Auf kleinen Screens volle Breite */
@media (max-width: 767px) {
  .page {
    max-width: 100%;
    margin: 70px 10px 10px;
    padding: 16px;
  }
}

/* Sticky Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #2c7be5;
  color: #fff;
  padding: 8px 0;
}

/* Inneres Layout der Topbar */
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

/* Brand / Logo */
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #fff;
  gap: 8px;
}

.brand-logo {
  height: 32px;
  width: auto;
  display: block;
}

.brand-text {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Topbar Navigation */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-right a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

.topbar-right a:hover {
  text-decoration: underline;
}

.topbar-user {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Hamburger-Toggle (standard: Desktop versteckt) */
.topbar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  padding: 0;
  margin-left: 8px;
  cursor: pointer;
}

.topbar-toggle span {
  display: block;
  height: 3px;
  border-radius: 3px;
  background: #ffffff;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Mobile Darstellung */
@media (max-width: 768px) {
  .topbar-inner {
    align-items: center;
  }

  .topbar-right {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #2c7be5;
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 20px 12px;
    gap: 8px;
    display: none; /* Start: versteckt */
  }

  .topbar-right.open {
    display: flex;
  }

  .topbar-toggle {
    display: flex;
  }

  .topbar-user {
    margin-bottom: 4px;
  }
}

/* Hamburger-Animation (optional, aber nice) */
.topbar-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.topbar-toggle.open span:nth-child(2) {
  opacity: 0;
}

.topbar-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Formulare & Tabellen wie gehabt (falls noch nicht vorhanden) */
label {
  display: block;
  margin-bottom: 10px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
textarea,
select {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  margin-top: 4px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

button {
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  background: #2c7be5;
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: #1b5bbf;
}