/* Tourenplaner – Industrie-Look: Weiß, Marineblau, Signalrot. Farben über Einstellungen anpassbar. */
:root {
  --primary: #00305e;
  --accent: #d4001a;
  --ink: #1b2733;
  --ink-2: #4a5866;
  --muted: #6f7d8b;
  --line: #d9e0e7;
  --bg: #f2f4f7;
  --surface: #ffffff;
  --ok: #1f8a70;
  --warn: #c77700;
  --err: #c0262d;
  --radius: 3px;
  --header-h: 68px;
  --font: "Barlow", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-head: "Barlow Semi Condensed", "Barlow", "Segoe UI", system-ui, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 400 16px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-head); color: var(--primary); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 1.9rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }
code { background: #eef1f5; padding: .1em .35em; border-radius: 2px; font-size: .92em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.lead { color: var(--ink-2); font-size: 1.05rem; max-width: 70ch; }
.hint { color: var(--muted); font-size: .88rem; margin: .3rem 0 .8rem; }

/* ---------- Kopfzeile ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1100; box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.topbar::before { content: ""; display: block; height: 4px; background: var(--primary); }
.topbar-inner { display: flex; align-items: center; gap: 1.5rem; height: calc(var(--header-h) - 4px); padding: 0 1.5rem; max-width: 1600px; margin: 0 auto; }
.brand { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.brand img { max-height: 40px; max-width: 200px; display: block; }
.brand-text { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; color: var(--primary); letter-spacing: .01em; }
.mainnav { display: flex; align-items: center; gap: .25rem; flex: 1; }
.mainnav > a, .mainnav summary { font-weight: 600; color: var(--ink); text-decoration: none; padding: .5rem .8rem; border-bottom: 3px solid transparent; cursor: pointer; list-style: none; display: flex; align-items: center; gap: .5rem; }
.mainnav summary::-webkit-details-marker { display: none; }
.mainnav > a:hover, .mainnav summary:hover { color: var(--primary); }
.mainnav > a.active, .mainnav summary.active { color: var(--primary); border-bottom-color: var(--accent); }
.dropdown { position: relative; }
.dropdown summary::after { content: ""; border: 4px solid transparent; border-top-color: currentColor; margin-top: 4px; }
.dropdown-menu { position: absolute; top: 100%; left: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--primary); box-shadow: 0 8px 24px rgba(0,30,60,.12); padding: .4rem 0; z-index: 1200; }
.dropdown-menu.right { left: auto; right: 0; }
.dropdown-menu a { display: block; padding: .55rem 1rem; color: var(--ink); text-decoration: none; font-weight: 500; }
.dropdown-menu a:hover { background: #f1f4f8; color: var(--primary); }
.dropdown-meta { display: block; padding: .3rem 1rem .5rem; color: var(--muted); font-size: .85rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.usermenu { margin-left: auto; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); padding: .45rem .8rem; font: 600 .95rem var(--font); color: var(--primary); border-radius: var(--radius); }

/* ---------- Layout ---------- */
.main { max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.main-wide { padding: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h1 { margin: 0; position: relative; padding-bottom: .45rem; }
.page-head h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 48px; height: 3px; background: var(--accent); }
.count { display: inline-block; font: 600 .85rem var(--font); color: var(--muted); background: #e6ebf1; padding: .1rem .5rem; border-radius: 99px; vertical-align: middle; margin-left: .3rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.panel { background: var(--surface); border: 1px solid var(--line); padding: 1.4rem 1.5rem; margin-bottom: 1.5rem; }
.panel.narrow { max-width: 560px; }
.panel h2 { border-bottom: 1px solid var(--line); padding-bottom: .55rem; margin-bottom: 1rem; }
.panel h2 ~ h2 { margin-top: 1.6rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; align-items: start; }
.span-2 { grid-column: 1 / -1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }

/* ---------- Formulare ---------- */
.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-weight: 600; font-size: .9rem; color: var(--ink-2); margin-bottom: .3rem; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=url], input[type=number], input[type=search],
input[type=date], input[type=time], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #c4ced8; border-radius: var(--radius); padding: .55rem .7rem; min-height: 42px;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
input:disabled, select:disabled, textarea:disabled { background: #f5f7f9; color: var(--ink-2); }
input[type=color] { width: 64px; height: 42px; padding: 2px; border: 1px solid #c4ced8; border-radius: var(--radius); background: #fff; }
input[type=file] { font: inherit; max-width: 100%; }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: .5rem; margin: .35rem 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.check-inline { align-self: end; margin-bottom: 1.4rem; }
.radio { display: inline-flex; align-items: center; gap: .3rem; font-size: .88rem; white-space: nowrap; }
.form-actions { padding: .5rem 0 1.5rem; }
.narrow-input { max-width: 90px; }

/* ---------- Schaltflächen ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: 600 .95rem/1 var(--font); padding: .7rem 1.15rem; min-height: 42px;
  border-radius: var(--radius); border: 1px solid var(--primary); background: var(--primary); color: #fff; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.btn:hover { background: color-mix(in srgb, var(--primary) 85%, #000); color: #fff; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, #000); border-color: color-mix(in srgb, var(--accent) 85%, #000); }
.btn-ghost { background: transparent; color: var(--primary); border-color: #b9c5d1; }
.btn-ghost:hover { background: #eef2f6; color: var(--primary); border-color: var(--primary); }
.btn-danger, .btn.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-ghost.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, #fff); }
.btn-sm { padding: .45rem .75rem; min-height: 34px; font-size: .88rem; }
.btn-lg { padding: .85rem 1.6rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; margin: .8rem 0; }
.btn-icon { width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); cursor: pointer; font-size: 1.05rem; line-height: 1; color: var(--ink-2); flex-shrink: 0; }
.btn-icon:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-icon.danger:hover { border-color: var(--err); color: var(--err); }
.btn-icon:disabled { opacity: .35; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link.danger, .danger { color: var(--err); }
form.inline { display: inline; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font: 600 .85rem var(--font); color: var(--ink-2); background: #f6f8fa; padding: .7rem .9rem; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { padding: .7rem .9rem; border-bottom: 1px solid #e8edf2; vertical-align: middle; }
.table tbody tr:hover { background: #f9fbfc; }
.table.compact td, .table.compact th { padding: .45rem .6rem; font-size: .92rem; }
.table tr.inactive td { color: var(--muted); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * + * { margin-left: .8rem; }
.panel .table { border: 1px solid var(--line); }

.badge { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .82rem; padding: .18rem .55rem; border-radius: 2px;
  color: color-mix(in srgb, var(--c) 75%, #000); background: color-mix(in srgb, var(--c) 14%, #fff); border-left: 3px solid var(--c); }
.tag { font-size: .75rem; font-weight: 600; color: var(--ink-2); background: #e8edf2; padding: .05rem .4rem; border-radius: 2px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #c4ced8; vertical-align: middle; }
.dot.ok { background: var(--ok); }
.dot.fail { background: var(--err); }
.tour-status { font-size: .8rem; font-weight: 600; padding: .1rem .5rem; border-radius: 2px; background: #e8edf2; color: var(--ink-2); }
.tour-status-unterwegs { background: #fff1d6; color: #8a5300; }
.tour-status-abgeschlossen { background: #ddf2ea; color: #136048; }

/* ---------- Filter, Hinweise, Leer ---------- */
.filterbar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.2rem; align-items: center; }
.filterbar input[type=search] { max-width: 340px; }
.filterbar select, .filterbar input[type=date] { width: auto; }
.filterbar label { display: flex; align-items: center; gap: .4rem; color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.filterbar.compact { margin: 0; }
.flash { padding: .8rem 1rem; margin-bottom: 1rem; border-left: 4px solid var(--primary); background: #e9f0f7; }
.flash-ok { border-color: var(--ok); background: #e5f4ee; }
.flash-warn { border-color: var(--warn); background: #fdf3e1; }
.flash-error { border-color: var(--err); background: #fbe9ea; }
.main-wide > .flash { margin: 0; }
.notice { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: #fff8e8; border: 1px solid #f0d9a6; padding: 1rem 1.2rem; margin-bottom: 1.2rem; }
.progress { height: 6px; background: #eadbb8; margin-top: .6rem; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.empty { text-align: left; background: var(--surface); border: 1px dashed #b9c5d1; padding: 2.2rem 2rem; }
.empty h2 { margin-bottom: .4rem; }
.pager { display: flex; gap: .3rem; margin-top: 1rem; flex-wrap: wrap; }
.pager a { padding: .35rem .7rem; border: 1px solid var(--line); background: #fff; text-decoration: none; }
.pager a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Avatare ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar-initials { background: var(--primary); color: #fff; font-weight: 700; font-size: .9rem; }
.avatar-sm { width: 30px; height: 30px; font-size: .75rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }
.avatar-xl { width: 110px; height: 110px; font-size: 2rem; }
.photo-row, .logo-row { display: flex; gap: 1.2rem; align-items: center; margin-bottom: 1rem; }
.logo-preview { width: 200px; height: 90px; border: 1px dashed #b9c5d1; display: flex; align-items: center; justify-content: center; background: #fafbfc; padding: .5rem; flex-shrink: 0; }
.logo-preview img { max-width: 100%; max-height: 100%; }
.tech-swatch { display: inline-block; border-radius: 50%; box-shadow: 0 0 0 3px var(--c); }

/* ---------- Ansprechpartner ---------- */
.contacts-editor { border: 0; padding: 0; margin: 0; }
.contacts-editor legend { font: 700 1.25rem var(--font-head); color: var(--primary); margin-bottom: .8rem; }
.contact-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr 1.4fr auto auto; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.contact-cards { list-style: none; padding: 0; margin: 0 0 1rem; }
.contact-cards li { padding: .65rem .8rem; border: 1px solid var(--line); border-left: 3px solid var(--primary); margin-bottom: .5rem; background: #fbfcfd; }
.contact-lines { display: flex; flex-direction: column; font-size: .92rem; margin-top: .2rem; }

/* ---------- Anmeldung / Setup ---------- */
.auth-page { background: var(--primary); background-image: linear-gradient(160deg, color-mix(in srgb, var(--primary) 100%, #000) 0%, color-mix(in srgb, var(--primary) 70%, #000) 100%); min-height: 100%; }
.auth-page .main { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem 1rem; }
.auth-card { background: var(--surface); width: 100%; max-width: 420px; padding: 2.2rem 2.2rem 1.6rem; border-top: 5px solid var(--accent); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.setup-card { max-width: 720px; }
.auth-card h1 { font-size: 1.7rem; margin-bottom: .2rem; }
.auth-card h2 { margin-top: 1.6rem; border-bottom: 1px solid var(--line); padding-bottom: .4rem; }
.auth-brand { margin-bottom: 1.4rem; }
.auth-brand img { max-height: 56px; max-width: 240px; }
.otp-input { font-size: 1.6rem !important; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1rem; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; border: 2px solid var(--line); padding: .8rem 1rem; font-weight: 700; color: var(--primary); }
.segmented small { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
.segmented input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, #fff); }
.segmented input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.syscheck { background: #f6f8fa; padding: .6rem 1rem; margin: 1rem 0; }
.syscheck summary { cursor: pointer; font-weight: 600; }
.syscheck ul { list-style: none; padding: 0; margin: .5rem 0 0; columns: 2; font-size: .92rem; }
.syscheck .ok { color: var(--ok); }
.syscheck .fail { color: var(--err); }
.qr-wrap { display: flex; gap: 1.2rem; align-items: center; margin: 1rem 0; flex-wrap: wrap; }
#qrcode { padding: 10px; background: #fff; border: 1px solid var(--line); }
.secret { display: inline-block; margin-top: .3rem; font-size: 1rem; letter-spacing: .05em; word-break: break-all; }
.steps { padding-left: 1.2rem; }
.inline-form { display: flex; gap: .6rem; align-items: flex-end; }
.inline-form .field { margin: 0; flex: 1; }

/* ---------- Gruppen ---------- */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.2rem; }
.group-card { margin: 0; }
.group-new { border-style: dashed; }
.group-head { margin-bottom: .6rem; }
.perm-list { border-top: 1px solid var(--line); padding-top: .6rem; }
.status-table input:not([type=radio]):not([type=color]) { min-width: 180px; }

/* ---------- Übersichtskarte ---------- */
.map-page { overflow: hidden; }
.mapview { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - var(--header-h)); position: relative; }
.map-sidebar { background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; padding: 1.1rem 1.1rem 2rem; }
.side-title { font-size: 1rem; margin: 1.4rem 0 .5rem; padding-bottom: .3rem; border-bottom: 2px solid var(--primary); }
.map { height: 100%; width: 100%; background: #e8edf1; }
.status-item { justify-content: flex-start; }
.status-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); flex-shrink: 0; }
.status-name { flex: 1; }
.status-item .count { margin-left: auto; }
.search-results { display: flex; flex-direction: column; }
.search-results button { text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: .5rem .3rem; font: inherit; cursor: pointer; }
.search-results button:hover { background: #f1f4f8; }
.tech-list { display: flex; flex-direction: column; }
.tech-row { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .6rem; text-align: left; background: none; border: 0; border-bottom: 1px solid #edf0f3; padding: .5rem .2rem; cursor: pointer; font: inherit; }
.tech-row:hover { background: #f5f7fa; }
.tech-row .tech-dot { grid-row: span 2; align-self: center; }
.tech-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.tech-dot.stale { opacity: .4; }
.tech-name { font-weight: 600; }

.tech-pin { width: 40px; height: 40px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c); border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tech-pin img, .tech-pin span { transform: rotate(45deg); }
.tech-pin img { width: 100%; height: 100%; object-fit: cover; }
.tech-pin span { color: #fff; font-weight: 700; font-size: .85rem; }
.tech-pin.stale { filter: grayscale(.8); opacity: .75; }
.stop-num { width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; font: 700 .75rem/18px var(--font); text-align: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.stop-num.done { background: #8a96a3; }
.start-pin { width: 26px; height: 26px; background: var(--primary); color: #fff; font: 700 .8rem/22px var(--font); text-align: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: color-mix(in srgb, var(--primary) 25%, transparent) !important; }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background: var(--primary) !important; color: #fff; font: 700 .8rem var(--font); }
.marker-cluster { border-radius: 50%; }
.marker-cluster div { width: 30px; height: 30px; margin: 5px; border-radius: 50%; text-align: center; line-height: 30px; }
.leaflet-tooltip em { color: var(--muted); font-style: normal; margin-left: .3rem; }
.leaflet-container { font-family: var(--font); }

.detail-panel { position: absolute; top: 12px; right: 60px; bottom: 12px; width: 380px; max-width: calc(100% - 24px); background: var(--surface); z-index: 1000; overflow-y: auto; padding: 1.2rem 1.3rem; box-shadow: 0 10px 40px rgba(0,30,60,.25); border-top: 4px solid var(--accent); }
.detail-close { position: absolute; top: 10px; right: 10px; }
.detail-head { margin-bottom: 1rem; padding-right: 2rem; }
.detail-head h2 { margin: .4rem 0 .1rem; font-size: 1.4rem; }
.tech-head { display: flex; gap: .9rem; align-items: center; }
.tech-head .avatar { box-shadow: 0 0 0 3px var(--c); }
.detail-panel h3 { margin-top: 1.2rem; padding-bottom: .3rem; border-bottom: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: .3rem .6rem; margin: 0 0 .8rem; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; }
.detail-notes { background: #f6f8fa; padding: .6rem .8rem; font-size: .92rem; border-left: 3px solid var(--line); }
.mini-list { padding-left: 1.2rem; margin: .3rem 0; font-size: .93rem; }
.mini-list li.done { color: var(--muted); text-decoration: line-through; }

/* ---------- Tourenplaner ---------- */
.tour-editor { display: grid; grid-template-columns: 420px 1fr; height: calc(100vh - var(--header-h)); }
.tour-side { background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; padding: 1rem 1.2rem 2rem; }
.tour-side-head h1 { font-size: 1.5rem; margin: .2rem 0 1rem; }
.back { font-size: .9rem; text-decoration: none; }
.back::before { content: "‹ "; }
.stops-head { display: flex; align-items: baseline; justify-content: space-between; border-top: 2px solid var(--primary); padding-top: .8rem; margin-top: .4rem; }
.stops-head h2 { margin: 0 0 .4rem; }
.stop-search { position: relative; margin-bottom: .6rem; }
.stop-search .search-results { position: absolute; left: 0; right: 0; z-index: 10; background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.start-info { font-size: .88rem; color: var(--ink-2); padding: .4rem .6rem; background: #f1f4f8; border-left: 3px solid var(--primary); margin-bottom: .5rem; }
.stop-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.stop-list li { display: grid; grid-template-columns: 28px 1fr auto; gap: .6rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.stop-list li.done .stop-name { color: var(--muted); }
.stop-list .stop-empty { display: block; color: var(--muted); padding: 1rem 0; }
.stop-index { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: .82rem; display: flex; align-items: center; justify-content: center; }
.stop-name { font-weight: 600; }
.stop-fields { display: flex; gap: .8rem; margin: .4rem 0; font-size: .85rem; color: var(--ink-2); flex-wrap: wrap; }
.stop-fields label { display: flex; align-items: center; gap: .3rem; }
.stop-fields input { width: auto; min-height: 32px; padding: .25rem .4rem; }
.stop-fields input[type=number] { width: 70px; }
.stop-note-input { min-height: 32px !important; padding: .3rem .5rem !important; font-size: .9rem !important; }
.stop-tools { display: flex; flex-direction: column; gap: .25rem; }
.tour-summary { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); margin-bottom: .6rem; }
.tour-summary > div { padding: .6rem .7rem; border-right: 1px solid var(--line); }
.tour-summary > div:last-child { border-right: 0; }
.tour-summary span { display: block; font-size: .8rem; color: var(--muted); }
.tour-summary strong { font-family: var(--font-head); font-size: 1.15rem; color: var(--primary); }
.popup-btn { margin-top: .5rem; }

/* ---------- Meine Touren ---------- */
.tracking-panel { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; border-left: 4px solid var(--accent); }
.tracking-panel h2 { border: 0; padding: 0; margin: 0 0 .2rem; }
.tracking-panel p { margin: 0; }
.tour-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.tour-card-head h2 { border: 0; padding: 0; margin-bottom: .1rem; }
.tour-card-head select { width: auto; }
.tour-notes { background: #fff8e8; padding: .6rem .8rem; border-left: 3px solid var(--warn); }
.my-stops { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.my-stops li { display: flex; gap: .9rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.my-stops li.done .stop-title, .my-stops li.done .muted { text-decoration: line-through; color: var(--muted); }
.stop-check input { width: 28px; height: 28px; accent-color: var(--ok); margin-top: .1rem; }
.stop-body { flex: 1; min-width: 0; }
.stop-title .time { font-weight: 700; color: var(--accent); margin-left: .3rem; }
.stop-note { margin-top: .3rem; font-weight: 600; color: var(--ink-2); }
.stop-links { display: flex; gap: .5rem; margin: .6rem 0 .3rem; }
.stop-body details summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: .92rem; margin-top: .3rem; }

/* ---------- Responsiv ---------- */
@media (max-width: 1000px) {
  .two-col, .grid-3 { grid-template-columns: 1fr; }
  .contact-row { grid-template-columns: 1fr 1fr; }
  .contact-row .radio, .contact-row .btn-icon { justify-self: start; }
  .tour-editor { grid-template-columns: 1fr; grid-template-rows: auto 55vh; height: auto; }
  .tour-side { border-right: 0; order: 2; }
  #tourMap { order: 1; height: 55vh; }
  .map-page { overflow: auto; }
}
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .mainnav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: stretch; background: #fff; border-bottom: 1px solid var(--line); padding: .5rem 0; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
  .nav-open .mainnav { display: flex; }
  .mainnav > a, .mainnav summary { border-bottom: 0; border-left: 3px solid transparent; padding: .7rem 1.5rem; }
  .mainnav > a.active, .mainnav summary.active { border-left-color: var(--accent); }
  .dropdown-menu { position: static; box-shadow: none; border: 0; padding-left: 1.5rem; }
  .usermenu { margin-left: 0; }
  .mapview { grid-template-columns: 1fr; grid-template-rows: 60vh auto; height: auto; }
  .map-sidebar { order: 2; border-right: 0; }
  #map { order: 1; height: 60vh; }
  .detail-panel { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: 100%; max-width: none; max-height: 70vh; }
  .grid-2 { grid-template-columns: 1fr; }
  .main { padding: 1.2rem 1rem 3rem; }
  h1 { font-size: 1.55rem; }
  .table th:nth-child(n+5), .table td:nth-child(n+5):not(.row-actions) { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Qualifikationen ---------- */
.chips { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.chip { display: inline-block; font-size: .78rem; font-weight: 600; line-height: 1.3; padding: .12rem .5rem; border-radius: 99px;
  color: color-mix(in srgb, var(--c) 70%, #000); background: color-mix(in srgb, var(--c) 13%, #fff); border: 1px solid color-mix(in srgb, var(--c) 35%, #fff); white-space: nowrap; }
.qual-picker { display: flex; flex-wrap: wrap; gap: .4rem; }
.qual-option { cursor: pointer; }
.qual-option input { position: absolute; opacity: 0; }
.qual-option span { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .75rem; border: 1px solid #c4ced8; border-radius: 99px; font-weight: 600; font-size: .9rem; color: var(--ink-2); background: #fff; }
.qual-option span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--c); }
.qual-option input:checked + span { background: color-mix(in srgb, var(--c) 14%, #fff); border-color: var(--c); color: color-mix(in srgb, var(--c) 70%, #000); }
.qual-option input:checked + span::before { background: var(--c); }
.qual-option input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--c) 45%, transparent); outline-offset: 1px; }
.qual-option input:disabled + span { cursor: default; opacity: .85; }
.chip-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.chip-filter a { --c: var(--primary); text-decoration: none; font-weight: 600; font-size: .88rem; padding: .3rem .8rem; border-radius: 99px; border: 1px solid #c4ced8; background: #fff; color: var(--ink-2); }
.chip-filter a:hover { border-color: var(--c); color: var(--ink); }
.chip-filter a.active { background: var(--c); border-color: var(--c); color: #fff; }
.qual-table input:not([type=color]):not([type=number]) { min-width: 160px; }
.holders summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.holders ul { margin: .3rem 0 0; padding-left: 1.1rem; font-size: .9rem; }
.table-wrap.flat { border: 0; margin-bottom: 1rem; }
.tech-row .tech-quals { grid-column: 2; margin-top: .2rem; }
.tech-row .tech-quals .chip { font-size: .7rem; padding: 0 .4rem; }
.compact-field { margin-bottom: .5rem; }
.compact-field select { min-height: 36px; padding: .3rem .5rem; }
.tech-quals-line { margin: -.5rem 0 1rem; min-height: .5rem; }

/* ---------- Start und Ende ---------- */
.endpoints { border: 1px solid var(--line); padding: .7rem .9rem .2rem; margin: 0 0 1rem; background: #fafbfc; }
.endpoints legend { font: 700 1rem var(--font-head); color: var(--primary); padding: 0 .3rem; }
.endpoint { margin-bottom: .7rem; }
.endpoint .field { margin-bottom: .3rem; }
.endpoint-resolved { color: var(--ink-2); padding-left: .1rem; }
.endpoint-custom { margin-top: .4rem; }
.endpoint-search { display: flex; gap: .35rem; flex-wrap: wrap; }
.endpoint-search input { flex: 1 1 180px; min-height: 34px; padding: .3rem .5rem; }
.endpoint-search .btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.warn-text { color: var(--warn); font-weight: 600; }
.end-pin { background: var(--accent); }
.start-pin { width: auto !important; min-width: 26px; padding: 0 4px; }
.map.picking, .map.picking .leaflet-interactive { cursor: crosshair !important; }
.segmented.compact span { padding: .55rem .8rem; }
.tour-ends { display: grid; grid-template-columns: auto 1fr; gap: .15rem .8rem; margin: .2rem 0 .8rem; font-size: .95rem; }
.tour-ends dt { color: var(--muted); }
.tour-ends dd { margin: 0; }

/* ---------- Tagesplanung, Termine, Übernachtungen ---------- */
.tour-summary.four { grid-template-columns: repeat(4, 1fr); }
.stop-list li.day-head { display: block; background: #eef2f7; border-left: 4px solid var(--primary); padding: .6rem .8rem; margin-top: .6rem; border-bottom: 0; }
.stop-list li.day-head.over { border-left-color: var(--err); background: #fbeeee; }
.day-bar { height: 6px; background: #d5dde6; margin: .35rem 0 .2rem; }
.day-bar span { display: block; height: 100%; background: var(--ok); }
.day-head.over .day-bar span { background: var(--err); }
.stop-list li.day-end { display: block; padding: .5rem 0 .2rem; border-bottom: 0; }
.stop-list li.night { display: block; background: #f6f3fb; border-left: 4px solid #6a4c93; padding: .6rem .8rem; margin: .6rem 0; }
.night-head { font-weight: 700; color: #4b3470; margin-bottom: .3rem; }
.hotel-chosen strong { color: var(--ink); }
.hotel-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: .3rem; }
.hotel-suggest { list-style: none; padding: 0; margin: .3rem 0 .5rem; }
.hotel-suggest li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .45rem 0; border-top: 1px solid #e4dcef; }
.hotel-other { display: flex; flex-direction: column; gap: .2rem; margin-top: .3rem; }
.hotel-other select { min-height: 34px; padding: .25rem .4rem; }
.stop-eta { font-size: .92rem; margin-top: .2rem; }
.stop-eta strong { color: var(--primary); }
.stop-warn { margin-top: .15rem; }
.stop-list li.has-warning .stop-index { background: var(--err); }
.appt-fields { background: #fff8e8; padding: .3rem .5rem; border-left: 3px solid var(--warn); }
.stop-fields select { width: auto; min-height: 32px; padding: .2rem .4rem; }
.stop-num.late { box-shadow: 0 0 0 3px var(--err); }
.hotel-pin { background: #6a4c93; }
.hotel-dot { width: 20px; height: 20px; background: #6a4c93; color: #fff; font: 700 .7rem/16px var(--font); text-align: center; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.stop-meta { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .25rem; }
.appt-badge { font-size: .82rem; font-weight: 700; color: #8a5300; background: #fff1d6; padding: .1rem .5rem; border-left: 3px solid var(--warn); }
.night-box { margin-top: 1rem; padding: .8rem 1rem; background: #f6f3fb; border-left: 4px solid #6a4c93; }
.night-box h3 { margin: 0 0 .4rem; color: #4b3470; border: 0; }

/* ---------- Persönliche Arbeitszeit ---------- */
.worktime-box { border: 1px solid var(--line); padding: .6rem .9rem .1rem; margin: 0 0 1rem; background: #fafbfc; }
.worktime-box legend { font: 700 1rem var(--font-head); color: var(--primary); padding: 0 .3rem; }
.tag-warn { background: #fff1d6; color: #8a5300; margin-left: .3rem; }
.worktime-note { background: #fff8e8; border-left: 3px solid var(--warn); padding: .4rem .7rem; }
.worktime-span { margin: .2rem 0 .6rem; color: var(--ink-2); }

/* ---------- Status auf der Karte ändern ---------- */
.status-select { display: inline-flex; align-items: center; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }
.status-select select { width: auto; min-height: 32px; padding: .2rem 1.8rem .2rem .55rem; border: 0; background-color: transparent; font-weight: 700; color: color-mix(in srgb, var(--c) 75%, #000); cursor: pointer; }
.status-select select:disabled { opacity: .6; }
.status-changed { margin-top: .25rem; min-height: 1em; }
