/* H&H Logistics – Components
   Buttons, Badges, Form-Elemente, Datenkacheln, Tour-Stops, Alerts,
   Replay, Trip-Liste, Destination-Picker
   Klassennamen sind durch das vorhandene JS vorgegeben — Styling neu.
*/

/* ── Buttons (generisch) ───────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 12px;
  border-radius: var(--r-2);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .04s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--hh-blue); color: #fff;
  border-color: var(--hh-blue);
  box-shadow: 0 1px 0 rgba(0,0,0,.04), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn-primary:hover { background: var(--hh-blue-600); border-color: var(--hh-blue-600); }
.btn-ghost {
  background: var(--bg1); color: var(--text2);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg4); color: var(--text1); }
.btn-danger {
  background: var(--hh-red); color: #fff; border-color: var(--hh-red);
}
.btn-danger:hover { background: var(--hh-red-600); border-color: var(--hh-red-600); }

/* ── Filter-Pills (linke Sidebar) ──────────────────── */
.fbtn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 9px;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0;
  color: var(--text2);
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.fbtn:hover { background: var(--bg4); color: var(--text1); }
.fbtn.on   { background: var(--hh-blue); color: #fff; box-shadow: 0 1px 2px rgba(27,79,158,.25); }

/* ── Search / Inputs ───────────────────────────────── */
.search,
.rf-input,
.dest-input,
.input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  color: var(--text1);
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.search:focus,
.rf-input:focus,
.dest-input:focus,
.input:focus {
  border-color: var(--hh-blue);
  box-shadow: var(--ring);
}
.search::placeholder,
.dest-input::placeholder,
.input::placeholder { color: var(--text3); }

.rf-input { font-family: var(--font-mono); font-size: 12px; padding: 7px 10px; color-scheme: light; }
.dest-input { font-size: 12px; padding: 8px 10px; }

/* ── Badges (Status) ───────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: 999px;
  background: var(--bg3);
  color: var(--text2);
}
.badge::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.badge-fahrt     { background: var(--green-d);  color: var(--green); }
.badge-pause     { background: var(--orange-d); color: var(--orange); }
.badge-laden     { background: var(--blue-d);   color: var(--blue); }
.badge-stoerung  { background: var(--red-d);    color: var(--red); }
.badge-entladen  { background: var(--purple-d); color: var(--purple); }
.badge-leerfahrt { background: var(--cyan-d);   color: var(--cyan); }
.badge-werkstatt { background: var(--yellow-d); color: var(--yellow); }
.badge-bereit    { background: var(--mint-d);   color: var(--mint); }

/* Klickbares Status-Badge (rechte Sidebar) */
.badge.editable {
  cursor: pointer;
  position: relative;
  padding-right: 22px;
  transition: filter .15s, transform .04s;
}
.badge.editable::after {
  content: '\f078';                  /* fa-chevron-down */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  font-size: 8px;
  opacity: .7;
}
.badge.editable:hover { filter: brightness(.95); }
.badge.editable:active { transform: translateY(1px); }

/* Status-Picker Popover */
.status-picker {
  position: absolute;
  top: calc(100% - 4px);
  right: 14px;
  width: 240px;
  background: var(--bg1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 1200;
  animation: modalIn .18s cubic-bezier(.2,.8,.2,1);
}
.status-picker-head {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text3);
  padding: 6px 10px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.status-picker-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: 0;
  border-radius: var(--r-2);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background .12s;
}
.status-picker-item:not(:disabled):hover { background: var(--bg3); }
.status-picker-item.current {
  background: var(--bg3);
  cursor: default;
}
.status-picker-item:disabled { cursor: default; opacity: .85; }

/* Tiny notification bubble */
.nbadge {
  background: var(--hh-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  min-width: 18px;
  text-align: center;
  border-radius: 999px;
  font-family: var(--font-mono);
  line-height: 1.2;
  display: inline-block;
}

/* ── Vehicle Cards (linke Sidebar) ─────────────────── */
.vc {
  position: relative;
  padding: 11px 12px 11px 14px;
  margin-bottom: 4px;
  border-radius: var(--r-3);
  border: 1px solid transparent;
  background: var(--bg1);
  cursor: pointer;
  overflow: hidden;
  min-width: 0;
  transition: background .15s, border-color .15s, transform .08s;
}
.vc::before {
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--text3);
  opacity: .6;
}
.vc:hover { background: var(--bg3); }
.vc.sel {
  background: var(--hh-blue-50);
  border-color: rgba(27, 79, 158, .25);
}
.vc.sel::before { background: var(--hh-blue); opacity: 1; width: 3px; }

/* Status-Linkrand pro Status (etwas Subtiles) */
.vc:has(.badge-fahrt)::before     { background: var(--green); }
.vc:has(.badge-pause)::before     { background: var(--orange); }
.vc:has(.badge-laden)::before     { background: var(--blue); }
.vc:has(.badge-entladen)::before  { background: var(--purple); }
.vc:has(.badge-leerfahrt)::before { background: var(--cyan); }
.vc:has(.badge-werkstatt)::before { background: var(--yellow); }
.vc:has(.badge-bereit)::before    { background: var(--mint); }
.vc:has(.badge-stoerung)::before  { background: var(--red); }

.vc-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 5px; gap: 8px;
  min-width: 0;
}
.vc-id  {
  font-family: var(--font-mono); font-weight: 700;
  font-size: 13px; color: var(--text1);
  letter-spacing: -.01em;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: inline-flex; align-items: center;
}
.vc-top .badge { flex-shrink: 0; }
.vc-driver {
  font-size: 12px; color: var(--text2);
  margin-bottom: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vc-meta {
  display: flex; gap: 10px;
  font-size: 10.5px; color: var(--text3);
  font-family: var(--font-mono);
  overflow: hidden;
}
.vc-meta span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vc-eta {
  font-size: 11px; color: var(--green);
  margin-top: 5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vc-eta.late { color: var(--red); }

/* ── Right Sidebar – Tabs ───────────────────────────── */
.rtab {
  flex: 0 0 auto;
  position: relative;
  padding: 11px 8px;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--text3);
  background: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s;
}
.rtab:hover { color: var(--text1); }
.rtab.on    { color: var(--hh-blue); }
.rtab.on::after {
  content: '';
  position: absolute;
  left: 6px; right: 6px;
  bottom: -1px;
  height: 2px;
  background: var(--hh-blue);
  border-radius: 2px 2px 0 0;
}
.rtab .nbadge { font-size: 9px; padding: 1px 5px; min-width: 16px; }

/* ── Sections (rechte Sidebar) ─────────────────────── */
.sec { margin-bottom: 18px; }
.sec-t {
  display: flex; align-items: center;
  font-size: 10px; font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Datenkacheln-Grid */
.dg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.di {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: 9px 11px;
  transition: border-color .15s;
}
.di:hover { border-color: var(--border-strong); }
.di.fw { grid-column: 1 / -1; }
.dl {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 4px;
}
.dv {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text1);
  letter-spacing: -.01em;
}
.dv.sm { font-size: 11.5px; font-weight: 500; }
.dv.g { color: var(--green); }
.dv.o { color: var(--orange); }
.dv.r { color: var(--red); }
.dv.b { color: var(--blue); }

/* Progress bar */
.pbar {
  width: 100%; height: 4px;
  background: rgba(15, 23, 42, .08);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.pfill {
  height: 100%;
  border-radius: 2px;
  transition: width .25s ease;
}

/* CAN-Bus zeilen */
.crow {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.crow:last-child { border-bottom: none; }
.cl { color: var(--text2); }
.cv { font-family: var(--font-mono); font-weight: 600; color: var(--text1); }

/* ── Tour Timeline ─────────────────────────────────── */
.ts {
  display: flex; gap: 12px;
  padding: 8px 0;
  position: relative;
  align-items: flex-start;
}
.ts:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 11px; top: 30px; bottom: -4px;
  width: 2px;
  background: var(--border);
}
.td {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg1);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
  z-index: 1;
}
.td.done { border-color: var(--green); color: var(--green); background: var(--green-d); }
.td.now  {
  border-color: var(--hh-blue); color: var(--hh-blue); background: var(--hh-blue-50);
  box-shadow: 0 0 0 4px rgba(27, 79, 158, .12);
}
.td.wait { border-color: var(--text3); color: var(--text3); }
.ti { flex: 1; min-width: 0; }
.tl { font-size: 12.5px; font-weight: 600; color: var(--text1); }
.tt { font-size: 11px; color: var(--text3); margin-top: 2px; }
.ttm {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--text2);
  flex-shrink: 0;
  align-self: center;
}

