/* Fahrkarten-Ansicht: Übersicht (Karten/Tabelle), Kopfkarte in der Fahrkarte, Startseiten-Band */
.tk-workspace { --tk-line: var(--compact-line, #e6dfeb); --tk-soft: var(--compact-soft, #faf8fc); --tk-tint: var(--compact-tint, #f2ebf7); --tk-text: var(--compact-text, #302938); --tk-muted: var(--compact-muted, #756c7c); --tk-accent: var(--compact-accent, #643182); --tk-surface: var(--compact-surface, #fff); --tk-lilac: #b394cc; --tk-gold: #b8862d; --tk-green: #3f7654; --tk-coral: #b45b55; min-width: 0; color: var(--tk-text); }
.tk-editor, #dispatch-inbox.tk-inbox-panel { --tk-line: var(--compact-line, #e6dfeb); --tk-soft: var(--compact-soft, #faf8fc); --tk-tint: var(--compact-tint, #f2ebf7); --tk-text: var(--compact-text, #302938); --tk-muted: var(--compact-muted, #756c7c); --tk-accent: var(--compact-accent, #643182); --tk-surface: var(--compact-surface, #fff); --tk-lilac: #b394cc; --tk-gold: #b8862d; --tk-green: #3f7654; --tk-coral: #b45b55; }
.tk-ico { width: 18px; height: 18px; flex: none; }

/* Kopfbereich */
.tk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: 0 0 18px; }
.tk-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font: 650 20px/1.25 "Segoe UI", Arial, sans-serif; color: var(--tk-accent); }
.tk-head h2 svg { width: 22px; height: 22px; }
.tk-head p { margin: 5px 0 0; color: var(--tk-muted); font-size: 13px; }
.tk-head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex: none; }
.tk-head-actions .button { border-radius: 10px; }

