/* Reifenkontor Akquise-Tracker — mobil-first, schlicht, positiv */
:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1d2733;
  --muted: #6b7785;
  --line: #e2e8ef;
  --brand: #16a34a;       /* Grün = positiv/aktiv */
  --brand-dark: #15803d;
  --accent: #2563eb;
  --flame: #ea580c;
  --danger: #b91c1c;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(20,30,45,.08), 0 1px 2px rgba(20,30,45,.04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.5rem; margin: .2em 0 .6em; }
h2 { font-size: 1.15rem; margin: 1.4em 0 .5em; }
small { color: var(--muted); font-weight: 400; }

/* Topbar */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem;
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: .6rem 1rem; position: sticky; top: 0; z-index: 10; box-shadow: var(--shadow);
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--ink); margin-right: .5rem; }
.topbar nav { display: flex; flex-wrap: wrap; gap: .2rem .9rem; flex: 1; }
.topbar nav a { color: var(--ink); font-weight: 600; font-size: .95rem; padding: .2rem 0; }
.topbar nav a:hover { color: var(--brand); }
.topbar .user { color: var(--muted); font-size: .82rem; }

.wrap { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 4rem; }

/* Buttons */
.btn {
  display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: .55rem .9rem; border-radius: var(--radius); font-size: .95rem; font-weight: 600;
  cursor: pointer; text-align: center; line-height: 1.2;
}
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.big { width: 100%; padding: .9rem; font-size: 1.05rem; margin-top: .6rem; }
.btn.small { padding: .35rem .6rem; font-size: .82rem; }