/* ── Alert items ───────────────────────────────────── */
.ai {
  display: flex; gap: 10px;
  padding: 10px;
  background: var(--bg1);
  border-radius: var(--r-2);
  margin-bottom: 5px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  align-items: flex-start;
}
.aico {
  width: 28px; height: 28px;
  border-radius: var(--r-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.aico.w { background: var(--orange-d); color: var(--orange); }
.ai:has(.aico.w) { border-left-color: var(--orange); }
.aico.d { background: var(--red-d); color: var(--red); }
.ai:has(.aico.d) { border-left-color: var(--red); }
.aico.i { background: var(--blue-d); color: var(--blue); }
.ai:has(.aico.i) { border-left-color: var(--blue); }
.atx { font-size: 12px; color: var(--text2); line-height: 1.4; }
.atx strong { color: var(--text1); font-weight: 600; }
.atm { font-size: 10px; color: var(--text3); font-family: var(--font-mono); margin-top: 4px; }

/* ── Route Tab – Filter & Trip List ─────────────────── */
.route-filter { display: flex; flex-direction: column; gap: 8px; }
.rf-row { display: flex; align-items: center; gap: 10px; }
.rf-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  width: 32px;
  flex-shrink: 0;
}
.rf-btn {
  margin-top: 4px;
  padding: 9px 0;
  background: var(--hh-blue);
  color: #fff;
  border-radius: var(--r-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.rf-btn:hover { background: var(--hh-blue-600); }

.trip-list { display: flex; flex-direction: column; gap: 4px; }
.trip-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s;
}
.trip-item:hover { background: var(--bg3); }
.trip-item.active {
  background: var(--hh-blue-50);
  border-color: rgba(27, 79, 158, .35);
}
.trip-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.trip-info { flex: 1; min-width: 0; }
.trip-time { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--text1); }
.trip-stats { font-size: 10.5px; color: var(--text3); margin-top: 2px; }
.trip-extra { font-family: var(--font-mono); font-size: 10px; color: var(--text3); flex-shrink: 0; }

/* Replay controls */
.replay-controls { display: flex; flex-direction: column; gap: 10px; }
.replay-btns { display: flex; align-items: center; gap: 4px; }
.replay-btn {
  width: 36px; height: 32px;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
  background: var(--bg1);
  color: var(--text1);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.replay-btn:hover { background: var(--bg3); border-color: var(--border-strong); }
.speed-btns { display: flex; gap: 2px; margin-left: auto; }
.speed-btn {
  padding: 6px 10px;
  border-radius: var(--r-2);
  background: transparent;
  color: var(--text3);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: background .15s, color .15s;
}
.speed-btn:hover { color: var(--text1); }
.speed-btn.on { color: #fff; background: var(--hh-blue); }
.replay-slider {
  width: 100%; height: 6px;
  -webkit-appearance: none; appearance: none;
  background: rgba(15, 23, 42, .08);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
.replay-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--hh-blue);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(27, 79, 158, .35);
  cursor: pointer;
}
.replay-info {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text2);
}

.replay-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--hh-blue);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--hh-blue), 0 0 14px rgba(27, 79, 158, .55);
}

