:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1d2228;
  --muted: #6b7280;
  --border: #dfe3e8;
  --accent: #20252b;
  --danger: #b42318;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
html { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
body { margin: 0; min-height: 100vh; background: var(--bg); }
a { color: inherit; }
.topbar { min-height: 72px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand small { display: block; color: var(--muted); margin-top: 2px; }
.logo-placeholder { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; letter-spacing: .04em; }
nav { display: flex; gap: 8px; flex-wrap: wrap; }
nav a { text-decoration: none; padding: 9px 12px; border-radius: 9px; }
nav a:hover { background: #f0f2f4; }
.container { width: min(1180px, calc(100% - 32px)); margin: 32px auto; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.login { width: min(460px, 100%); margin: 8vh auto 0; }
h1, h2, h3 { margin-top: 0; }
.muted { color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .92rem; font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid #cfd5dc; border-radius: 9px; background: #fff; color: var(--text); padding: 10px 12px; font: inherit; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(32,37,43,.18); border-color: #7d8792; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn { appearance: none; border: 0; border-radius: 9px; padding: 10px 15px; background: var(--accent); color: #fff; text-decoration: none; font: inherit; font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.btn.secondary { background: #59636e; }
.btn.light { background: #eef1f4; color: var(--text); }
.flash { padding: 11px 13px; border-radius: 9px; margin-bottom: 16px; background: #eef1f4; }
.flash.error { background: #fef3f2; border: 1px solid #fecdca; color: var(--danger); }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: .88rem; color: var(--muted); }
footer { padding: 24px; color: var(--muted); text-align: center; font-size: .88rem; }
@media (max-width: 760px) {
  .topbar { padding: 10px 16px; align-items: flex-start; flex-direction: column; }
  .container { width: min(100% - 20px, 1180px); margin: 20px auto; }
  .card { padding: 16px; }
  .login { margin-top: 4vh; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
}

/* Dashboard / Kalenderkarten */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.grid {
  display: grid;
  gap: 18px;
}
.dashboard-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.calendar-card {
  display: block;
  min-height: 140px;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.calendar-card:hover {
  transform: translateY(-2px);
  border-color: #c8ced6;
  box-shadow: 0 10px 30px rgba(0,0,0,.09);
}
.calendar-card h2 {
  margin-bottom: 10px;
}
.calendar-card p {
  margin-bottom: 0;
}
.event {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.event:last-child {
  border-bottom: 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef1f4;
  font-size: .82rem;
  font-weight: 650;
}
.attendance-summary {
  padding-top: 4px;
}

@media (max-width: 760px) {
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .calendar-card {
    min-height: auto;
  }
}