/* Statuskacheln */
.tk-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.tk-tile { display: grid; gap: 2px; padding: 13px 15px; border: 1px solid var(--tk-line); border-radius: 14px; background: var(--tk-surface); box-shadow: 0 6px 18px rgba(60, 32, 74, .05); text-align: left; cursor: pointer; font: inherit; color: var(--tk-text); position: relative; overflow: hidden; transition: transform .12s ease, box-shadow .12s ease; min-width: 0; }
.tk-tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--tk-tile-color, var(--tk-accent)); }
.tk-tile:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(60, 32, 74, .09); }
.tk-tile.active { outline: 2px solid var(--tk-accent); outline-offset: 1px; background: var(--tk-tint); }
.tk-tile small { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--tk-muted); font-weight: 700; }
.tk-tile strong { font-size: 24px; line-height: 1.15; color: var(--tk-tile-color, var(--tk-accent)); }
.tk-tile span { font-size: 12px; color: var(--tk-muted); overflow-wrap: anywhere; }
.tk-tile.offen { --tk-tile-color: var(--tk-gold); }
.tk-tile.bestaetigt { --tk-tile-color: var(--tk-green); }
.tk-tile.unterwegs { --tk-tile-color: var(--tk-accent); }
.tk-tile.heute { --tk-tile-color: var(--tk-coral); }
.tk-tile.abgeschlossen { --tk-tile-color: #5d696e; }

/* Filterleiste */
.tk-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin: 0 0 10px; padding: 12px 14px; border: 1px solid var(--tk-line); border-radius: 14px; background: var(--tk-soft); }
.tk-toolbar label { display: grid; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--tk-muted); min-width: 0; }
.tk-toolbar select, .tk-toolbar input { min-height: 36px; padding: 5px 10px; border: 1px solid var(--tk-line); border-radius: 9px; background: var(--tk-surface); color: var(--tk-text); font: inherit; font-size: 13px; text-transform: none; letter-spacing: 0; }
.tk-toolbar .tk-search { flex: 1 1 240px; }
.tk-toolbar .tk-search input { width: 100%; }
.tk-mode { display: inline-flex; padding: 3px; border: 1px solid var(--tk-line); border-radius: 10px; background: var(--tk-surface); margin-left: auto; }
.tk-mode button { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; color: var(--tk-muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.tk-mode button svg { width: 15px; height: 15px; }
.tk-mode button.active { background: var(--tk-accent); color: #fff; }
.tk-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 14px; padding: 0 4px; font-size: 12.5px; color: var(--tk-muted); }
.tk-link { padding: 0; border: 0; background: none; color: var(--tk-accent); font: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(100, 49, 130, .35); text-underline-offset: 2px; cursor: pointer; }
.tk-link:hover { text-decoration-color: currentColor; }

/* Gruppen und Karten */
.tk-group { margin: 0 0 22px; }
.tk-group-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; padding: 0 4px 6px; border-bottom: 2px solid var(--tk-tint); }
.tk-group-head h3 { margin: 0; font: 650 15px/1.3 "Segoe UI", Arial, sans-serif; color: var(--tk-accent); }
.tk-group.today .tk-group-head h3::before, .tk-group.past .tk-group-head h3::before { content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 8px 1px 0; border-radius: 50%; background: var(--tk-coral); }
.tk-group.past .tk-group-head h3 { color: var(--tk-muted); }
.tk-group.past .tk-group-head h3::before { background: var(--tk-gold); }
.tk-group-head span { font-size: 12px; color: var(--tk-muted); }
.tk-cards { display: grid; gap: 12px; }
.tk-card { --tk-edge: var(--tk-gold); position: relative; display: grid; grid-template-columns: 148px minmax(0, 1fr) 236px; gap: 14px 18px; padding: 16px 18px 16px 22px; border: 1px solid var(--tk-line); border-radius: 16px; background: var(--tk-surface); box-shadow: 0 6px 18px rgba(60, 32, 74, .05); cursor: pointer; min-width: 0; transition: box-shadow .12s ease, border-color .12s ease; overflow: hidden; }
.tk-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--tk-edge); }
.tk-card:hover, .tk-card:focus-visible { border-color: #d8c8e2; box-shadow: 0 12px 28px rgba(60, 32, 74, .11); outline: none; }
.tk-card:focus-visible { outline: 2px solid var(--tk-accent); outline-offset: 2px; }
.tk-card.phase-bestaetigt { --tk-edge: var(--tk-green); }
.tk-card.phase-unterwegs { --tk-edge: var(--tk-accent); }
.tk-card.phase-abgeschlossen { --tk-edge: #8b94a2; background: #fcfbfd; }
.tk-card.urgent { --tk-edge: var(--tk-coral); }
.tk-card.review { background: linear-gradient(90deg, #fffaf0 0, var(--tk-surface) 220px); }
.tk-card.readonly { background: #fcfaf5; }
.tk-card-lead { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.tk-number { color: var(--tk-accent); font-size: 12.5px; font-weight: 800; letter-spacing: .02em; }
.tk-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.tk-badges:empty { display: none; }
.tk-badge { display: inline-flex; align-items: center; min-height: 20px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #eee9f1; color: #4e2555; white-space: nowrap; }
.tk-badge.urgent { background: #f6dfdc; color: #8f2b24; }
.tk-badge.review { background: #fff1db; color: #8c520b; }
.tk-badge.emergency { background: #fbe6e2; color: #9a2c22; }
.tk-badge.authority { background: #e8eef5; color: #2f4d6f; }
.tk-badge.route { background: var(--tk-tint); color: var(--tk-accent); }
.tk-process { font-size: 11.5px; color: var(--tk-muted); line-height: 1.35; overflow-wrap: anywhere; }
.tk-card-main { display: grid; gap: 10px; min-width: 0; align-content: start; }
.tk-route { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); gap: 10px; align-items: center; }
.tk-stop { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--tk-line); border-radius: 12px; background: var(--tk-soft); }
.tk-stop > div { min-width: 0; display: grid; gap: 2px; }
.tk-stop small { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--tk-muted); font-weight: 700; }
.tk-stop strong { font-size: 13px; line-height: 1.4; font-weight: 600; color: var(--tk-text); overflow-wrap: anywhere; }
.tk-stop-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--tk-tint); color: var(--tk-accent); }
.kind-hospital .tk-stop-icon { background: #e6eef7; color: #2f5b8e; }
.kind-care .tk-stop-icon { background: #e8f0ec; color: #2f6f4f; }
.kind-home .tk-stop-icon { background: #fbefe0; color: #9a5d14; }
.kind-cemetery .tk-stop-icon { background: #ecebe6; color: #5a5a4a; }
.kind-crematory .tk-stop-icon { background: #fbe6de; color: #a0402b; }
.kind-cooling .tk-stop-icon { background: #e4f1f5; color: #2b6b7c; }
.kind-forensic .tk-stop-icon { background: #e8eef5; color: #2f4d6f; }
.kind-funeral .tk-stop-icon { background: var(--tk-tint); color: var(--tk-accent); }
.tk-route-arrow { display: grid; place-items: center; color: var(--tk-lilac); }
.tk-route-arrow svg { width: 20px; height: 20px; }
.tk-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--tk-muted); }
.tk-meta > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.tk-meta svg, .tk-time svg { width: 15px; height: 15px; color: var(--tk-lilac); flex: none; }
.tk-meta strong { color: var(--tk-text); font-weight: 650; }
.tk-meta em { font-style: normal; }
.tk-time { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--tk-text); white-space: nowrap; }
.tk-time.today { color: var(--tk-coral); }
.tk-time.late { color: #9a2c22; }
.tk-time.late::after { content: "überfällig"; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #fbe9e7; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.tk-time.open { color: var(--tk-muted); font-weight: 500; }
.tk-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 8px 11px; border-radius: 10px; background: var(--tk-soft); font-size: 12.5px; line-height: 1.45; color: var(--tk-text); }
.tk-note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--tk-muted); }
.tk-note.safety { background: #fff7e8; color: #6f4c16; border: 1px solid #ecd9b3; }
.tk-note.safety svg { color: #b9781c; }
.tk-card .tk-note span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tk-card-side { display: grid; gap: 10px; align-content: start; min-width: 0; padding-left: 16px; border-left: 1px solid var(--tk-line); }
.tk-crew { display: grid; gap: 8px; }
.tk-vehicle, .tk-drivers { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
.tk-vehicle > svg, .tk-drivers > svg { width: 17px; height: 17px; color: var(--tk-accent); flex: none; }
.tk-vehicle > span, .tk-drivers > span:last-child { display: grid; min-width: 0; line-height: 1.3; }
.tk-vehicle strong { font-size: 13px; font-weight: 700; }
.tk-vehicle small, .tk-drivers small { color: var(--tk-muted); font-size: 11.5px; }
.tk-vehicle.open, .tk-drivers.open { color: var(--tk-muted); }
.tk-vehicle.open strong { font-weight: 600; color: var(--tk-gold); }
.tk-avatars { display: inline-flex; flex: none; }
.tk-avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--tk-surface); background: var(--tk-tint); color: var(--tk-accent); font-size: 10.5px; font-weight: 800; font-style: normal; }
.tk-avatars .tk-avatar + .tk-avatar { margin-left: -8px; }
.tk-gps { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--tk-line); font-size: 10px; font-weight: 700; color: var(--tk-muted); white-space: nowrap; }
.tk-gps svg { width: 11px; height: 11px; }
.tk-gps.live { border-color: #a9cab4; background: #edf6f0; color: #2f7048; }
.tk-gps.recent { border-color: #d9c48e; background: #fbf7ea; color: #80601d; }
.tk-actions { display: grid; gap: 8px; }
.tk-status-field { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--tk-muted); }
.tk-status-field select { min-height: 32px; padding: 3px 8px; border: 1px solid var(--tk-line); border-radius: 9px; background: var(--tk-surface); color: var(--tk-text); font: inherit; font-size: 12.5px; text-transform: none; letter-spacing: 0; }
.tk-action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tk-pill { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border: 1px solid #d8c8e2; border-radius: 999px; background: var(--tk-surface); color: #4e2555; font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.tk-pill svg { width: 14px; height: 14px; }
.tk-pill:hover { background: var(--tk-tint); }
.tk-pill.primary { border-color: var(--tk-accent); background: var(--tk-accent); color: #fff; }
.tk-pill.primary:hover { background: #4e2555; }
.tk-pill:disabled { opacity: .55; cursor: default; }
.tk-delete { width: 30px; height: 30px; margin-left: auto; color: var(--tk-muted); }
.tk-delete:hover { background: #fbe9e7; color: #9a2c22; }
.tk-delete.force-delete { color: #b58a8a; }

/* Tabelle */
.tk-table-wrap { overflow-x: auto; border: 1px solid var(--tk-line); border-radius: 14px; background: var(--tk-surface); box-shadow: 0 6px 18px rgba(60, 32, 74, .05); }
.tk-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tk-table th { padding: 10px 10px; text-align: left; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--tk-muted); border-bottom: 1px solid var(--tk-line); background: var(--tk-soft); white-space: nowrap; }
.tk-table td { padding: 10px 10px; border-bottom: 1px solid var(--tk-line); vertical-align: top; }
.tk-table tr:last-child td { border-bottom: 0; }
.tk-row { cursor: pointer; border-left: 5px solid var(--tk-gold); }
.tk-row.phase-bestaetigt { border-left-color: var(--tk-green); }
.tk-row.phase-unterwegs { border-left-color: var(--tk-accent); }
.tk-row.phase-abgeschlossen { border-left-color: #8b94a2; }
.tk-row.urgent { border-left-color: var(--tk-coral); }
.tk-row:hover { background: var(--tk-soft); }
.tk-row:focus-visible { outline: 2px solid var(--tk-accent); outline-offset: -2px; }
.tk-row td small { display: block; margin-top: 3px; color: var(--tk-muted); font-size: 11.5px; }
.tk-row td small.open { color: var(--tk-gold); }
.tk-row-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tk-row-route { display: grid; gap: 5px; min-width: 150px; }
.tk-row-route span { display: flex; align-items: flex-start; gap: 6px; line-height: 1.35; overflow-wrap: anywhere; }
.tk-row-route svg { width: 15px; height: 15px; margin-top: 1px; color: var(--tk-accent); flex: none; }
.tk-row-crew { display: grid; gap: 3px; }
.tk-row-actions { width: 1%; white-space: nowrap; }
.tk-table .tk-time { white-space: normal; flex-wrap: wrap; }
.tk-table .tk-status-field { grid-template-columns: minmax(0, 1fr); }
.tk-table .tk-status-field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tk-table .tk-status-field select { width: 100%; }
.tk-row-actions .tk-status-field { margin-bottom: 6px; }
.tk-row-actions .tk-action-row { flex-wrap: nowrap; }
.tk-table .tk-pill { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 50%; }
.tk-table .tk-pill svg { width: 15px; height: 15px; }
.tk-table .tk-pill span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tk-table .tk-delete { margin-left: 0; }

/* Leerzustand */
.tk-empty { display: grid; justify-items: center; gap: 6px; padding: 38px 20px; border: 1px dashed #d8c8e2; border-radius: 16px; background: var(--tk-soft); text-align: center; color: var(--tk-muted); }
.tk-empty svg { width: 44px; height: 44px; margin-bottom: 4px; color: var(--tk-lilac); }
.tk-empty strong { font-size: 15px; color: var(--tk-text); }
.tk-empty p { margin: 0 0 6px; font-size: 13px; max-width: 460px; }

/* Ressourcen unterhalb der Liste */
.tk-resources { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 22px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--tk-line); }
.tk-resource { min-width: 0; }
.tk-workspace .fleet-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tk-workspace .transfer-section-head span b { font-weight: 700; }

/* Bestehende Abholprüfungs-Warnung an das Kartenbild angleichen */
.tk-workspace .transfer-intake-alert { border-radius: 14px; margin-bottom: 16px; }
.tk-workspace .transfer-intake-alert-icon { border-radius: 10px; }
.tk-workspace .transfer-intake-alert button { border-radius: 10px; }

/* Kopfkarte in der geöffneten Fahrkarte */
.tk-headcard { --tk-edge: var(--tk-gold); position: relative; display: grid; gap: 16px; margin: 0 0 18px; padding: 18px 20px 18px 24px; border: 1px solid var(--tk-line); border-radius: 16px; background: var(--tk-surface); box-shadow: 0 8px 22px rgba(60, 32, 74, .07); overflow: hidden; }
.tk-headcard::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--tk-edge); }
.tk-headcard.phase-bestaetigt { --tk-edge: var(--tk-green); }
.tk-headcard.phase-unterwegs { --tk-edge: var(--tk-accent); }
.tk-headcard.urgent { --tk-edge: var(--tk-coral); }
.tk-headcard-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.tk-headcard-top > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tk-headcard-top .tk-number { font-size: 18px; }
.tk-headcard-top small { color: var(--tk-muted); font-size: 12px; }
.tk-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: tk-step; }
.tk-steps li { position: relative; display: grid; justify-items: center; gap: 4px; padding: 0 6px; text-align: center; min-width: 0; }
.tk-steps li::before { content: ""; position: absolute; top: 13px; left: 50%; right: -50%; height: 2px; background: var(--tk-line); }
.tk-steps li:last-child::before { display: none; }
.tk-steps li.done::before { background: var(--tk-accent); }
.tk-steps li i { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--tk-line); background: var(--tk-surface); color: #fff; font-style: normal; }
.tk-steps li i svg { width: 14px; height: 14px; }
.tk-steps li.done i { border-color: var(--tk-accent); background: var(--tk-accent); }
.tk-steps li.current i { border-color: var(--tk-accent); background: var(--tk-tint); box-shadow: 0 0 0 4px rgba(100, 49, 130, .14); }
.tk-steps li.current i::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--tk-accent); }
.tk-steps strong { font-size: 12.5px; color: var(--tk-muted); font-weight: 650; }
.tk-steps li.done strong, .tk-steps li.current strong { color: var(--tk-text); }
.tk-steps small { font-size: 11px; color: var(--tk-muted); overflow-wrap: anywhere; }
.tk-route.large .tk-stop { padding: 12px 14px; }
.tk-route.large .tk-stop strong { font-size: 14px; }
.tk-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tk-facts > div { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--tk-line); border-radius: 12px; background: var(--tk-soft); min-width: 0; align-content: start; }
.tk-facts small { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--tk-muted); font-weight: 700; }
.tk-facts strong { font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
.tk-facts span { font-size: 11.5px; color: var(--tk-muted); overflow-wrap: anywhere; }
.tk-facts .tk-time { white-space: normal; flex-wrap: wrap; }
.tk-driver-line { display: flex; align-items: center; gap: 8px; }
.tk-headcard-actions { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--tk-line); }
.tk-status-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tk-status-pills small { margin-right: 4px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--tk-muted); }
.tk-pill.status { border-color: var(--tk-line); color: var(--tk-muted); }
.tk-pill.status.active { border-color: var(--tk-accent); background: var(--tk-tint); color: var(--tk-accent); cursor: default; }
.tk-editor .tk-form-title, .tk-editor .tk-history-title { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 15px; font-weight: 650; color: var(--tk-accent); }
.tk-editor .tk-form-title svg, .tk-editor .tk-history-title svg { width: 17px; height: 17px; }
.tk-editor .transfer-qr-panel { border-radius: 12px; }
.tk-editor .transfer-history.tk-timeline { max-height: none; padding: 4px 0 0 2px; }
.tk-editor .tk-timeline .history-entry { grid-template-columns: 24px 1fr; gap: 10px; min-height: 0; padding-bottom: 14px; }
.tk-editor .tk-timeline .history-entry::before { left: 9px; top: 20px; bottom: 0; background: var(--tk-line); }
.tk-editor .tk-timeline .history-entry i { width: 18px; height: 18px; border: 3px solid var(--tk-tint); background: var(--tk-accent); }
.tk-editor .tk-timeline .history-entry > div { padding: 9px 12px; border: 1px solid var(--tk-line); border-radius: 12px; background: var(--tk-soft); }
.tk-editor .tk-timeline .history-entry p { margin-top: 4px; }
.tk-editor .tk-timeline .history-entry small { display: block; margin-top: 3px; color: var(--tk-muted); font-size: 11.5px; }
.tk-vehicle-history { margin: 18px 0 4px; padding: 14px 16px; border: 1px solid var(--tk-line); border-radius: 14px; background: var(--tk-surface); }
.tk-vehicle-history > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tk-vehicle-history > header > div { display: grid; grid-template-columns: 20px 1fr; gap: 2px 10px; align-items: center; }
.tk-vehicle-history > header svg { width: 18px; height: 18px; color: var(--tk-accent); grid-row: span 2; }
.tk-vehicle-history > header strong { font-size: 14px; }
.tk-vehicle-history > header small { color: var(--tk-muted); font-size: 12px; }
.tk-hist-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tk-hist-grid h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--tk-muted); }
.tk-hist-grid h4 span { padding: 0 7px; border-radius: 999px; background: var(--tk-tint); color: var(--tk-accent); font-size: 11px; }
.tk-hist-card { display: grid; gap: 4px; margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--tk-line); border-left: 4px solid #8b94a2; border-radius: 12px; background: var(--tk-soft); font-size: 12.5px; }
.tk-hist-card.open { border-left-color: var(--tk-gold); }
.tk-hist-card.clean { border-left-color: var(--tk-green); }
.tk-hist-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tk-hist-card small { color: var(--tk-muted); font-size: 11.5px; }
.tk-hist-card p { margin: 2px 0 0; line-height: 1.4; }
.tk-hist-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tk-hist-photos a { display: block; width: 64px; height: 64px; overflow: hidden; border-radius: 8px; border: 1px solid var(--tk-line); background: var(--tk-surface); }
.tk-hist-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tk-hist-empty { margin: 0; font-size: 12.5px; color: var(--tk-muted); }

/* Startseiten-Band */
#dispatch-inbox.tk-inbox-panel { padding: 0; border: 1px solid #d8c8e2; border-left: 6px solid #643182; border-radius: 16px; background: var(--tk-surface, #fff); box-shadow: 0 8px 22px rgba(60, 32, 74, .07); color: var(--tk-text); overflow: hidden; }
#dispatch-inbox.tk-inbox-panel .tk-inbox-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--tk-line); background: var(--tk-soft); }
#dispatch-inbox.tk-inbox-panel .tk-inbox-head > div { display: grid; gap: 1px; min-width: 0; flex: 1 1 auto; }
#dispatch-inbox.tk-inbox-panel .tk-inbox-head strong { font-size: 14px; color: var(--tk-accent); }
#dispatch-inbox.tk-inbox-panel .tk-inbox-head span[role="status"] { font-size: 12.5px; color: var(--tk-muted); }
#dispatch-inbox.tk-inbox-panel .tk-inbox-head .button { border-radius: 999px; flex: none; }
#dispatch-inbox.tk-inbox-panel .tk-inbox-head .button svg { width: 14px; height: 14px; }
.tk-inbox-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 11px; background: var(--tk-accent); color: #fff; }
.tk-inbox-icon svg { width: 20px; height: 20px; }
.tk-inbox-count { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; flex: none; border-radius: 999px; background: var(--tk-tint); color: var(--tk-accent); font-size: 15px; font-weight: 800; }
.tk-inbox-count.urgent { background: #f6dfdc; color: #8f2b24; }
.tk-inbox-list { display: grid; }
.tk-inbox-list article { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--tk-line); }
.tk-inbox-list article:first-child { border-top: 0; }
.tk-inbox-list article.urgent { background: linear-gradient(90deg, #fff5f3 0, transparent 240px); }
.tk-inbox-main { display: grid; gap: 3px; min-width: 0; flex: 1 1 auto; }
.tk-inbox-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tk-inbox-title strong { color: var(--tk-accent); font-size: 13.5px; }
.tk-inbox-title small { color: var(--tk-muted); font-size: 12px; }
.tk-inbox-main p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; font-size: 13px; }
.tk-inbox-main p span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.tk-inbox-main p svg { width: 15px; height: 15px; color: var(--tk-accent); flex: none; }
.tk-inbox-main p i { display: inline-grid; color: var(--tk-lilac); }
.tk-inbox-main > small { font-size: 11.5px; color: var(--tk-muted); }
.tk-inbox-actions { display: flex; gap: 6px; flex: none; }
.tk-inbox-actions .button { border-radius: 999px; }
.tk-inbox-actions .button svg { width: 14px; height: 14px; }
#dispatch-inbox.tk-inbox-panel footer { padding: 8px 16px 10px; border-top: 1px solid var(--tk-line); background: var(--tk-soft); font-size: 12.5px; }

/* Dunkles Thema: Kartenfarben anpassen */
html[data-workspace-theme="dark"] .tk-card.review { background: linear-gradient(90deg, #3a3020 0, var(--tk-surface) 220px); }
html[data-workspace-theme="dark"] .tk-card.readonly, html[data-workspace-theme="dark"] .tk-card.phase-abgeschlossen { background: var(--tk-surface); }
html[data-workspace-theme="dark"] .tk-note.safety { background: #3a3020; color: #f1d9a8; border-color: #5a4a2a; }
html[data-workspace-theme="dark"] .tk-avatar { border-color: var(--tk-surface); }
html[data-workspace-theme="dark"] .tk-pill { border-color: var(--tk-line); color: var(--tk-accent); }
html[data-workspace-theme="dark"] .tk-pill.primary { border-color: var(--tk-accent); background: var(--tk-accent); color: #26212b; }
html[data-workspace-theme="dark"] .tk-pill.status { color: var(--tk-muted); }
html[data-workspace-theme="dark"] .tk-pill.status.active { color: var(--tk-accent); }
html[data-workspace-theme="dark"] .tk-mode button.active { color: #26212b; }
html[data-workspace-theme="dark"] .tk-badge { background: var(--tk-tint); color: var(--tk-accent); }
html[data-workspace-theme="dark"] .tk-badge.urgent, html[data-workspace-theme="dark"] .tk-badge.emergency { background: #4a2a2a; color: #f2b8b0; }
html[data-workspace-theme="dark"] .tk-badge.review { background: #4a3a20; color: #f1d39a; }
html[data-workspace-theme="dark"] .tk-badge.authority { background: #2c3a4a; color: #b7cce6; }
html[data-workspace-theme="dark"] .tk-time.late::after { background: #4a2a2a; color: #f2b8b0; }
html[data-workspace-theme="dark"] .tk-stop-icon { background: var(--tk-tint); color: var(--tk-accent); }
html[data-workspace-theme="dark"] .tk-inbox-icon { color: #26212b; }
html[data-workspace-theme="dark"] .tk-empty { border-color: var(--tk-line); }
html[data-workspace-theme="dark"] .tk-hist-card, html[data-workspace-theme="dark"] .tk-vehicle-history { background: var(--tk-surface); }

/* Schmale Bildschirme */
@media (max-width: 1100px) {
  .tk-card { grid-template-columns: 132px minmax(0, 1fr); }
  .tk-card-side { grid-column: 1 / -1; padding-left: 0; padding-top: 12px; border-left: 0; border-top: 1px solid var(--tk-line); grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .tk-resources { grid-template-columns: 1fr; }
  .tk-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .tk-head { flex-direction: column; }
  .tk-head-actions { justify-content: flex-start; }
  .tk-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tk-tile { padding: 11px 12px; }
  .tk-tile strong { font-size: 20px; }
  .tk-toolbar { padding: 10px; gap: 8px 10px; }
  .tk-toolbar label { flex: 1 1 calc(50% - 10px); }
  .tk-toolbar .tk-search { flex-basis: 100%; }
  .tk-toolbar select, .tk-toolbar input[type="date"] { width: 100%; min-width: 0; }
  .tk-mode { margin-left: 0; width: 100%; }
  .tk-mode button { flex: 1 1 0; justify-content: center; }
  .tk-card { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px 14px 14px 18px; border-radius: 14px; }
  .tk-card-lead { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .tk-card-lead .tk-process { flex-basis: 100%; }
  .tk-route { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .tk-route-arrow { transform: rotate(90deg); justify-self: start; margin-left: 12px; }
  .tk-card-side { grid-template-columns: minmax(0, 1fr); }
  .tk-status-field { grid-template-columns: auto minmax(0, 1fr); }
  .tk-action-row .tk-pill { flex: 1 1 auto; justify-content: center; }
  .tk-delete { margin-left: 0; }
  .tk-headcard { padding: 14px 14px 14px 18px; }
  .tk-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tk-steps li { padding: 0 2px; }
  .tk-steps strong { font-size: 9.5px; letter-spacing: -.01em; hyphens: manual; }
  .tk-steps small { display: none; }
  .tk-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tk-hist-grid { grid-template-columns: 1fr; }
  #dispatch-inbox.tk-inbox-panel .tk-inbox-head { flex-wrap: wrap; }
  #dispatch-inbox.tk-inbox-panel .tk-inbox-head .button { order: 5; width: 100%; justify-content: center; }
  .tk-inbox-list article { flex-direction: column; align-items: stretch; gap: 8px; }
  .tk-inbox-actions .button { flex: 1 1 0; justify-content: center; }
}