/* Route tooltip overrides for Leaflet */
.route-tooltip {
  font: 10px var(--font-mono) !important;
  background: rgba(255,255,255, .96) !important;
  color: var(--text1) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--r-1) !important;
  padding: 3px 7px !important;
  box-shadow: var(--shadow-sm) !important;
}
.geofence-label {
  font: 9px var(--font-mono) !important;
  color: var(--hh-blue) !important;
  background: rgba(255,255,255,.85) !important;
  border: 1px solid rgba(27, 79, 158, .15) !important;
  padding: 1px 5px !important;
  border-radius: 3px !important;
  box-shadow: var(--shadow-sm) !important;
}

/* ── Destination Picker ────────────────────────────── */
.dest-panel { display: flex; flex-direction: column; gap: 8px; }
.dest-input-wrap { position: relative; }
.dest-suggest {
  display: none;
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.dest-suggest-item {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.dest-suggest-item:last-child { border-bottom: none; }
.dest-suggest-item:hover { background: var(--bg3); color: var(--text1); }
.dest-btn {
  padding: 7px 12px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  color: var(--text2);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.dest-btn:hover { background: var(--bg3); color: var(--text1); border-color: var(--border-strong); }
.dest-btn-route {
  width: 100%;
  background: var(--hh-blue);
  color: #fff;
  border-color: var(--hh-blue);
}
.dest-btn-route:hover { background: var(--hh-blue-600); border-color: var(--hh-blue-600); color: #fff; }

/* ── Destination Pin (Map) ─────────────────────────── */
.dest-pin {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
}
.dest-pin-head {
  width: 18px; height: 18px;
  border-radius: 50% 50% 50% 0;
  background: var(--hh-red);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(220, 31, 38, .4);
  transform: rotate(-45deg);
}
.dest-pin-label {
  position: absolute;
  top: 100%;
  margin-top: 6px;
  background: #fff;
  border: 1px solid var(--border-strong);
  padding: 2px 7px;
  border-radius: var(--r-1);
  font: 700 10px var(--font-mono);
  color: var(--text1);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

/* ── Custom Vehicle Markers (Map) ──────────────────── */
.vehicle-marker { position: relative; cursor: pointer; }
.vehicle-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .25), 0 0 0 1px rgba(15, 23, 42, .08);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff;
}
.vehicle-dot.sel {
  width: 28px; height: 28px;
  border-width: 3px;
  box-shadow: 0 0 0 4px rgba(27, 79, 158, .25), 0 4px 12px rgba(15, 23, 42, .35);
}
.vehicle-label {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--border-strong);
  padding: 2px 6px;
  border-radius: var(--r-1);
  font: 700 10px var(--font-mono);
  color: var(--text1);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  letter-spacing: -.01em;
}
.vehicle-arrow {
  position: absolute;
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 11px solid currentColor;
  filter: drop-shadow(0 1px 1px rgba(15, 23, 42, .25));
}

/* Pulsing for stoerung */
@keyframes markerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 31, 38, .55), 0 2px 6px rgba(15, 23, 42, .25); }
  50%      { box-shadow: 0 0 0 12px rgba(220, 31, 38, 0), 0 2px 6px rgba(15, 23, 42, .25); }
}
.vehicle-dot.pulse { animation: markerPulse 2s infinite; }

