:root {
  --navy: #0a1530;
  --blue: #2355b0;
  --blue-light: #4a8fff;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1a1f2e;
  --muted: #6b7280;
  --border: #e2e6ee;
  --green: #1a8a4a;
  --red: #c0392b;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}
body { padding-bottom: 76px; } /* Platz für Bottom-Nav */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-left span { color: #fff; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e-icon {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  border-radius: 6px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
}
.topbar-wordmark { font-size: 18px; font-weight: 700; letter-spacing: -0.03em; color: #fff; text-decoration: none; justify-self: center; }
.topbar-wordmark span {
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.topbar-right { display: flex; justify-content: flex-end; }
.topbar button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 12px; font-size: 16px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px; /* 16px verhindert Zoom beim Fokus auf iOS */
  font-family: inherit;
}

button.primary {
  width: 100%;
  margin-top: 14px;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
}
.error { color: var(--red); font-size: 13px; margin-top: 8px; }
.success { color: var(--green); font-size: 13px; margin-top: 8px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--bg); border-radius: 8px; padding: 14px; text-align: center; }
.stat .num { font-size: 22px; font-weight: 700; color: var(--navy); }
.stat .lbl { font-size: 12px; color: var(--muted); }

.lead { border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 10px; }
.lead .name { font-weight: 600; }
.lead .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.badge { display: inline-block; font-size: 11px; padding: 3px 9px; border-radius: 12px; font-weight: 600; margin-top: 6px; }
.badge.frei { background: #e8f0fc; color: var(--blue); }
.badge.in_bearbeitung { background: #fff4e0; color: #a0650f; }
.badge.termin2 { background: #e6f0ff; color: var(--blue); }
.badge.zur_pruefung { background: #f3e8ff; color: #7c3aed; }
.badge.abgeschlossen { background: #e5f7ec; color: var(--green); }
.badge.abgesagt { background: #fbe9e7; color: var(--red); }

.lead-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.lead-actions button {
  flex: 1; min-width: 100px;
  padding: 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
}
.lead-actions button.ok { border-color: var(--green); color: var(--green); }
.lead-actions button.no { border-color: var(--red); color: var(--red); }

.empty { color: var(--muted); font-size: 13px; text-align: center; padding: 20px 0; }
.hidden { display: none !important; }

/* Bottom-Nav, mobile-first */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  z-index: 50;
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
}
.bottom-nav a.active { color: var(--blue); background: var(--bg); }
.bottom-nav .icon-circle {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  background: var(--border);
  color: var(--muted);
}
.bottom-nav a.active .icon-circle { background: var(--blue); color: #fff; }