/* Login */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.login-card {
  background: var(--card); padding: 2rem 1.6rem; border-radius: var(--radius);
  box-shadow: var(--shadow); width: 100%; max-width: 360px; text-align: center;
}
.login-card h1 { margin: 0 0 .2rem; }
.login-card .sub { color: var(--muted); margin: 0 0 1.4rem; }
.login-card form { text-align: left; }
.login-card label, .formcard label, .notiz-form label, .anruf-erfassung label {
  display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin: .8rem 0 0;
}
input[type=text], input[type=password], input[type=tel], input[type=email], input[type=date],
input[type=search], input[type=file], select, textarea {
  width: 100%; padding: .7rem .75rem; margin-top: .25rem; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
.fehler { background: #fee2e2; color: var(--danger); padding: .6rem .8rem; border-radius: 8px; font-size: .9rem; }
.meldung { background: #dcfce7; color: var(--brand-dark); padding: .6rem .8rem; border-radius: 8px; font-size: .9rem; }
.meldung.good { background: #dcfce7; }

/* Hero / Stat-Chips */
.hero h1 { margin-bottom: .6rem; }
.streak-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: .4rem 0 1rem; }
.stat-chip {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .7rem .9rem; box-shadow: var(--shadow); flex: 1 1 auto; min-width: 120px; text-align: center;
}
.stat-chip b { display: block; font-size: 1.6rem; color: var(--ink); line-height: 1.1; }
.stat-chip span { font-size: .78rem; color: var(--muted); }
.stat-chip.good b { color: var(--brand); }
.stat-chip.flame b { color: var(--flame); }
.big-chips .stat-chip b { font-size: 2rem; }

/* Kontaktliste */
.kontaktliste { list-style: none; padding: 0; margin: .4rem 0; }
.kontaktliste li { margin-bottom: .5rem; }
.kontaktliste a {
  display: flex; justify-content: space-between; align-items: center; gap: .6rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem .9rem; box-shadow: var(--shadow); color: var(--ink);
}
.kontaktliste a:hover { border-color: var(--brand); }
.kl-main { display: flex; flex-direction: column; min-width: 0; }
.kl-name { font-weight: 700; }
.kl-ort { font-size: .82rem; color: var(--muted); }
.kl-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; text-align: right; }
.kl-tel { font-size: .82rem; color: var(--muted); white-space: nowrap; }

/* Badges */
.wv-badge { background: #e0f2fe; color: #075985; padding: .2rem .5rem; border-radius: 20px; font-size: .8rem; font-weight: 700; }
.wv-badge.ueberfaellig { background: #fef3c7; color: #92400e; }
.status-badge, .typ-badge, .erg-badge {
  display: inline-block; padding: .18rem .55rem; border-radius: 20px; font-size: .76rem; font-weight: 700;
  background: #eef2f6; color: #475569;
}
.typ-badge { background: #ede9fe; color: #5b21b6; }
.s-neu { background: #e2e8f0; color: #334155; }
.s-kontaktiert { background: #dbeafe; color: #1e40af; }
.s-wiedervorlage { background: #e0f2fe; color: #075985; }
.s-lead_qualifiziert { background: #dcfce7; color: var(--brand-dark); }
.s-kein_interesse { background: #fee2e2; color: #991b1b; }
.s-nicht_erreichbar { background: #f1f5f9; color: #64748b; }
.s-abgeschlossen { background: #ede9fe; color: #5b21b6; }
.e-durchgekommen, .e-lead_qualifiziert { background: #dcfce7; color: var(--brand-dark); }
.e-wiedervorlage_vereinbart { background: #e0f2fe; color: #075985; }
.e-kein_interesse, .e-falsche_nummer { background: #fee2e2; color: #991b1b; }
.e-niemand_erreicht, .e-besetzt { background: #f1f5f9; color: #64748b; }

.leer { color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 1rem; text-align: center; }
.hint { color: var(--muted); font-size: .82rem; }

/* Listen-Kopf / Filterbar */
.listhead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.filterbar { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0 1rem; }
.filterbar input[type=search] { flex: 1 1 160px; margin-top: 0; }
.filterbar select { flex: 0 1 auto; width: auto; margin-top: 0; }

/* Kontakt-Detail */
.back { display: inline-block; margin-bottom: .4rem; color: var(--muted); font-weight: 600; }
.kopf { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.kopf h1 { margin: 0; width: 100%; }
.kontaktdaten { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; box-shadow: var(--shadow); margin: .8rem 0; }
.kontaktdaten p { margin: .35rem 0; }
.tel-link { font-weight: 700; font-size: 1.1rem; }
.quelle { font-size: .8rem; color: var(--muted); }
.daten-edit { margin: .7rem 0 0; }
.notiz-form { background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius); padding: .7rem .9rem; margin: .8rem 0; }
.notiz-form label { color: #92400e; }

/* Anruf-Erfassung */
.anruf-erfassung { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); margin: 1rem 0; }
.anruf-erfassung h2 { margin-top: 0; }
.ergebnis-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.ergebnis-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ergebnis-opt span {
  display: block; padding: .85rem .5rem; text-align: center; border: 2px solid var(--line);
  border-radius: 10px; font-weight: 700; font-size: .95rem; cursor: pointer; background: #fff;
}
.ergebnis-opt input:checked + span { border-color: var(--brand); background: #dcfce7; color: var(--brand-dark); }
.wv-feld { display: none; margin-top: .6rem; }

/* Verlauf */
.anrufliste { list-style: none; padding: 0; margin: .4rem 0; }
.anrufliste li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; margin-bottom: .5rem; box-shadow: var(--shadow); }
.a-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.a-zeit { font-size: .8rem; color: var(--muted); }
.a-wv { font-size: .85rem; color: #075985; margin-top: .3rem; }
.a-notiz { font-size: .9rem; margin-top: .35rem; white-space: pre-wrap; }

/* Cards / Balken */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); margin: 1rem 0; }
.card h2 { margin-top: 0; }
.balken { display: flex; align-items: flex-end; gap: .25rem; height: 140px; }
.balken-spalte { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.balken-fill { width: 70%; min-height: 2px; background: linear-gradient(var(--brand), var(--brand-dark)); border-radius: 4px 4px 0 0; }
.balken-zahl { font-size: .72rem; font-weight: 700; margin-top: .2rem; }
.balken-tag { font-size: .62rem; color: var(--muted); }
.big-number { font-size: 2.2rem; font-weight: 800; margin: .3rem 0; }
.big-number.good { color: var(--brand); }
.motivation { text-align: center; color: var(--muted); margin: 1.5rem 0; }

/* Kacheln (Admin) */
.kachel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .7rem; margin-top: 1rem; }
.kachel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .3rem; color: var(--ink); }
.kachel:hover { border-color: var(--brand); }
.kachel b { font-size: 1.05rem; }
.kachel span { font-size: .82rem; color: var(--muted); }

/* Formcard / Inline */
.formcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.formcard .row2 { display: flex; gap: .6rem; }
.formcard .row2 label { flex: 1; }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 140px; margin-top: 0; }

/* Tabellen */
.tabelle-wrap { overflow-x: auto; }
.stats-tabelle { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.stats-tabelle th, .stats-tabelle td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--line); font-size: .9rem; white-space: nowrap; }
.stats-tabelle th { background: #f8fafc; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.stats-tabelle td.num { text-align: right; font-variant-numeric: tabular-nums; }
.stats-tabelle td.good { color: var(--brand); font-weight: 700; }
.stats-tabelle tr.inaktiv { opacity: .5; }
.aktionen { display: flex; flex-wrap: wrap; gap: .4rem; }
.aktionen form { display: flex; gap: .3rem; }
.pw-form input { width: 120px; margin-top: 0; padding: .35rem .5rem; }

/* Import-Review */
.import-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; }
.review-liste { list-style: none; padding: 0; margin: .5rem 0; }
.review-liste li { border: 1px solid var(--line); border-radius: 10px; margin-bottom: .4rem; background: #fff; }
.review-liste li.rev-dub { background: #fffbeb; border-color: #fde68a; }
.rev-check { display: flex; align-items: flex-start; gap: .6rem; padding: .6rem .8rem; cursor: pointer; }
.rev-check input { width: auto; margin-top: .25rem; }
.rev-body { display: flex; flex-direction: column; }
.rev-name { font-weight: 700; }
.rev-detail { font-size: .82rem; color: var(--muted); }
.rev-flag { font-size: .8rem; margin-top: .2rem; font-weight: 600; }
.rev-flag.dub { color: #92400e; }
.rev-flag.neu { color: var(--brand-dark); }

@media (max-width: 420px) {
  .ergebnis-buttons { grid-template-columns: 1fr; }
}