/* Trail polyline (subtler in light mode) */
.leaflet-overlay-pane svg path.trail { stroke-opacity: .4; }

/* ── Font Awesome Integration ───────────────────────── */
.fa-solid, .fa-regular, .fa-brands { vertical-align: -0.05em; }

/* Topbar action icons */
.tb-icon i { font-size: 16px; line-height: 1; }
#logoutBtn i { font-size: 14px; }

/* Map controls */
.zbtn i, .map-tool-btn i { font-size: 14px; }

/* HUD chips */
.chip i { font-size: 13px; color: var(--text2); margin-right: 2px; }

/* Vehicle card meta line */
.vc-meta i { font-size: 11px; opacity: .85; margin-right: 3px; color: var(--text3); }
.vc-id i { font-size: 11px; margin-left: 4px; }
.vc-eta i { font-size: 10px; margin-right: 3px; }

/* Tour-stop pip glyph */
.td i { font-size: 11px; line-height: 1; }

/* Alert icon container */
.aico i { font-size: 13px; }

/* Data-tile values that include an icon prefix */
.dv i { font-size: 12px; vertical-align: -0.08em; margin-right: 4px; }

/* CAN-row values */
.crow .cv i { font-size: 11px; margin-right: 4px; vertical-align: -0.05em; }

