:root {
  --navy: #0f1b2d; --navy-2: #16263f;
  --blue: #2563eb; --blue-soft: #e8effd;
  --yellow: #f7c500; --yellow-dark: #b78f00;
  --green: #16a34a; --green-soft: #e7f6ec;
  --red: #dc2626; --red-soft: #fdeaea;
  --lila: #7c3aed; --lila-soft: #f3eafd;
  --ink: #1a2230; --muted: #6b7686; --line: #e3e8ef;
  --bg: #eef1f5; --card: #fff; --radius: 14px;
  --shadow: 0 8px 24px rgba(15,27,45,.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); min-height: 100vh;
}

/* ===== Topbar & Tabs ===== */
.topbar {
  background: var(--navy); color: #fff;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 18px 12px;
  display: flex; align-items: center; gap: 12px;
}
.logo-dot {
  width: 36px; height: 36px; border-radius: 10px; background: var(--yellow);
  color: var(--navy); display: grid; place-items: center;
  font-weight: 800; font-size: 17px; flex: none;
}
.tb-title { font-size: 16px; font-weight: 700; }
.tb-sub { font-size: 11.5px; color: #9fb0c7; }
.spacer { flex: 1; }
.btn-line {
  background: transparent; color: #c7d3e4; border: 1px solid #3a4c68;
  border-radius: 9px; padding: 8px 12px; font-size: 12.5px; cursor: pointer;
}
.tabs {
  display: flex; background: #fff; border-bottom: 1px solid var(--line);
  overflow-x: auto; position: sticky; top: 0; z-index: 20;
}
.tab {
  padding: 13px 16px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  border: none; background: none; cursor: pointer;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.tab.active { color: var(--navy); border-bottom-color: var(--yellow); }

.content { max-width: 860px; margin: 0 auto; padding: 18px 14px 60px; }
.phone-content { max-width: 520px; }
.loading { text-align: center; color: var(--muted); padding: 50px 0; }

/* ===== Karten & Board ===== */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 16px;
}
h2.card-title { font-size: 16px; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.chip {
  font-size: 12px; font-weight: 700; padding: 3px 11px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue); display: inline-block;
}
.progress { height: 7px; background: #e9edf3; border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--green), #3fc06d); transition: width .4s; }

.stop-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 8px; border-radius: 10px; }
.stop-row + .stop-row { border-top: 1px solid #f0f3f7; }
.stop-row.active-now { background: var(--blue-soft); border-top: none; }
.stop-ico {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-size: 14px; font-weight: 700; flex: none;
}
.ico-fertig { background: var(--green-soft); color: var(--green); }
.ico-vorort { background: #fdf3d0; color: var(--yellow-dark); }
.ico-unterwegs { background: var(--blue-soft); color: var(--blue); }
.ico-offen { background: #eef1f5; color: #a4aebc; }
.stop-main { flex: 1; min-width: 0; }
.stop-name { font-weight: 600; font-size: 14px; }
.stop-meta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.stop-state { font-size: 12px; font-weight: 600; text-align: right; flex: none; line-height: 1.45; }
.stop-state small { font-weight: 400; color: var(--muted); display: block; }
.st-fertig { color: var(--green); } .st-vorort { color: var(--yellow-dark); }
.st-unterwegs { color: var(--blue); } .st-offen { color: #a4aebc; }
.tag-abholung {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  background: var(--lila-soft); color: var(--lila);
  border-radius: 6px; padding: 2px 7px; margin-left: 7px; vertical-align: 1px;
}
.mini-actions { display: flex; gap: 5px; flex: none; }
.mini-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 13px; color: var(--ink);
}
.mini-btn:hover { border-color: #b9c4d2; }

/* ===== Buttons & Formulare ===== */
.btn {
  border: none; border-radius: 11px; cursor: pointer;
  font-size: 14px; font-weight: 700; padding: 12px 18px;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-yellow { background: var(--yellow); color: var(--navy); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--line); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-big { width: 100%; padding: 15px; font-size: 15.5px; border-radius: 13px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

input, select {
  font-size: 15px; padding: 12px; border-radius: 11px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--blue); }
.form-row { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 140px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
label.check input { width: auto; }

/* ===== Chips (Praxen wählen) ===== */
.praxis-chip {
  display: inline-block; background: #fff; border: 1.5px solid var(--line);
  border-radius: 999px; padding: 9px 14px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; margin: 0 8px 8px 0; user-select: none;
}
.praxis-chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.praxis-chip.aus { opacity: .35; pointer-events: none; }

.insert-box {
  margin-top: 12px; border: 1.5px dashed #c9d3e0; border-radius: 12px;
  padding: 13px; background: #fafbfd;
}
.insert-box h4 { font-size: 13px; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.abh-toggle {
  font-size: 11.5px; font-weight: 700; cursor: pointer; border-radius: 7px;
  padding: 6px 9px; border: 1.5px solid #e0d3f5; background: #fff; color: #a78bda;
  display: inline-block; user-select: none;
}
.abh-toggle.on { background: var(--lila-soft); color: var(--lila); border-color: #d9c4f5; }

/* ===== Entwurf (Tour planen) ===== */
.draft-row {
  display: flex; align-items: center; gap: 9px;
  background: #f7f9fc; border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 11px; margin-bottom: 8px;
}
.draft-num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--navy);
  color: var(--yellow); font-size: 13px; font-weight: 800;
  display: grid; place-items: center; flex: none;
}
.draft-name { flex: 1; font-size: 14px; font-weight: 600; min-width: 0; }
.draft-name small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.draft-empty {
  border: 1.5px dashed #c9d3e0; border-radius: 12px; padding: 20px;
  text-align: center; color: var(--muted); font-size: 13px; background: #fafbfd;
}

/* ===== Tabellen ===== */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 8px 8px; border-bottom: 1.5px solid var(--line); }
td { padding: 10px 8px; border-bottom: 1px solid #f0f3f7; vertical-align: middle; }
.geo-ok { color: var(--green); } .geo-warte { color: var(--yellow-dark); }

/* ===== Fahrer-Ansicht ===== */
.current-card {
  background: #fff; border-radius: 18px; box-shadow: var(--shadow);
  padding: 18px 16px; border: 1.5px solid var(--line); margin-bottom: 16px;
}
.cc-step { font-size: 11px; font-weight: 800; letter-spacing: 1.1px; color: var(--blue); text-transform: uppercase; margin-bottom: 6px; }
.cc-step.vorort { color: var(--yellow-dark); }
.cc-name { font-size: 20px; font-weight: 800; line-height: 1.2; }
.cc-addr { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.cc-tags { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.cc-tag { font-size: 12px; font-weight: 700; border-radius: 7px; padding: 5px 10px; }
.cc-tag.bring { background: var(--blue-soft); color: var(--blue); }
.cc-tag.abhol { background: var(--lila-soft); color: var(--lila); }
.cc-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 9px; }
.btn-nav { background: var(--blue); color: #fff; text-align: center; text-decoration: none; display: block; }
.btn-binda { background: #fff; color: var(--navy); border: 2px solid var(--navy); }
.btn-weiter { background: var(--yellow); color: var(--navy); }
.onsite-note {
  background: #fdf6dd; color: #6d5a12; border-radius: 11px;
  padding: 11px 12px; font-size: 13px; line-height: 1.5;
}
.p-stop {
  display: flex; align-items: center; gap: 11px; background: #fff;
  border-radius: 13px; padding: 12px 13px; margin-bottom: 7px;
  border: 1px solid var(--line); font-size: 14px;
}
.p-stop.fertig { opacity: .6; }
.p-stop.gesperrt { opacity: .55; background: #f2f4f8; }
.p-stop.jetzt { border: 2px solid var(--blue); }
.p-ico { font-size: 15px; width: 22px; text-align: center; flex: none; }
.p-main { flex: 1; min-width: 0; }
.p-name { font-weight: 600; }
.p-sub { font-size: 11.5px; color: var(--muted); }
.p-time { font-size: 11.5px; color: var(--muted); font-weight: 600; flex: none; }
.list-title { font-size: 11.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 14px 0 8px 4px; }
.lock-hint { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 10px; line-height: 1.5; }
.finish-card {
  background: var(--green-soft); border: 1.5px solid #bfe6cc; border-radius: 18px;
  padding: 28px 18px; text-align: center; margin-bottom: 16px;
}
.finish-card .big { font-size: 40px; }
.finish-card h3 { font-size: 17px; color: #15803d; margin: 8px 0 6px; }
.finish-card p { font-size: 13px; color: #3d6b4c; line-height: 1.5; }

/* ===== Login ===== */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card {
  background: #fff; border-radius: 20px; box-shadow: var(--shadow);
  padding: 34px 28px; width: 100%; max-width: 380px; text-align: center;
}
.login-logo {
  width: 56px; height: 56px; border-radius: 16px; background: var(--yellow);
  color: var(--navy); font-size: 26px; font-weight: 800;
  display: grid; place-items: center; margin: 0 auto 14px;
}
.login-card h1 { font-size: 20px; }
.login-sub { font-size: 13px; color: var(--muted); margin: 4px 0 20px; }
.login-card input { margin-bottom: 10px; text-align: center; }
.login-error {
  background: var(--red-soft); color: var(--red); border-radius: 10px;
  padding: 10px; font-size: 13px; margin-top: 12px;
}

/* ===== Toasts & Hinweise ===== */
.toasts { position: fixed; top: 14px; right: 14px; width: min(330px, 90vw); z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: rgba(28,34,48,.96); color: #fff; border-radius: 13px;
  padding: 12px 14px; box-shadow: 0 14px 34px rgba(0,0,0,.3);
  font-size: 13px; line-height: 1.45; animation: toast-in .3s ease;
}
.toast.fehler { background: rgba(153,27,27,.96); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.phone-notice {
  background: var(--lila); color: #fff; border-radius: 12px;
  padding: 11px 13px; font-size: 13px; margin-bottom: 12px;
  animation: toast-in .3s ease;
}
.hinweis { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
