:root {
  --red: #e2001a;      /* Fahrrad XXL Rot */
  --blue: #0a3a67;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #1c2430;
  --muted: #6b7683;
  --border: #e2e6ea;
  --ok: #1f9d55;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; margin: 2px 0 0; }

/* ---------- Login ---------- */
.overlay {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #0a3a67, #14243a);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.login-card {
  background: #fff; padding: 34px 32px; border-radius: 14px;
  width: 320px; max-width: 90vw; text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  display: flex; flex-direction: column; gap: 12px;
}
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 4px; border-radius: 12px;
  background: var(--red); color: #fff; font-weight: 800; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}
.login-card h1 { font-size: 19px; margin: 0; }
.login-card input {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 16px; margin-top: 6px;
}
.login-error { color: var(--red); font-size: 13px; min-height: 16px; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 20px;
  background: #fff; padding: 0 20px; height: 58px;
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand-mark {
  background: var(--red); color: #fff; font-weight: 800; font-size: 13px;
  width: 30px; height: 30px; border-radius: 7px; display: inline-flex;
  align-items: center; justify-content: center;
}
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tab {
  border: none; background: transparent; padding: 8px 16px; border-radius: 8px;
  font-size: 15px; cursor: pointer; color: var(--muted); font-weight: 600;
}
.tab.active { background: var(--bg); color: var(--text); }
.tab:hover { background: var(--bg); }
#logoutBtn { margin-left: 8px; }

/* ---------- Layout ---------- */
main { max-width: 1100px; margin: 22px auto; padding: 0 20px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; box-shadow: var(--shadow);
}
.panel h2 { font-size: 17px; margin: 0 0 16px; display: flex; align-items: center; gap: 9px; }
.panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-red { background: var(--red); }
.dot-blue { background: var(--blue); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form input, .form textarea {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; font-family: inherit; color: var(--text); width: 100%;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,58,103,.12); }
.form textarea { resize: vertical; }

.btn {
  padding: 10px 16px; border-radius: 8px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: #c40017; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg); }

/* ---------- Listen ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fff;
}
.item .main { flex: 1; min-width: 0; }
.item .name { font-weight: 600; }
.item .sub { font-size: 13px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.item .time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.item-del {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 17px; line-height: 1; padding: 2px 4px; border-radius: 6px;
}
.item-del:hover { color: var(--red); background: #ffecee; }
.list-empty { color: var(--muted); font-size: 14px; padding: 6px 2px; }

/* ---------- Auswertung ---------- */
.auswertung-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.auswertung-head h2 { margin: 0; }
.date-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.date-nav input[type=date] { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; }
.stats { display: flex; gap: 16px; margin: 20px 0; }
.stat { background: var(--bg); border-radius: 10px; padding: 14px 22px; text-align: center; min-width: 120px; }
.stat-num { font-size: 30px; font-weight: 800; }
.stat-label { font-size: 13px; color: var(--muted); }

/* ---------- Balken-Diagramme ---------- */
.week-label { font-size: 14px; font-weight: 600; min-width: 150px; text-align: center; }
.chart { display: flex; align-items: flex-end; gap: 10px; padding: 14px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar-val { font-size: 13px; font-weight: 700; color: var(--text); }
.bar-wrap { width: 100%; display: flex; align-items: flex-end; justify-content: center; height: 160px; }
.bar { width: 100%; max-width: 48px; background: var(--blue); border-radius: 6px 6px 0 0; min-height: 3px; }
.bar-col.is-today .bar { background: var(--red); }
.bar-label { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.25; }
.bar-label b { color: var(--text); font-weight: 600; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--border); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .col-del { text-align: right; width: 36px; }
.empty { color: var(--muted); font-size: 14px; padding: 4px 2px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 11px 20px; border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 200; font-size: 14px;
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--red); }

/* ---------- Druck ---------- */
@media print {
  .topbar, .date-nav, .stat + .stat, .col-del, .item-del, #printBtn { }
  .topbar, .date-nav, .item-del, .col-del { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; border: none; }
  main { margin: 0; max-width: none; }
  #tab-erfassen { display: none !important; }
}