/* Login feature pills */
.login-feat-icon i { font-size: 14px; color: rgba(255, 255, 255, .95); }

/* Login submit chevron */
.login-submit i { margin-left: 8px; transition: transform .2s; font-size: 12px; }
.login-submit:hover i { transform: translateX(3px); }

/* Empty-state arrow */
.empty .arrow i { font-size: 22px; color: var(--hh-blue); }

/* Inline status dot helper (used wherever 🟢/⚫/🟡/🔴 emojis lived) */
.dot-inline {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  vertical-align: 1px;
  margin-right: 5px;
}

/* Notification list icon size */
.notif-item i { font-size: 13px; color: var(--text2); }

/* ── Auftrags-Timeline (Tab Aufträge) ──────────────── */
.order-card {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.order-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }

.order-card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.order-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text1);
  letter-spacing: -.01em;
}

.order-timeline {
  display: flex; flex-direction: column;
  gap: 0;
  margin-bottom: 12px;
}
.ot-step {
  display: flex; align-items: flex-start; gap: 10px;
}
.ot-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
}
.ot-dot-vehicle  { background: var(--text2); }
.ot-dot-pickup   { background: var(--hh-blue); box-shadow: 0 0 0 1px var(--hh-blue); }
.ot-dot-delivery { background: var(--orange);  box-shadow: 0 0 0 1px var(--orange); }

.ot-info { flex: 1; min-width: 0; padding-top: 2px; }
.ot-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 2px;
}
.ot-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text2);
}
.ot-addr {
  font-size: 12px;
  color: var(--text1);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 2px;
  overflow-wrap: break-word;
}
.ot-eta {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}
.ot-eta .muted { color: var(--text3); }
.ot-eta-time {
  font-family: var(--font-mono);
  color: var(--text2);
}
.ot-eta-time b {
  color: var(--text1);
  font-weight: 700;
}
.ot-eta-time.now {
  color: var(--green);
  font-weight: 700;
}
.ot-eta-time.now b { color: var(--green); }

.ot-leg {
  display: flex; align-items: center; gap: 10px;
  margin-left: 12px;
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text3);
  min-height: 24px;
}
.ot-leg-line {
  width: 2px;
  flex-shrink: 0;
  align-self: stretch;
  margin: -2px 11px -2px 0;
}
.ot-leg-pickup   { background: var(--hh-blue); }
.ot-leg-delivery { background: var(--orange); background-image: linear-gradient(var(--orange) 50%, transparent 50%); background-size: 2px 8px; }
.ot-leg-text {
  display: inline-flex; align-items: center; gap: 6px;
}

.order-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.order-foot-stats {
  display: flex; gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text2);
}
.order-foot-stats span { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); }
.order-foot-stats .warn { color: var(--orange); }
.order-route-btn {
  width: auto !important;
  font-size: 11px !important;
  padding: 6px 12px !important;
  flex-shrink: 0;
  white-space: nowrap;
}
.order-notes {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--bg3);
  border-radius: var(--r-2);
  font-size: 11px;
  color: var(--text2);
}
.order-notes i { margin-right: 6px; color: var(--text3); }

/* ── Aktiver Auftrag im Live-Tab ───────────────────── */
.active-order {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: 12px;
}
.active-order-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}

.aoc-row {
  display: flex; gap: 10px;
  align-items: flex-start;
}
.aoc-row .ot-dot { margin-top: 2px; }

.aoc-info { flex: 1; min-width: 0; }
.aoc-label {
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--text3);
  margin-bottom: 4px;
}
.aoc-addr {
  font-size: 12.5px;
  color: var(--text1);
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
  word-break: break-word;
}
.aoc-stats {
  display: flex; flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: var(--text2);
  font-family: var(--font-mono);
}
.aoc-stats span { display: inline-flex; align-items: center; gap: 5px; }
.aoc-stats .warn { color: var(--orange); }
.hgv-hint, .aoc-stats .hgv-hint, .order-foot-stats .hgv-hint {
  background: var(--green-d); color: var(--green);
  padding: 1px 8px; border-radius: 999px;
  font-weight: 700; font-size: 10.5px;
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-ui);
}
.hgv-hint i { color: var(--green); }
.aoc-eta-time {
  background: var(--green-d);
  color: var(--green);
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 700;
}
.aoc-eta-time b { color: var(--green); font-weight: 700; }

.aon-follow {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.aon-label {
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--text3);
  margin-bottom: 4px;
}
.aon-row {
  display: flex; align-items: center; gap: 4px;
  font-size: 11.5px;
  color: var(--text2);
  flex-wrap: wrap;
}
.aon-addr { flex: 1; min-width: 0; color: var(--text1); }
.aon-eta {
  font-family: var(--font-mono);
  color: var(--text2);
  white-space: nowrap;
}
.aon-eta b { color: var(--text1); font-weight: 700; }

.active-order-actions {
  display: flex; gap: 6px;
  margin-top: 10px;
}
.active-order-actions .dest-btn {
  font-size: 11px;
  padding: 6px 10px;
}
.active-order-actions .dest-btn-route { flex: 1; }

/* ── Order-Pins auf der Karte (Pickup/Delivery) ─────── */
.order-pin {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
}
.order-pin-head {
  width: 26px; height: 26px;
  border-radius: 50% 50% 50% 0;
  background: var(--c, var(--hh-blue));
  border: 2px solid #fff;
  transform: rotate(-45deg);
  box-shadow: 0 3px 10px rgba(15, 23, 42, .3);
  display: flex; align-items: center; justify-content: center;
}
.order-pin-head i {
  transform: rotate(45deg);
  color: #fff;
  font-size: 11px;
}
.order-pin-label {
  position: absolute;
  top: 100%;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--border-strong);
  padding: 2px 7px;
  border-radius: var(--r-1);
  font: 700 10px var(--font-mono);
  color: var(--text1);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

/* ── Routing-Profil-Hinweis (Dispatch-Modal) ──────────── */
.routing-info {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-2);
  font-size: 11.5px;
  margin-bottom: 14px;
}
.routing-info code {
  background: rgba(0,0,0,.05);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.routing-info.hgv {
  background: var(--green-d);
  color: var(--green);
  border: 1px solid rgba(22,163,74,.25);
}
.routing-info.hgv i { color: var(--green); }
.routing-info.car {
  background: var(--orange-d);
  color: var(--orange);
  border: 1px solid rgba(234,88,12,.25);
}
.routing-info.car i { color: var(--orange); }

/* ── Smart-Dispatch Modal ──────────────────────────── */
.dispatch-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.dispatch-search {
  display: flex; gap: 8px; align-items: flex-end;
}
.dispatch-search > .label { display: block; margin-bottom: 6px; }
.dispatch-input-wrap {
  flex: 1;
  position: relative;
}
.dispatch-input-wrap label { display: block; }
.dispatch-input-wrap .search { font-size: 14px; padding: 11px 14px; }
.dispatch-input-wrap .dest-suggest {
  top: calc(100% + 4px);
  max-height: 240px;
}

.dispatch-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.dispatch-mode-tab {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg1);
  border: 1.5px solid var(--border);
  border-radius: var(--r-2);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .04s;
  font-family: inherit;
  color: var(--text1);
}
.dispatch-mode-tab i { font-size: 20px; color: var(--text3); flex-shrink: 0; }
.dispatch-mode-tab:hover { background: var(--bg3); border-color: var(--border-strong); }
.dispatch-mode-tab.on {
  background: var(--hh-blue-50);
  border-color: var(--hh-blue);
}
.dispatch-mode-tab.on i { color: var(--hh-blue); }
.dispatch-mode-tab .dm-title { font-weight: 700; font-size: 13px; color: var(--text1); }
.dispatch-mode-tab .dm-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }

.dispatch-target {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--hh-blue-50);
  border: 1px solid rgba(27, 79, 158, .3);
  border-radius: var(--r-2);
  margin-top: 14px;
  font-size: 13px;
  color: var(--text1);
}
.dispatch-target i { color: var(--hh-blue); font-size: 14px; }
.dispatch-target span { flex: 1; }
.dispatch-target .dest-btn { padding: 5px 10px; font-size: 11px; }

.dispatch-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 0 4px;
}

.dispatch-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

/* Sektionen (eligible / unavailable) */
.dispatch-section { margin-bottom: 22px; }
.dispatch-section-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 10px;
}
.dispatch-section-head.warn { color: var(--orange); }
.dispatch-count {
  background: var(--bg3);
  color: var(--text2);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 4px;
}

/* Tabelle (CSS-Grid statt <table>) */
.dispatch-table {
  display: flex; flex-direction: column;
  gap: 4px;
}
.dispatch-row {
  display: grid;
  grid-template-columns: 50px 2fr 110px 90px 80px 70px 1fr 160px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .08s;
}
.dispatch-row:hover {
  background: var(--bg3);
  border-color: var(--border-strong);
}
.dispatch-row.dispatch-row-head {
  background: transparent;
  border: none;
  padding: 4px 12px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  cursor: default;
}
.dispatch-row.dispatch-row-head:hover { background: transparent; }
.dispatch-row.dispatch-row-unavail {
  opacity: .7;
  background: var(--bg3);
}

.dispatch-rank {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--text2);
}
.dispatch-rank.rank-1 { background: var(--hh-blue); color: #fff; border-color: var(--hh-blue); box-shadow: 0 2px 8px rgba(27, 79, 158, .35); }
.dispatch-rank.rank-2 { background: var(--green-d); color: var(--green); border-color: var(--green); }
.dispatch-rank.rank-3 { background: var(--yellow-d); color: var(--yellow); border-color: var(--yellow); }
.dispatch-rank.rank-blocked { background: var(--red-d); color: var(--red); border-color: var(--red); font-size: 12px; }

.dispatch-plate {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--text1);
  display: flex; align-items: center;
}
.dispatch-driver {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

.dispatch-num {
  font-family: var(--font-mono);
  text-align: right;
  font-size: 11px;
  color: var(--text2);
}
.dispatch-num b {
  color: var(--text1);
  font-size: 13px;
  font-weight: 700;
}

.dispatch-score {
  display: flex; align-items: center; gap: 6px;
  min-width: 100px;
}
.dispatch-score-bar {
  flex: 1;
  height: 6px;
  background: var(--bg4);
  border-radius: 3px;
  overflow: hidden;
}
.dispatch-score-bar > div {
  height: 100%;
  border-radius: 3px;
  transition: width .3s ease;
}
.dispatch-score-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  color: var(--text1);
  min-width: 32px;
  text-align: right;
}

.dispatch-actions {
  display: flex; gap: 4px; justify-content: flex-end;
}
.dispatch-actions .dest-btn {
  padding: 6px 9px;
  font-size: 11px;
}
.dispatch-actions .dest-btn-route {
  padding: 6px 12px;
}

@media (max-width: 1024px) {
  .dispatch-row {
    grid-template-columns: 40px 1.5fr 80px 70px 70px 60px;
    gap: 6px;
    font-size: 11.5px;
  }
  /* Auf Tablet die Score- und Aktionen-Spalten unter die Zeile rutschen lassen */
  .dispatch-row .dispatch-score,
  .dispatch-row .dispatch-actions {
    grid-column: 1 / -1;
    justify-self: stretch;
    margin-top: 6px;
    border-top: 1px dashed var(--border);
    padding-top: 8px;
  }
  .dispatch-row.dispatch-row-head .dispatch-score,
  .dispatch-row.dispatch-row-head .dispatch-actions { display: none; }
}
@media (max-width: 768px) {
  .dispatch-modes { grid-template-columns: 1fr; }
  .dispatch-search { flex-direction: column; align-items: stretch; }
  .dispatch-row {
    grid-template-columns: 36px 1fr 80px;
    font-size: 11px;
  }
  .dispatch-row > div:nth-child(4),
  .dispatch-row > div:nth-child(5),
  .dispatch-row > div:nth-child(6) {
    grid-column: 1 / -1;
    display: flex; gap: 14px;
    font-size: 11px;
    border-top: 1px dashed var(--border);
    padding-top: 6px; margin-top: 4px;
    text-align: left;
  }
}
