/* ==========================================================================
   TruckDesk – Webpanel im Stil von tiatransport.de
   ========================================================================== */

:root {
  --bg: #05030d;
  --bg-2: var(--bg-2);
  --surface: #0e0a1a;
  --surface-2: #141024;
  --surface-3: #1b1630;
  --line: rgba(var(--fg-rgb), 0.07);
  --line-2: rgba(var(--fg-rgb), 0.12);
  --line-accent: rgba(var(--accent2-rgb), 0.28);

  --text: #f4f2fa;
  --text-2: #c9c4da;
  --muted: #9690ad;
  --dim: #6c6685;

  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --accent-3: #c4b5fd;
  --accent-ink: #e9e3ff;
  --glow: rgba(var(--accent-rgb), 0.35);

  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --info: #60a5fa;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.8);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: var(--font);
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;

  --wrap: 1240px;
  --header-h: 68px;

  --fg-rgb: 255, 255, 255;
  --accent-rgb: 139, 92, 246;
  --accent2-rgb: 167, 139, 250;
  --accent-deep: #6d28d9;
  --ok-ink: #a7f3d0;
  --warn-ink: #fde68a;
  --bad-ink: #fecaca;
  --info-ink: #bfdbfe;
  --header-bg: rgba(5, 3, 13, 0.72);
  --popover-bg: rgba(20, 16, 36, 0.97);
  --backdrop: rgba(3, 2, 8, 0.7);
  --track: rgba(255, 255, 255, 0.07);
  --base-size: 16px;
  color-scheme: dark;
}

/* ---------- Helles Design ---------- */
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f5f4f9;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f6fb;
  --surface-3: #ecebf3;
  --line: rgba(20, 16, 40, 0.09);
  --line-2: rgba(20, 16, 40, 0.15);
  --line-accent: rgba(var(--accent-rgb), 0.35);
  --text: #16131f;
  --text-2: #3b3650;
  --muted: #625c78;
  --dim: #8a85a0;
  --accent-ink: #2e1065;
  --accent-3: var(--accent-deep);
  --glow: rgba(var(--accent-rgb), 0.18);
  --fg-rgb: 20, 16, 40;
  --ok-ink: #047857;
  --warn-ink: #92400e;
  --bad-ink: #b91c1c;
  --info-ink: #1d4ed8;
  --header-bg: rgba(255, 255, 255, 0.85);
  --popover-bg: rgba(255, 255, 255, 0.98);
  --backdrop: rgba(20, 16, 40, 0.35);
  --track: rgba(20, 16, 40, 0.1);
  --shadow: 0 18px 50px -28px rgba(20, 16, 40, 0.35);
}

:root[data-theme='light'] .bg-glow {
  opacity: 0.35;
}

/* Karte bleibt dunkel (wie ein Navi) */
:root[data-theme='light'] .map-card {
  background: #0b0816;
  --text: #f4f2fa;
  --muted: #9690ad;
  --fg-rgb: 255, 255, 255;
  color: #f4f2fa;
}

/* ---------- Akzentfarben ---------- */
:root[data-accent='blue'] {
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --accent-3: #93c5fd;
  --accent-rgb: 59, 130, 246;
  --accent2-rgb: 96, 165, 250;
  --accent-deep: #1d4ed8;
}
:root[data-accent='green'] {
  --accent: #10b981;
  --accent-2: #34d399;
  --accent-3: #6ee7b7;
  --accent-rgb: 16, 185, 129;
  --accent2-rgb: 52, 211, 153;
  --accent-deep: #047857;
}
:root[data-accent='orange'] {
  --accent: #f97316;
  --accent-2: #fb923c;
  --accent-3: #fdba74;
  --accent-rgb: 249, 115, 22;
  --accent2-rgb: 251, 146, 60;
  --accent-deep: #c2410c;
}
:root[data-accent='red'] {
  --accent: #ef4444;
  --accent-2: #f87171;
  --accent-3: #fca5a5;
  --accent-rgb: 239, 68, 68;
  --accent2-rgb: 248, 113, 113;
  --accent-deep: #b91c1c;
}
:root[data-theme='light'][data-accent] {
  --accent-3: var(--accent-deep);
}

/* ---------- Größe, Dichte, Bewegung ---------- */
:root[data-size='large'] body {
  zoom: 1.12;
}
:root[data-size='small'] body {
  zoom: 0.92;
}
:root[data-motion='reduce'] *,
:root[data-motion='reduce'] *::before,
:root[data-motion='reduce'] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
:root[data-density='compact'] .card {
  padding: 16px;
}
:root[data-density='compact'] .view {
  padding-top: 24px;
}
:root[data-density='compact'] .grid {
  gap: 12px;
}
:root[data-density='compact'] .kpi {
  padding: 14px 16px;
}
:root[data-density='compact'] .section-head {
  margin-bottom: 14px;
}
:root[data-contrast='high'] {
  --muted: var(--text-2);
  --dim: var(--muted);
  --line: rgba(var(--fg-rgb), 0.2);
  --line-2: rgba(var(--fg-rgb), 0.3);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Fallback: Icons ohne eigene Größe nicht auf 300×150 aufblasen */
:where(svg[aria-hidden='true']) {
  width: 1em;
  height: 1em;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(var(--accent-rgb), 0.45);
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(var(--accent-rgb), 0.22), transparent 60%),
    radial-gradient(700px 420px at 95% 5%, rgba(var(--accent2-rgb), 0.12), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(var(--accent-rgb), 0.18), transparent 60%);
}

.num,
.tabular {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--mono);
}

.muted {
  color: var(--muted);
}

.dim {
  color: var(--dim);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------------------------------------------------
   Kopfzeile
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.topbar .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.28), var(--surface-2));
  border: 1px solid var(--line-accent);
  box-shadow: 0 0 24px -6px var(--glow);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-text b {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-text span {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.nav a {
  position: relative;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--text);
  background: rgba(var(--fg-rgb), 0.04);
}

.nav a.active {
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.14);
  box-shadow: inset 0 0 0 1px var(--line-accent);
}

.nav .nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 99px;
  font-size: 11px;
  background: var(--warn);
  color: #1a1305;
  vertical-align: 1px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

.live-pill:hover {
  border-color: var(--line-accent);
  color: var(--text);
}

.user-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 6px 0 4px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  cursor: pointer;
}

.user-btn:hover {
  border-color: var(--line-accent);
}

.user-btn .avatar {
  width: 30px;
  height: 30px;
}

.user-btn .user-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu {
  position: absolute;
  top: calc(var(--header-h) - 6px);
  right: 24px;
  min-width: 220px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: none;
}

.menu.open {
  display: block;
  animation: pop 0.14s ease-out;
}

.menu a,
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: none;
  font-size: 14px;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
}

.menu a:hover,
.menu button:hover {
  background: rgba(var(--fg-rgb), 0.05);
  color: var(--text);
}

.menu svg {
  width: 16px;
  height: 16px;
  opacity: 0.8;
}

.menu hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 6px 4px;
}

.burger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: transparent;
  cursor: pointer;
  place-items: center;
}

.burger svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 1080px) {
  .burger {
    display: grid;
  }
  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px 16px 20px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7);
    transform: translateY(-120%);
    transition: transform 0.22s ease;
  }
  .nav.open {
    transform: translateY(0);
  }
  .nav a {
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 12px;
  }
  .live-pill .live-text {
    display: none;
  }
  .user-btn .user-name {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Grundlayout
   -------------------------------------------------------------------------- */

.view {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 40px 0 80px;
  outline: none;
}

.page-enter {
  animation: pageIn 0.16s ease-out both;
}
@keyframes pageIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.view { position: relative; }
.page-pending { position: absolute; left: 0; right: 0; top: 0; visibility: hidden; pointer-events: none; }

.section {
  margin-top: 64px;
}

.section:first-child {
  margin-top: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow b {
  color: var(--accent-2);
  font-family: var(--mono);
  letter-spacing: 0.06em;
}

.eyebrow::after {
  content: '';
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, var(--line-accent), transparent);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 750;
}

h2 {
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 700;
}

h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

h1 em,
h2 em,
h3 em {
  font-style: normal;
  color: var(--accent-3);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.section-head .titles {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-head p {
  margin: 0;
  max-width: 560px;
  color: var(--muted);
}

.lead {
  font-size: 17px;
  color: var(--text-2);
  max-width: 640px;
  margin: 18px 0 0;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-main {
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
}

@media (max-width: 980px) {
  .grid-3,
  .grid-main {
    grid-template-columns: minmax(0, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 0 16px;
  }
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .view {
    padding-top: 28px;
  }
}

/* --------------------------------------------------------------------------
   Karten
   -------------------------------------------------------------------------- */

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(var(--fg-rgb), 0.035), rgba(var(--fg-rgb), 0.012));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  min-width: 0;
}

.card.pad-0 {
  padding: 0;
  overflow: hidden;
}

.card.glow {
  border-color: var(--line-accent);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.06), 0 30px 80px -40px rgba(var(--accent-rgb), 0.55);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-head h3 svg,
h3 svg {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  margin-right: 4px;
}

.card-head .sub {
  font-size: 13px;
  color: var(--muted);
}

.card-head a.more {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-head a.more:hover {
  color: var(--accent-3);
}

.card-head a.more svg {
  width: 14px;
  height: 14px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.kpi {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  padding: 22px 22px 20px;
  min-width: 0;
}

.kpi .label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi .value {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kpi .value small {
  font-size: 0.5em;
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
  letter-spacing: 0;
}

.kpi .sub {
  font-size: 13px;
  color: var(--dim);
  margin-top: 2px;
}

@media (max-width: 760px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   Buttons, Tabs, Formulare
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(var(--fg-rgb), 0.03);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn:hover {
  border-color: var(--line-accent);
  background: rgba(var(--accent-rgb), 0.08);
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn.primary {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: var(--on-accent, #fff);
  box-shadow: 0 10px 30px -10px rgba(var(--accent-rgb), 0.8), inset 0 1px 0 rgba(var(--fg-rgb), 0.2);
}

.btn.primary:hover {
  box-shadow: 0 12px 36px -8px rgba(var(--accent-rgb), 0.95), inset 0 1px 0 rgba(var(--fg-rgb), 0.25);
}

.btn.discord {
  border: 0;
  background: #5865f2;
  color: white;
}

.btn.discord:hover {
  background: #4752c4;
}

.btn.danger:hover {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.1);
  color: var(--bad-ink);
}

.btn.ok:hover {
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(52, 211, 153, 0.1);
  color: var(--ok-ink);
}

.btn.sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.btn.lg {
  height: 48px;
  padding: 0 24px;
  font-size: 15px;
}

.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.tabs {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: rgba(var(--fg-rgb), 0.03);
  border: 1px solid var(--line);
  flex-wrap: wrap;
}

.tabs button {
  height: 34px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.tabs button:hover {
  color: var(--text);
}

.tabs button.active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-accent), 0 4px 16px -8px var(--glow);
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}

.chip.active {
  border-color: var(--line-accent);
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--text);
}

.chip .count {
  color: var(--dim);
  font-weight: 600;
}

.input,
.select {
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(var(--fg-rgb), 0.03);
  outline: none;
  min-width: 0;
}

.input:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}

.select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239690ad' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.select option {
  background: var(--surface-2);
  color: var(--text);
}

.select:hover:not(:disabled),
.input:hover:not(:disabled):not(:focus) {
  border-color: rgba(var(--fg-rgb), 0.22);
}

.select:disabled,
.input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Eigene Auswahlliste (js/dropdown.js) */
.dd-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.dd-btn {
  display: inline-flex;
  align-items: center;
  text-align: left;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.field .dd-btn {
  display: flex;
}

.dd-btn .dd-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dd-btn.placeholder .dd-text {
  color: var(--muted);
}

.dd-btn.open,
.dd-btn:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
  outline: none;
}

.dd-btn.open {
  background-color: rgba(var(--accent-rgb), 0.06);
}

.dd-btn.invalid {
  border-color: var(--danger, #ef4444);
}

.dd-pop {
  position: fixed;
  z-index: 140;
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  outline: none;
  animation: dd-in 0.12s ease-out;
}

.dd-pop.up {
  animation-name: dd-in-up;
}

@keyframes dd-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@keyframes dd-in-up {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.dd-search {
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.dd-q {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: rgba(var(--fg-rgb), 0.04);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.dd-q:focus {
  border-color: var(--accent);
}

.dd-list {
  overflow-y: auto;
  padding: 5px;
  overscroll-behavior: contain;
}

.dd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 6px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.dd-item[hidden],
.dd-group[hidden] {
  display: none;
}

.dd-item.muted {
  color: var(--muted);
}

.dd-item.active {
  background: rgba(var(--accent-rgb), 0.14);
}

.dd-item.selected {
  font-weight: 600;
}

.dd-item.disabled {
  opacity: 0.45;
  cursor: default;
}

.dd-check {
  display: inline-flex;
  flex: none;
  width: 16px;
  justify-content: center;
  color: var(--accent);
}

.dd-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dd-group {
  padding: 10px 10px 4px 30px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.dd-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 18px;
}

.toolbar .spacer {
  flex: 1;
}

/* --------------------------------------------------------------------------
   Avatare, Status, Pillen
   -------------------------------------------------------------------------- */

.avatar {
  --size: 40px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  font-size: calc(var(--size) * 0.38);
  font-weight: 750;
  color: white;
  letter-spacing: 0;
  position: relative;
}

.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.avatar-wrap .dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  box-shadow: 0 0 0 3px var(--bg-2);
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dim);
  flex-shrink: 0;
}

.dot.driving {
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2s infinite;
}

.dot.online {
  background: var(--warn);
}

.dot.offline {
  background: #4b4563;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 650;
  background: rgba(var(--fg-rgb), 0.05);
  border: 1px solid var(--line);
  color: var(--text-2);
  white-space: nowrap;
}

.pill svg {
  width: 13px;
  height: 13px;
}

.pill.accent {
  background: rgba(var(--accent-rgb), 0.14);
  border-color: var(--line-accent);
  color: var(--accent-ink);
}

.pill.ok {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--ok-ink);
}

.pill.warn {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.3);
  color: var(--warn-ink);
}

.pill.bad {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--bad-ink);
}

.rank-pill {
  border-color: color-mix(in srgb, var(--rank) 45%, transparent);
  background: color-mix(in srgb, var(--rank) 14%, transparent);
  color: color-mix(in srgb, var(--rank) 40%, white);
}

/* --------------------------------------------------------------------------
   Startseite / Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: 24px 0 8px;
}

.hero .tagline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  border-radius: 99px;
  border: 1px solid var(--line-accent);
  background: rgba(var(--accent-rgb), 0.08);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-ink);
  margin-bottom: 22px;
}

.hero .tagline .pill {
  height: 22px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.hero .kpis {
  margin-top: 44px;
}

/* --------------------------------------------------------------------------
   Listen: Aufträge
   -------------------------------------------------------------------------- */

.job-list {
  display: flex;
  flex-direction: column;
}

.job {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 4px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.12s;
}

.job:first-child {
  border-top: 0;
}

.job:hover {
  background: rgba(var(--fg-rgb), 0.025);
}

.job.new {
  animation: flash 1.6s ease;
}

.job-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent-2);
}

.job-icon svg {
  width: 18px;
  height: 18px;
}

.job-icon.delivered {
  background: rgba(52, 211, 153, 0.12);
  color: var(--ok);
}

.job-icon.cancelled,
.job-icon.rejected {
  background: rgba(var(--fg-rgb), 0.05);
  color: var(--dim);
}

.job-icon.active {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent-2);
}

.job-main {
  min-width: 0;
}

.job-route {
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-route .arrow {
  color: var(--dim);
  margin: 0 6px;
}

.job-meta {
  display: flex;
  align-items: center;
  gap: 6px 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.job-meta .driver {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
}

.job-meta .driver .avatar {
  --size: 18px;
}

.job-side {
  text-align: right;
  white-space: nowrap;
}

.job-side .km {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.job-side .when {
  font-size: 12.5px;
  color: var(--dim);
}

.job.cancelled .job-route,
.job.rejected .job-route,
.job.cancelled .km,
.job.rejected .km {
  text-decoration: line-through;
  text-decoration-color: rgba(var(--fg-rgb), 0.35);
  color: var(--dim);
}

.job.cancelled .job-meta,
.job.rejected .job-meta {
  opacity: 0.7;
}

@media (max-width: 560px) {
  .job {
    grid-template-columns: 32px minmax(0, 1fr);
  }
  .job-side {
    grid-column: 2;
    text-align: left;
    display: flex;
    gap: 10px;
    align-items: baseline;
  }
}

/* --------------------------------------------------------------------------
   Rangliste
   -------------------------------------------------------------------------- */

.podium {
  display: grid;
  grid-template-columns: 1fr 1.12fr 1fr;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.podium-place {
  text-align: center;
  padding: 22px 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(var(--fg-rgb), 0.04), rgba(var(--fg-rgb), 0.01));
  cursor: pointer;
  min-width: 0;
}

.podium-place:hover {
  border-color: var(--line-accent);
}

.podium-place .avatar {
  --size: 64px;
  margin: 0 auto 12px;
}

.podium-place.p1 {
  padding-top: 30px;
  border-color: rgba(250, 204, 21, 0.35);
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.1), rgba(var(--fg-rgb), 0.01));
}

.podium-place.p1 .avatar {
  --size: 78px;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.5), 0 0 40px -6px rgba(250, 204, 21, 0.5);
}

.podium-place.p2 .avatar {
  box-shadow: 0 0 0 3px rgba(203, 213, 225, 0.45);
}

.podium-place.p3 .avatar {
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.5);
}

.podium-place .medal {
  font-size: 26px;
  line-height: 1;
  margin-bottom: 10px;
}

.podium-place .name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium-place .km {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.podium-place .jobs {
  font-size: 13px;
  color: var(--muted);
}

.board {
  display: flex;
  flex-direction: column;
}

.board-row {
  display: grid;
  grid-template-columns: 40px 40px minmax(0, 1fr) 90px 110px;
  align-items: center;
  gap: 12px;
  padding: 11px 6px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  border-radius: 10px;
}

.board-row:hover {
  background: rgba(var(--fg-rgb), 0.025);
}

.board-row:first-child {
  border-top: 0;
}

.board-row .pos {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--dim);
  text-align: center;
}

.board-row .name {
  font-weight: 650;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.board-row .name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-row .jobs {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.board-row .km {
  font-weight: 750;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.board-row .bar {
  grid-column: 3 / -1;
  height: 3px;
  border-radius: 3px;
  background: rgba(var(--fg-rgb), 0.05);
  margin-top: -4px;
  overflow: hidden;
}

.board-row .bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.board-row.me {
  background: rgba(var(--accent-rgb), 0.08);
}

@media (max-width: 560px) {
  .board-row {
    grid-template-columns: 30px 34px minmax(0, 1fr) 84px;
  }
  .board-row .jobs {
    display: none;
  }
  .podium {
    grid-template-columns: 1fr;
  }
  .podium-place.p1 {
    order: -1;
  }
}

.reset-box {
  display: flex;
  align-items: center;
  gap: 18px;
}

.reset-box .big {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(160deg, white, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(var(--fg-rgb), 0.025);
  border: 1px solid var(--line);
  min-width: 0;
}

.stat .v {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat .l {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.records {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.record {
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.025);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.record .label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.record .value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.record .value small {
  font-size: 15px;
  color: var(--muted);
  font-weight: 600;
  margin-left: 4px;
}

.record .who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  min-width: 0;
}

.record .who .avatar {
  --size: 24px;
}

.record .who span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winners {
  display: flex;
  flex-direction: column;
}

.winner {
  display: grid;
  grid-template-columns: 110px 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 4px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.winner:first-child {
  border-top: 0;
}

.winner .month {
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}

.winner .avatar {
  --size: 36px;
}

/* --------------------------------------------------------------------------
   Diagramme
   -------------------------------------------------------------------------- */

.chart {
  position: relative;
  width: 100%;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart .grid-line {
  stroke: rgba(var(--fg-rgb), 0.06);
  stroke-width: 1;
}

.chart .axis-label {
  fill: var(--dim);
  font-size: 11px;
  font-family: var(--font);
}

.chart .value-label {
  fill: var(--text-2);
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font);
}

.chart .bar {
  fill: var(--accent);
  transition: fill 0.12s;
}

.chart .bar.current {
  fill: var(--accent-2);
}

.chart .hit {
  fill: transparent;
  cursor: default;
}

.chart .hit:hover + .bar,
.chart g.col:hover .bar {
  fill: var(--accent-3);
}

.tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--popover-bg);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.45;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px));
  opacity: 0;
  transition: opacity 0.1s;
}

.tooltip.show {
  opacity: 1;
}

.tooltip b {
  font-weight: 750;
}

.hbars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: baseline;
}

.hbar .name {
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hbar .val {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.hbar .track {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 99px;
  background: rgba(var(--fg-rgb), 0.05);
  overflow: hidden;
}

.hbar .track i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
}

/* --------------------------------------------------------------------------
   Karte
   -------------------------------------------------------------------------- */

.map-card {
  position: relative;
  height: 560px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--bg);
}

.map-card canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.map-card canvas:active {
  cursor: grabbing;
}

.map-card.small {
  height: 380px;
}

.map-overlay {
  position: absolute;
  left: 14px;
  top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  pointer-events: none;
}

.map-overlay > * {
  pointer-events: auto;
}

.map-controls {
  position: absolute;
  right: 14px;
  top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-controls button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: rgba(14, 10, 26, 0.85);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.map-controls button:hover {
  border-color: var(--line-accent);
}

.map-controls svg {
  width: 17px;
  height: 17px;
}

.map-legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(14, 10, 26, 0.85);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.map-legend .ramp {
  width: 90px;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--accent-2), var(--accent-3));
}

.map-empty[hidden] {
  display: none;
}

.map-empty svg {
  width: 28px;
  height: 28px;
  margin: 0 auto 8px;
  display: block;
  opacity: 0.6;
}

.map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  pointer-events: none;
}

@media (max-width: 760px) {
  .map-card {
    height: 420px;
  }
}

/* --------------------------------------------------------------------------
   Live
   -------------------------------------------------------------------------- */

.live-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

@media (max-width: 1080px) {
  .live-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.driver-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 2px;
}

.driver-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.02);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  text-align: left;
  width: 100%;
}

.driver-item:hover {
  border-color: var(--line-2);
}

.driver-item.active {
  border-color: var(--line-accent);
  background: rgba(var(--accent-rgb), 0.08);
}

.driver-item .who {
  min-width: 0;
}

.driver-item .who b {
  display: block;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-item .who span {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-item .spd {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.driver-item .spd b {
  font-size: 18px;
  font-weight: 800;
}

.driver-item .spd span {
  display: block;
  font-size: 11px;
  color: var(--dim);
}

.driver-item .progress {
  grid-column: 1 / -1;
}

.progress {
  height: 5px;
  border-radius: 99px;
  background: rgba(var(--fg-rgb), 0.06);
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  transition: width 0.5s ease;
}

.dash {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

@media (max-width: 1180px) {
  .dash {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .dash .gauge-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .dash {
    grid-template-columns: minmax(0, 1fr);
  }
}

.gauge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gauge {
  position: relative;
  width: 100%;
  max-width: 260px;
}

.gauge svg {
  width: 100%;
  height: auto;
  display: block;
}

.gauge .readout {
  position: absolute;
  left: 0;
  right: 0;
  top: 46%;
  text-align: center;
}

.gauge .readout b {
  display: block;
  font-size: 54px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.gauge .readout span {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.gauge-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-top: 4px;
  width: 100%;
}

.limit-sign {
  --s: 56px;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.limit-sign svg {
  width: var(--s);
  height: var(--s);
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.limit-sign figcaption {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}

.limit-sign.vtc figcaption { color: var(--accent-2); }
.limit-sign.none svg { filter: none; }
.limit-sign.over svg { animation: pulse-sign 1s ease-in-out infinite; border-radius: 50%; }
@keyframes pulse-sign { 50% { filter: drop-shadow(0 0 10px rgba(225, 29, 72, 0.85)); } }

.inst { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; flex-shrink: 0; }
.inst figcaption { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); line-height: 1; }
.inst-box {
  height: 48px;
  min-width: 48px;
  padding: 0 10px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  background: rgba(var(--fg-rgb), 0.03);
  font-variant-numeric: tabular-nums;
}
.inst-box.gear { font-family: var(--mono); font-size: 22px; font-weight: 700; }
.inst-box.cruise { font-size: 14px; font-weight: 700; color: var(--dim); display: flex; align-items: center; justify-content: center; gap: 3px; }
.inst-box.cruise.on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.inst-box.cruise small { font-size: 10px; font-weight: 600; opacity: 0.8; }

.rpm {
  width: 100%;
  margin-top: 18px;
}

.rpm .segments {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  height: 12px;
}

.rpm .segments i {
  border-radius: 2px;
  background: rgba(var(--fg-rgb), 0.06);
}

.rpm .segments i.on {
  background: var(--accent-2);
}

.rpm .segments i.on.hot {
  background: var(--warn);
}

.rpm .segments i.on.red {
  background: var(--bad);
}

.rpm .labels {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
}

.indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  justify-content: center;
}

.ind {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--dim);
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.02);
}

.ind svg {
  width: 13px;
  height: 13px;
}

.ind.on {
  color: var(--ok-ink);
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.1);
}

.ind.on.blue {
  color: var(--info-ink);
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(96, 165, 250, 0.12);
}

.ind.on.amber {
  color: var(--warn-ink);
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.12);
}

.ind.on.red {
  color: var(--bad-ink);
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.12);
}

.meter {
  margin-bottom: 14px;
}

.meter:last-child {
  margin-bottom: 0;
}

.meter .top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 13.5px;
}

.meter .top span {
  color: var(--muted);
}

.meter .top b {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.meter .track {
  height: 8px;
  border-radius: 99px;
  background: rgba(var(--fg-rgb), 0.06);
  overflow: hidden;
}

.meter .track i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.meter .track i.ok {
  background: var(--ok);
}

.meter .track i.warn {
  background: var(--warn);
}

.meter .track i.bad {
  background: var(--bad);
}

.fuel-big {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.fuel-big b {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.fuel-big span {
  color: var(--muted);
}

.route-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.01em;
  flex-wrap: wrap;
}

.route-head .arrow {
  color: var(--accent-2);
  display: inline-flex;
}

.route-head .arrow svg {
  width: 20px;
  height: 20px;
}

.route-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-top: 16px;
}

.kv div {
  min-width: 0;
}

.kv span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.kv b {
  display: block;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-mini {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.live-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.02);
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  min-width: 0;
}

.live-card:hover {
  border-color: var(--line-accent);
}

.live-card .top {
  display: flex;
  align-items: center;
  gap: 11px;
}

.live-card .top .who {
  min-width: 0;
  flex: 1;
}

.live-card .top .who b {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-card .top .who span {
  font-size: 12.5px;
  color: var(--muted);
}

.live-card .speed {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.live-card .speed small {
  font-size: 11px;
  color: var(--dim);
  font-weight: 600;
  margin-left: 2px;
}

.live-card .route {
  font-size: 13.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-card .route-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   Fahrer
   -------------------------------------------------------------------------- */

.drivers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.flip {
  perspective: 1200px;
  height: 318px;
  cursor: pointer;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  transform-style: preserve-3d;
}

.flip.flipped .flip-inner {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--bg-2));
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.flip-face.back {
  transform: rotateY(180deg);
  border-color: var(--line-accent);
}

.flip:hover .flip-face {
  border-color: var(--line-2);
}

.flip:hover .flip-face.back {
  border-color: var(--line-accent);
}

.flip-front-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.flip-face .avatar {
  --size: 76px;
}

.flip-face .name {
  font-size: 18px;
  font-weight: 750;
  margin-top: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flip-face .role {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.flip-face > * {
  flex-shrink: 0;
}

.flip-face .pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
  /* höchstens eine Zeile, damit Name & Zahlen nicht verrutschen */
  max-height: 26px;
  overflow: hidden;
}

.flip-face .bottom {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.flip-face .bottom b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.flip-face .bottom span {
  font-size: 12px;
  color: var(--muted);
}

.flip-face.front {
  padding-bottom: 34px;
}

.flip-face .hint {
  position: absolute;
  right: 16px;
  bottom: 11px;
  font-size: 11px;
  color: var(--dim);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 17px;
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid var(--line-accent);
}

.badge.locked {
  filter: grayscale(1);
  opacity: 0.28;
  background: rgba(var(--fg-rgb), 0.03);
  border-color: var(--line);
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.badge-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line-accent);
  background: rgba(var(--accent-rgb), 0.06);
}

.badge-card.locked {
  border-color: var(--line);
  background: rgba(var(--fg-rgb), 0.015);
}

.badge-card.locked .icon {
  filter: grayscale(1);
  opacity: 0.35;
}

.badge-card .icon {
  font-size: 24px;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.badge-card b {
  display: block;
  font-size: 14px;
}

.badge-card span {
  font-size: 12.5px;
  color: var(--muted);
}

.badge-card.locked b {
  color: var(--muted);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.profile-head .avatar {
  --size: 104px;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.25), 0 0 60px -10px var(--glow);
}

.profile-head .info {
  flex: 1;
  min-width: 240px;
}

.profile-head h1 {
  font-size: clamp(32px, 4.5vw, 52px);
}

.rank-progress {
  margin-top: 16px;
  max-width: 460px;
}

.rank-progress .labels {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

/* --------------------------------------------------------------------------
   Auftrags-Detail
   -------------------------------------------------------------------------- */

.detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.detail-route {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.detail-route .arrow {
  font-weight: 500;
  color: var(--accent-2);
  margin: 0 8px;
}

.costs {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.costs td {
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.costs tr:first-child td {
  border-top: 0;
}

.costs td:last-child {
  text-align: right;
  font-weight: 650;
}

.costs .neg {
  color: var(--bad-ink);
}

.costs .total td {
  border-top: 1px solid var(--line-2);
  font-size: 17px;
  font-weight: 800;
  padding-top: 12px;
}

.flag-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flag-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.02);
}

.flag-item.warn {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.07);
}

.flag-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.score-ring {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}

.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring .val {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1;
}

.score-ring .val b {
  font-size: 30px;
  font-weight: 800;
  display: block;
}

.score-ring .val span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 650;
  letter-spacing: 0.08em;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline .ev {
  display: grid;
  grid-template-columns: 70px 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  border-top: 1px solid var(--line);
}

.timeline .ev:first-child {
  border-top: 0;
}

.timeline .ev .t {
  color: var(--dim);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Tracker / Login / Admin
   -------------------------------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 22px 20px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.02);
}

.step::before {
  counter-increment: step;
  content: '0' counter(step);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-2);
  display: block;
  margin-bottom: 10px;
}

.step p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.step code,
code.inline {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent-ink);
}

.token-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px dashed var(--line-accent);
  background: rgba(var(--accent-rgb), 0.06);
  font-family: var(--mono);
  font-size: 14px;
  word-break: break-all;
}

.token-box code {
  flex: 1;
}

pre.code {
  margin: 0;
  padding: 16px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--text-2);
}

.login-box {
  max-width: 460px;
  margin: 40px auto 0;
  text-align: center;
}

.login-box .card {
  padding: 34px 30px;
}

.login-box form {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.login-box form .input {
  flex: 1;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--dim);
  font-size: 12px;
  margin: 22px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
  color: var(--bad-ink);
  font-size: 14px;
  text-align: left;
  margin-bottom: 18px;
}

.alert.info {
  border-color: var(--line-accent);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent-ink);
}

.alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.data th {
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 10px 10px;
  white-space: nowrap;
}

table.data td {
  padding: 10px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

table.data tr:hover td {
  background: rgba(var(--fg-rgb), 0.015);
}

table.data .user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

table.data .user-cell .avatar {
  --size: 32px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: rgba(var(--fg-rgb), 0.12);
  cursor: pointer;
  transition: background 0.15s;
}

.switch span::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: white;
  transition: transform 0.15s;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::before {
  transform: translateX(16px);
}

/* --------------------------------------------------------------------------
   Leere Zustände, Laden, Toasts, Modal
   -------------------------------------------------------------------------- */

.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--muted);
}

.empty .icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-2);
}

.empty .icon svg {
  width: 24px;
  height: 24px;
}

.empty b {
  display: block;
  color: var(--text);
  font-size: 16px;
  margin-bottom: 4px;
}

.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(var(--fg-rgb), 0.03), rgba(var(--fg-rgb), 0.07), rgba(var(--fg-rgb), 0.03));
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}

.loading {
  display: grid;
  place-items: center;
  padding: 80px 0;
}

.spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(var(--accent-rgb), 0.2);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 40px));
}

.toast {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 15px;
  border-radius: 14px;
  background: var(--popover-bg);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  font-size: 14px;
  animation: slideIn 0.25s ease;
}

.toast .icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(52, 211, 153, 0.14);
  color: var(--ok);
}

.toast.error .icon {
  background: rgba(248, 113, 113, 0.14);
  color: var(--bad);
}

.toast.info .icon {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent-2);
}

.toast .icon svg {
  width: 16px;
  height: 16px;
}

.toast b {
  display: block;
}

.toast span {
  color: var(--muted);
  font-size: 13px;
}

.toast.out {
  animation: slideOut 0.25s ease forwards;
}

.modal-root:empty {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--backdrop);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade 0.15s ease;
}

.modal {
  width: 100%;
  max-width: 460px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  padding: 26px;
  box-shadow: var(--shadow);
  animation: pop 0.18s ease;
}

.modal h3 {
  margin-bottom: 8px;
}

.modal p {
  color: var(--muted);
  margin: 0 0 20px;
}

.modal .actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   Fußzeile
   -------------------------------------------------------------------------- */

.foot {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 28px 0;
  font-size: 13px;
  color: var(--dim);
}

.foot .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.foot a:hover {
  color: var(--text-2);
}

/* --------------------------------------------------------------------------
   Animationen
   -------------------------------------------------------------------------- */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(-4px);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

@keyframes flash {
  0% {
    background: rgba(var(--accent-rgb), 0.22);
  }
  100% {
    background: transparent;
  }
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
}

@keyframes slideOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   v2 – Navigation mit Dropdowns, Suche, Formulare, Fuhrpark, Dispo, Events
   ========================================================================== */

body.modal-open {
  overflow: hidden;
}

.nav-link,
.nav-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 0;
  background: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover,
.nav-trigger:hover,
.nav-group:hover .nav-trigger {
  color: var(--text);
  background: rgba(var(--fg-rgb), 0.04);
}

.nav-link.active,
.nav-group.active .nav-trigger {
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.14);
  box-shadow: inset 0 0 0 1px var(--line-accent);
}

.nav-trigger .chev {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  transition: transform 0.15s;
}

.nav-group {
  position: relative;
}

.nav-drop {
  position: absolute;
  top: calc(100% + 10px);
  left: -8px;
  min-width: 320px;
  padding: 8px;
  border-radius: 16px;
  background: var(--popover-bg);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow), 0 0 0 1px rgba(var(--accent-rgb), 0.06);
  display: none;
  z-index: 60;
}

.nav-drop::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}

.nav-group.open .nav-drop {
  display: block;
  animation: pop 0.14s ease-out;
}

@media (hover: hover) and (min-width: 1081px) {
  .nav-group:hover .nav-drop {
    display: block;
    animation: pop 0.14s ease-out;
  }
  .nav-group:hover .chev {
    transform: rotate(180deg);
  }
}

.nav-drop a {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-2);
}

.nav-drop a:hover,
.nav-drop a.active {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--text);
}

.nav-drop .nd-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid var(--line-accent);
  color: var(--accent-2);
}

.nav-drop .nd-icon svg {
  width: 17px;
  height: 17px;
}

.nav-drop b {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.nav-drop small {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.35;
  margin-top: 1px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.icon-btn:hover {
  border-color: var(--line-accent);
  color: var(--text);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  background: rgba(var(--fg-rgb), 0.03);
}

.menu-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.menu-head b {
  display: block;
  font-size: 14px;
}

.role-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.role-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rank);
}

@media (max-width: 1080px) {
  .nav-group {
    width: 100%;
  }
  .nav-trigger,
  .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 12px;
  }
  .nav-drop {
    position: static;
    min-width: 0;
    border: 0;
    box-shadow: none;
    background: rgba(var(--fg-rgb), 0.02);
    margin: 4px 0 6px;
  }
  .nav-drop::before {
    display: none;
  }
  .nav-group.open .chev {
    transform: rotate(180deg);
  }
  .icon-btn kbd {
    display: none;
  }
  .nav {
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
}

/* Suche */
.palette-backdrop {
  align-items: flex-start;
  padding-top: 12vh;
}

.palette {
  width: 100%;
  max-width: 620px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow), 0 30px 80px -30px rgba(var(--accent-rgb), 0.5);
  overflow: hidden;
  animation: pop 0.15s ease;
}

.palette-input {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.palette-input svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.palette-input input {
  flex: 1;
  height: 56px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
}

.palette-results {
  max-height: min(60vh, 460px);
  overflow-y: auto;
  padding: 6px;
}

.pal-group {
  padding: 10px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.pal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 11px;
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--text-2);
}

.pal-item.active {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--text);
}

.pal-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(var(--fg-rgb), 0.04);
  flex-shrink: 0;
}

.pal-icon svg {
  width: 16px;
  height: 16px;
}

.pal-text {
  flex: 1;
  min-width: 0;
}

.pal-text b {
  display: block;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pal-text small {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pal-go {
  width: 15px;
  height: 15px;
  opacity: 0;
}

.pal-item.active .pal-go {
  opacity: 0.6;
}

.pal-empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

/* Formulare */
.modal.wide {
  max-width: 720px;
}

.modal {
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.form h3 {
  margin-bottom: 6px;
}

.form p {
  margin: 0 0 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  margin: 18px 0 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.field .req {
  color: var(--accent-2);
  font-style: normal;
  margin-left: 3px;
}

.field .hint {
  font-size: 12px;
  color: var(--dim);
}

.field .input,
.field .select {
  width: 100%;
}

.textarea {
  height: auto;
  padding: 10px 14px;
  resize: vertical;
  line-height: 1.5;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  min-height: 40px;
}

.check input,
.perm input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.perm {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.02);
  cursor: pointer;
}

.perm:has(input:checked) {
  border-color: var(--line-accent);
  background: rgba(var(--accent-rgb), 0.08);
}

.perm.danger:has(input:checked) {
  border-color: rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.08);
}

.perm input {
  margin-top: 2px;
}

.perm b {
  display: block;
  font-size: 13.5px;
}

.perm small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.form-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: var(--bad-ink);
  font-size: 14px;
}

.btn.danger.solid {
  border: 0;
  background: #dc2626;
  color: white;
}

.btn.danger.solid:hover {
  background: #b91c1c;
}

@media (max-width: 600px) {
  .form-grid,
  .perm-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Kennzeichen */
.plate {
  display: inline-flex;
  align-items: stretch;
  height: 24px;
  border-radius: 5px;
  overflow: hidden;
  background: #f4f4f5;
  color: #111;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1.5px #27272a;
  padding-right: 8px;
  line-height: 24px;
}

.plate i {
  font-style: normal;
  background: #1d4ed8;
  color: #fde047;
  font-size: 9px;
  padding: 0 4px;
  margin-right: 7px;
  display: flex;
  align-items: flex-end;
  padding-bottom: 2px;
  line-height: 1;
}

.plate.us {
  background: var(--warn-ink);
}

.plate.us i {
  background: #b91c1c;
  color: white;
}

/* Fuhrpark */
.truck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.truck-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--bg-2));
  transition: border-color 0.15s, transform 0.15s;
  min-width: 0;
}

.truck-card:hover {
  border-color: var(--line-accent);
  transform: translateY(-2px);
}

.truck-card.retired {
  opacity: 0.55;
}

.truck-card .top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.truck-card .title {
  min-width: 0;
}

.truck-card .title b {
  display: block;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.truck-card .title span {
  font-size: 13px;
  color: var(--muted);
}

.truck-card .badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.truck-card .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

.truck-card .row span {
  color: var(--muted);
}

.truck-card .driver {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.truck-card .driver b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.truck-live {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.25);
  font-size: 13px;
  color: var(--ok-ink);
}

.progress.warn i {
  background: var(--warn);
}

.progress.bad i {
  background: var(--bad);
}

.truck-hero {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.truck-hero .icon-big {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.28), var(--surface-2));
  border: 1px solid var(--line-accent);
  box-shadow: 0 0 60px -12px var(--glow);
  color: var(--accent-3);
  flex-shrink: 0;
  overflow: hidden;
}

.truck-hero .icon-big svg {
  width: 46px;
  height: 46px;
}

.truck-hero .icon-big img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logbook {
  display: flex;
  flex-direction: column;
}

.logbook .entry {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.logbook .entry:first-child {
  border-top: 0;
}

.logbook .entry .job-icon {
  width: 34px;
  height: 34px;
}

.logbook .entry b {
  display: block;
  font-size: 14px;
}

.logbook .entry small {
  color: var(--muted);
  font-size: 12.5px;
}

.logbook .cost {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Leitstand */
.leit-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

@media (max-width: 760px) {
  .leit-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

table.leit {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.leit th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 10px 10px;
  white-space: nowrap;
}

table.leit td {
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

table.leit tr.row {
  cursor: pointer;
}

table.leit tr.row:hover td {
  background: rgba(var(--fg-rgb), 0.025);
}

table.leit tr.row.active td {
  background: rgba(var(--accent-rgb), 0.08);
}

table.leit .who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
}

table.leit .who b {
  display: block;
  white-space: nowrap;
}

table.leit .who small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

table.leit .tour b {
  display: block;
  white-space: nowrap;
}

table.leit .tour small {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

table.leit .num {
  white-space: nowrap;
  font-weight: 650;
}

table.leit .bar-cell {
  min-width: 110px;
}

.speed-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.speed-chip small {
  font-size: 11px;
  color: var(--dim);
  font-weight: 600;
}

.speed-chip.over {
  color: var(--bad-ink);
}

@media (max-width: 900px) {
  table.leit .hide-md {
    display: none;
  }
}

/* Dispo */
.dispo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.dispo-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(var(--fg-rgb), 0.035), rgba(var(--fg-rgb), 0.01));
  min-width: 0;
}

.dispo-card.urgent {
  border-color: rgba(251, 191, 36, 0.35);
}

.dispo-card.mine {
  border-color: var(--line-accent);
  box-shadow: 0 20px 60px -40px var(--glow);
}

.dispo-card .route-head {
  font-size: 18px;
}

.dispo-card .meta {
  display: flex;
  gap: 6px 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.dispo-card .meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dispo-card .meta svg {
  width: 14px;
  height: 14px;
}

.dispo-card .bonus {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.dispo-card .actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.how {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.how div {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(var(--fg-rgb), 0.02);
  border: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
}

.how b {
  display: block;
  color: var(--text);
  margin-bottom: 2px;
}

@media (max-width: 760px) {
  .how {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Events */
.event-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.event-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(var(--fg-rgb), 0.035), rgba(var(--fg-rgb), 0.01));
}

.event-card.cancelled {
  opacity: 0.6;
}

.date-block {
  width: 74px;
  height: 84px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.22), rgba(var(--accent-rgb), 0.05));
  border: 1px solid var(--line-accent);
  line-height: 1.1;
}

.date-block b {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.date-block small {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-3);
}

.event-card h3 {
  font-size: 19px;
}

.event-card .meta {
  display: flex;
  gap: 6px 16px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--muted);
}

.event-card .meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.event-card .meta svg {
  width: 14px;
  height: 14px;
}

.event-card .desc {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--text-2);
  white-space: pre-line;
}

.event-card .side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  justify-content: space-between;
}

.rsvp {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.02);
}

.rsvp button {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.rsvp button:hover {
  color: var(--text);
}

.rsvp button.on.yes {
  background: rgba(52, 211, 153, 0.16);
  color: var(--ok-ink);
}

.rsvp button.on.maybe {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warn-ink);
}

.rsvp button.on.no {
  background: rgba(248, 113, 113, 0.14);
  color: var(--bad-ink);
}

.avatar-stack {
  display: inline-flex;
  align-items: center;
}

.avatar-stack .avatar {
  box-shadow: 0 0 0 2px var(--bg-2);
  margin-left: -5px;
  font-size: calc(var(--size) * 0.34);
}

.avatar-stack .avatar:first-child {
  margin-left: 0;
}

.avatar-stack .more {
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 700px) {
  .event-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .event-card .side {
    grid-column: 1 / -1;
    align-items: flex-start;
  }
  .date-block {
    width: 64px;
    height: 74px;
  }
}

/* Mein Bereich (Startseite) */
.me-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 36px;
}

.me-card {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(var(--fg-rgb), 0.04), rgba(var(--fg-rgb), 0.012));
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.me-card.hello {
  border-color: var(--line-accent);
  background: linear-gradient(140deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent-rgb), 0.03));
}

.me-card .label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.me-card .label svg {
  width: 14px;
  height: 14px;
}

.me-card .big {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.me-card .sub {
  font-size: 13px;
  color: var(--muted);
}

.me-card a.more {
  margin-top: auto;
  font-size: 13px;
  font-weight: 650;
  color: var(--accent-2);
}

@media (max-width: 1080px) {
  .me-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .me-strip {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Verwaltung */
.role-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.role-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.02);
}

.role-row .swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--rank);
  box-shadow: 0 0 12px var(--rank);
}

.role-row b {
  font-size: 15px;
}

.role-row .perms {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.role-row .perms .pill {
  height: 21px;
  font-size: 11.5px;
}

.role-row .tools {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn.icon {
  width: 32px;
  padding: 0;
}

.settings-group {
  margin-top: 26px;
}

.settings-group:first-child {
  margin-top: 0;
}

.settings-group h4 {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 12px;
}

.settings-group .form-grid {
  margin: 0;
}

.sticky-save {
  position: sticky;
  bottom: 16px;
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  pointer-events: none;
}

.sticky-save .btn {
  pointer-events: auto;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.8), 0 10px 30px -10px rgba(var(--accent-rgb), 0.8);
}

.pill.info {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.3);
  color: var(--info-ink);
}

.pill .dot {
  width: 7px;
  height: 7px;
}

.code-big {
  font-family: var(--mono);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  padding: 18px;
  border-radius: 16px;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px dashed var(--line-accent);
  margin: 16px 0 8px;
  color: var(--accent-ink);
}

.option-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.option-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(var(--fg-rgb), 0.035), rgba(var(--fg-rgb), 0.01));
}

.option-card.recommended {
  border-color: var(--line-accent);
  box-shadow: 0 30px 80px -40px rgba(var(--accent-rgb), 0.6);
}

.option-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.option-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

@media (max-width: 980px) {
  .option-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

details.adv summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
}

details.adv[open] summary {
  margin-bottom: 14px;
}

.amount.neg {
  color: var(--bad-ink);
}

.amount.pos {
  color: var(--ok-ink);
}

.chart .bar.neg {
  fill: #f87171;
}

.chart .zero-line {
  stroke: rgba(var(--fg-rgb), 0.25);
  stroke-width: 1;
}

.nav-drop a {
  white-space: normal;
  font-size: 14px;
  box-shadow: none !important;
}

.role-row .dim svg {
  vertical-align: -2px;
}

.mini-truck {
  display: block;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: inherit;
}

.mini-truck:first-of-type {
  border-top: 0;
  padding-top: 2px;
}

.mini-truck:hover b {
  color: var(--accent-3);
}

.fit-short {
  display: none;
}

@media (max-width: 760px) {
  .fit-full {
    display: none;
  }
  .fit-short {
    display: inline;
  }
  .kpi {
    padding: 18px 16px 16px;
  }
}

/* ==========================================================================
   v2.1 – Singleplayer-Aufträge
   ========================================================================== */

.pill.danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.32);
  color: var(--bad-ink);
}

/* Singleplayer-Aufträge */
.sp-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.sp-end {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.02);
}

.sp-tag {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-3);
}

.sp-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-accent);
  color: var(--accent-3);
  background: rgba(var(--accent-rgb), 0.1);
}

.sp-arrow svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 760px) {
  .sp-route {
    grid-template-columns: minmax(0, 1fr);
  }
  .sp-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }
}

.sp-list {
  display: flex;
  flex-direction: column;
}

.sp-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.8fr) minmax(0, 0.9fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.sp-row:first-child {
  border-top: 0;
}

.sp-route-mini b {
  display: block;
  font-size: 15px;
}

.sp-route-mini small {
  display: block;
  font-size: 12.5px;
  margin-top: 2px;
}

.sp-who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  min-width: 0;
}

.sp-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.sp-meta small {
  font-size: 12px;
}

.sp-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

@media (max-width: 860px) {
  .sp-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .sp-who {
    display: none;
  }
  .sp-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.icon-btn kbd {
  white-space: nowrap;
}

@media (max-width: 1320px) {
  .icon-btn kbd {
    display: none;
  }
}

@media (max-width: 480px) {
  .top-actions .live-pill {
    display: none;
  }
  .top-actions {
    gap: 6px;
  }
}

/* Hilfe */
.help-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.help-toc {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow-y: auto;
}

.help-toc b {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.help-toc a {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-2);
}

.help-toc a:hover {
  background: rgba(var(--fg-rgb), 0.04);
  color: var(--text);
}

.help-toc a span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent-3);
  flex-shrink: 0;
}

.help-toc a svg {
  width: 14px;
  height: 14px;
}

.help-toc hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 8px 0;
  width: 100%;
}

.help-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.help-sec h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 21px;
  margin: 0 0 12px;
}

.help-num {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 15px;
  background: linear-gradient(140deg, var(--accent), var(--accent-deep));
  color: #fff;
  flex-shrink: 0;
}

.help-sec p,
.help-sec li {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.65;
}

.help-steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.help-steps li {
  counter-increment: step;
  position: relative;
  padding: 10px 14px 10px 50px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.02);
}

.help-steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 800;
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent-3);
}

.help-list {
  padding-left: 20px;
  margin: 10px 0;
}

.help-list li {
  margin: 4px 0;
}

.help-note {
  margin: 14px 0;
}

.alert.warn {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.07);
  color: var(--warn-ink);
}

.help-code {
  margin: 10px 0 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.help-table td {
  font-size: 14px;
  vertical-align: top;
}

.help-fig {
  margin: 16px 0;
}

.help-fig.small {
  max-width: 300px;
}

.help-img {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  cursor: zoom-in;
}

.help-img img {
  display: block;
  width: 100%;
  height: auto;
}

.help-fig figcaption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
}

.help-zoom {
  display: block;
  width: 100%;
  border-radius: 12px;
}

.help-link {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 900px) {
  .help-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .help-toc {
    position: static;
    max-height: none;
  }
}


/* Schlichte Startseite */
.hero.hero-plain {
  padding-top: 0;
}

.hero-plain .hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.hero-plain .lead {
  margin-top: 6px;
  font-size: 15px;
  color: var(--muted);
}

.hero-plain .hero-actions {
  margin: 0;
}

.section-head {
  margin-bottom: 20px;
}

.section-head .titles {
  gap: 8px;
}

.section-head p {
  font-size: 14.5px;
}

/* Persönliche Einstellungen */
.prefs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 900px) {
  .prefs-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pref-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.pref-row:first-of-type {
  border-top: 0;
}

.pref-label {
  font-weight: 600;
  font-size: 14.5px;
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(var(--fg-rgb), 0.02);
}

.seg button {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 9px;
  cursor: pointer;
}

.seg button:hover {
  color: var(--text);
  background: rgba(var(--fg-rgb), 0.05);
}

.seg button.active {
  background: var(--accent);
  color: #fff;
}

.swatches {
  display: flex;
  gap: 10px;
}

.swatch-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--c);
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--line-2);
}

.swatch-btn.active {
  border-color: var(--bg);
  box-shadow: 0 0 0 3px var(--c);
}
.colors {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.colors .swatches {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.swatch-btn.vtc,
.swatch-btn.custom {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--on-accent, #fff);
  overflow: hidden;
}
.swatch-btn.vtc svg,
.swatch-btn.custom svg {
  width: 14px;
  height: 14px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
  color: #fff;
}
.swatch-btn.custom {
  background: conic-gradient(from 0deg, #ef4444, #eab308, #10b981, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #ef4444);
}
.swatch-btn.custom.active {
  background: var(--c);
}
.swatch-btn.custom input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
}

/* Helles Design: Stellen mit fester dunkler Farbe */
:root[data-theme='light'] .rank-pill {
  color: color-mix(in srgb, var(--rank) 60%, black);
}
:root[data-theme='light'] .reset-box .big {
  background: linear-gradient(160deg, var(--accent-deep), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
}
:root[data-theme='light'] .brand-mark {
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.16), var(--surface-2));
}

/* ---------- Fahr-Dashboard: Prognose, Steigung, Warnungen ---------- */
.dash .trip-card {
  grid-column: span 2;
}
@media (max-width: 1180px) {
  .dash .trip-card {
    grid-column: 1 / -1;
  }
}
.gauge-card.too-fast {
  border-color: color-mix(in srgb, var(--bad) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--bad) 30%, transparent) inset;
}
.slope {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.03);
  color: var(--muted);
  font-size: 12px;
}
.slope svg {
  width: 34px;
  height: 20px;
  fill: currentColor;
  opacity: 0.8;
}
.slope span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}
.slope b {
  font-size: 16px;
  color: var(--fg);
}
.slope.warn {
  color: var(--warn-ink);
  border-color: color-mix(in srgb, var(--warn) 40%, transparent);
}
.slope.bad {
  color: var(--bad-ink);
  border-color: color-mix(in srgb, var(--bad) 45%, transparent);
}
.eta-big {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 16px 0 4px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(var(--accent-rgb), 0.07);
}
.eta-big > div:first-child {
  display: flex;
  flex-direction: column;
  min-width: 120px;
}
.eta-big > div:first-child span,
.eta-alt span {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.eta-big > div:first-child b {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.eta-big small {
  color: var(--muted);
  font-size: 13px;
}
.eta-alt {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}
.eta-alt div {
  display: flex;
  flex-direction: column;
}
.eta-alt b {
  font-size: 15px;
}
@media (max-width: 560px) {
  .eta-big {
    grid-template-columns: 1fr;
  }
}
.checks {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 13px;
}
.check svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
}
.check div {
  display: flex;
  flex-direction: column;
}
.check span {
  color: var(--muted);
}
.check.ok svg {
  color: var(--ok);
}
.check.warn {
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
  background: color-mix(in srgb, var(--warn) 7%, transparent);
}
.check.warn svg {
  color: var(--warn-ink);
}
.check.bad {
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
  background: color-mix(in srgb, var(--bad) 8%, transparent);
}
.check.bad svg {
  color: var(--bad-ink);
}
.kv b.bad-ink {
  color: var(--bad-ink);
}

/* ---------- Verwaltung: Einstellungen mit Navigation & Suche ---------- */
.settings-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.settings-nav {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
}
.settings-nav .input {
  margin-bottom: 8px;
}
.settings-nav a {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}
.settings-nav a:hover {
  background: rgba(var(--fg-rgb), 0.05);
}
.settings-nav a svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 2px;
  color: var(--accent-2);
}
.settings-nav a span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.settings-nav a b {
  font-size: 14px;
}
.settings-nav a small {
  color: var(--muted);
  font-size: 12px;
}
.settings-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.settings-main .settings-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-main .settings-group h3 svg {
  width: 18px;
  height: 18px;
  color: var(--accent-2);
}
.set-meta {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 4px;
}
.set-meta .hint {
  margin: 0;
}
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.link-btn svg {
  width: 13px;
  height: 13px;
}
.field[hidden],
.settings-group[hidden] {
  display: none;
}
@media (max-width: 900px) {
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .settings-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .settings-nav .input {
    flex-basis: 100%;
  }
  .settings-nav a {
    padding: 6px 10px;
    border: 1px solid var(--line);
  }
  .settings-nav a small {
    display: none;
  }
}

/* ---------- Rechte-Übersicht ---------- */
.perm-matrix th.c,
.perm-matrix td.c {
  text-align: center;
  white-space: nowrap;
}
.perm-matrix th.c .swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rank);
  margin-right: 6px;
  vertical-align: middle;
}
.perm-matrix input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}
.perm-matrix input[type='checkbox']:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.perm-matrix td:first-child {
  min-width: 240px;
}

/* ---------- Ersteinrichtung (Startseite, nur Leitung) ---------- */
.setup-card {
  margin: 0 0 18px;
  border-color: var(--line-accent);
}
.setup-card .card-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.setup-card .card-head h3 svg {
  width: 18px;
  height: 18px;
  color: var(--accent-2);
}
.setup-card .progress {
  height: 6px;
  border-radius: 99px;
  background: rgba(var(--fg-rgb), 0.08);
  overflow: hidden;
  margin-bottom: 12px;
}
.setup-card .progress i {
  display: block;
  height: 100%;
  background: var(--accent);
}
.setup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}
.setup-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  font-size: 13.5px;
}
.setup-list li > svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
  color: var(--warn-ink);
}
.setup-list li.done > svg {
  color: var(--ok);
}
.setup-list li.done b {
  color: var(--muted);
  font-weight: 500;
}
.setup-list li div {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.setup-list li span {
  color: var(--muted);
  font-size: 12.5px;
}
@media (max-width: 760px) {
  .setup-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Mehrere Speditionen: Start, Beitreten, Verwaltung ---------- */
.welcome {
  max-width: 1080px;
  margin: 0 auto;
}
.welcome-hero {
  text-align: center;
  padding: 26px 0 30px;
}
.welcome-hero .brand-mark.big {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  margin: 0 auto 16px;
}
.welcome-hero h1 {
  font-size: clamp(30px, 5vw, 44px);
  margin: 0 0 10px;
}
.welcome-hero .lead {
  max-width: 680px;
  margin: 0 auto;
  color: var(--muted);
}
.welcome-hero .hero-actions {
  justify-content: center;
  margin-top: 22px;
}
.welcome-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}
@media (max-width: 820px) {
  .welcome-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.welcome .card-head h3,
.card-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-head h3 > svg {
  width: 18px;
  height: 18px;
  color: var(--accent-2);
}
.inline-form,
.copy-row {
  display: flex;
  gap: 8px;
}
.inline-form .input,
.copy-row .input {
  flex: 1;
  min-width: 0;
}
.vtc-list {
  display: grid;
  gap: 8px;
}
.vtc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 10px;
}
.vtc-list .vtc-card {
  margin-top: 0;
}
.vtc-card.highlight {
  border-color: var(--line-accent);
  background: rgba(var(--accent-rgb), 0.07);
}
.vtc-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--c, var(--accent));
}
.vtc-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.vtc-info span {
  color: var(--muted);
  font-size: 12.5px;
}
.vtc-actions {
  display: flex;
  gap: 6px;
  flex: none;
}
@media (max-width: 520px) {
  .vtc-card {
    flex-wrap: wrap;
  }
  .vtc-actions {
    width: 100%;
  }
}
.visit-bar {
  padding-top: 14px;
  margin-bottom: 22px;
}
.visit-bar .alert {
  margin: 0;
  align-items: center;
}
.visit-bar .alert span {
  flex: 1;
}
.radio-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 640px) {
  .radio-list {
    grid-template-columns: minmax(0, 1fr);
  }
}
.radio-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.radio-card:has(input:checked) {
  border-color: var(--line-accent);
  background: rgba(var(--accent-rgb), 0.08);
}
.radio-card input {
  margin-top: 3px;
  accent-color: var(--accent);
}
.radio-card span {
  display: flex;
  flex-direction: column;
}
.radio-card small {
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- Fahrerakte ---------- */
.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.record-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.record-summary div {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.record-summary div > span {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.record-summary b {
  font-size: 16px;
}
.record-summary b.warn-ink {
  color: var(--warn-ink);
}
@media (max-width: 900px) {
  .record-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.record-card .alert {
  align-items: center;
}
.record-card .alert span {
  flex: 1;
}
.record-trainings {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 12px;
}
.record-ratings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 12px;
  font-size: 13px;
}
.record-ratings div {
  display: flex;
  gap: 8px;
  align-items: center;
}
.record-ratings span:first-child {
  color: var(--muted);
}
.stars {
  color: #fbbf24;
  letter-spacing: 1px;
}
.stars i {
  font-style: normal;
  color: rgba(var(--fg-rgb), 0.18);
}
.record-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.record-entry {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.record-entry.warning {
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}
.record-entry.praise {
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
}
.record-entry.expired {
  opacity: 0.6;
}
.re-icon {
  font-size: 20px;
  line-height: 1.2;
}
.re-body {
  flex: 1;
  min-width: 0;
}
.re-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.re-body p {
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 14px;
  white-space: pre-wrap;
}
.re-ratings {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}
.re-meta {
  font-size: 12px;
  margin-top: 4px;
}
.pill.danger {
  color: var(--bad-ink);
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
}

/* ---------- Verträge & Bilanz ---------- */
.cost-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tabs.small button { padding: 4px 10px; font-size: 12.5px; }
table.bilanz tr.grp th { padding-top: 14px; border-bottom: 1px solid var(--line); text-align: left; }
table.bilanz tr.grp th.num, table.bilanz td.num { text-align: right; }
table.bilanz td { padding-left: 14px; }
table.bilanz tfoot th { border-top: 2px solid var(--line-strong, var(--line)); padding-top: 10px; font-size: 15px; text-align: left; }
table.bilanz tfoot th.num { text-align: right; }
.field[hidden] { display: none !important; }

/* ---------- Fahrerkonto, Shop, Börse ---------- */
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.plain-list { margin: 0; padding-left: 18px; line-height: 1.8; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--hover, rgba(255, 255, 255, 0.03)); }
.wallet-hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px 24px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--card)) 0%, var(--card) 70%); }
.wallet-balance { font-size: clamp(32px, 5vw, 46px); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 2px 0 4px; }
.wallet-balance.neg { color: var(--bad-ink); }
.wallet-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wallet-grid { align-items: start; }
.wallet-tx { display: flex; flex-direction: column; }
.wtx { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.wtx:last-child { border-bottom: 0; }
.wtx-icon { font-size: 20px; text-align: center; }
.wtx .dim { font-size: 12.5px; }
.wtx-right { text-align: right; white-space: nowrap; }
.living { display: flex; flex-direction: column; gap: 12px; }
.living > div, .owned-row { display: flex; gap: 12px; align-items: center; }
.li-icon { font-size: 26px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--chip, rgba(255, 255, 255, 0.05)); flex: none; }
.rich-list { display: flex; flex-direction: column; }
.rich-row { display: grid; grid-template-columns: 22px 28px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.rich-row:last-child { border-bottom: 0; }
.rich-row .rank-no { color: var(--muted); font-weight: 700; text-align: center; }
.shop-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.shop-balance { display: flex; gap: 10px; align-items: center; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.shop-item { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.shop-item.owned { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.si-icon { font-size: 34px; line-height: 1; }
.si-body p { margin: 4px 0 0; font-size: 13px; }
.si-body { flex: 1; }
.si-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.si-price { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.si-price small { font-weight: 500; color: var(--muted); font-size: 12px; }
.owned-list { display: flex; flex-direction: column; gap: 10px; }
.owned-row > div { flex: 1; }
.market-layout { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 18px; margin: 18px 0; align-items: start; }
.market-list { padding: 12px; }
.market-list .card-head { padding: 4px 6px 8px; }
.quote { display: grid; grid-template-columns: 1fr 70px auto; gap: 10px; align-items: center; width: 100%; padding: 10px; border: 0; border-radius: 12px; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.quote:hover { background: var(--hover, rgba(255, 255, 255, 0.04)); }
.quote.active { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.q-name { display: flex; flex-direction: column; min-width: 0; }
.q-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-name .dim { font-size: 12px; }
.q-price { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; }
.quote .spark { width: 70px; height: 28px; }
.spark polyline { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark.up polyline { stroke: var(--ok); }
.spark.down polyline { stroke: var(--bad); }
.chg.up { color: var(--ok-ink); }
.chg.down { color: var(--bad-ink); }
.quote-head { display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; margin: 2px 0 10px; font-size: 13.5px; }
.quote-head .big { font-size: 28px; font-weight: 800; }
.line-chart .series .line { fill: none; stroke-width: 2; stroke: currentColor; }
.line-chart .series.up { color: var(--ok); }
.line-chart .series.down { color: var(--bad); }
.line-chart .cursor { stroke: var(--muted); stroke-dasharray: 3 3; }
.line-chart .dot.up { fill: var(--ok); }
.line-chart .dot.down { fill: var(--bad); }
.line-chart .hit { fill: transparent; }
.trade-form { display: flex; flex-direction: column; gap: 8px; }
.trade-form .quick { display: flex; gap: 6px; flex-wrap: wrap; }
.trade-preview { font-size: 13px; min-height: 18px; margin: 0; }
.dealer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.dealer-card { display: flex; flex-direction: column; border-radius: 16px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.dealer-img { aspect-ratio: 5 / 3; display: flex; align-items: center; justify-content: center; overflow: hidden; border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse 70% 45% at 50% 88%, rgba(var(--accent-rgb), 0.22), transparent 70%), linear-gradient(180deg, rgba(var(--fg-rgb), 0.015), rgba(var(--fg-rgb), 0.06)); }
.dealer-img img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform 0.35s ease; }
.dealer-card:hover .dealer-img img { transform: translateY(-3px) scale(1.025); }
.dealer-noimg svg { width: 42px; height: 42px; color: var(--dim); }
.dealer-body { display: flex; flex-direction: column; gap: 5px; padding: 14px 16px 14px; flex: 1; }
.dealer-card .price small { font-size: 13px; font-weight: 600; color: var(--muted); }
.dealer-card .conv { font-size: 12.5px; }
.dealer-card .credit { margin-top: 8px; font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dealer-card .credit:hover { color: var(--muted); }
.dealer-note { margin-top: 16px; font-size: 12.5px; max-width: 760px; }
.dealer-card .brand { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.dealer-card .model { font-size: 18px; font-weight: 800; }
.dealer-card .price { font-size: 20px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.dealer-card .used { font-size: 12.5px; }
.rent-banner { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.showcase { display: flex; flex-wrap: wrap; gap: 8px; }
.showcase .pill { font-size: 13px; }
@media (max-width: 900px) {
  .market-layout { grid-template-columns: 1fr; }
}
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.line-chart .cursor, .line-chart .dot { opacity: 0; transition: opacity 0.12s; }
.line-chart.hover .cursor, .line-chart.hover .dot { opacity: 1; }
.tabs button svg, .tabs a svg { margin-right: 6px; }
code.inline { overflow-wrap: anywhere; word-break: break-word; }
@keyframes pulse-red { 50% { box-shadow: 0 0 0 6px rgba(225, 29, 72, 0.35); } }
.name-help { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.name-ideas { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.name-status { margin: 0; font-size: 13px; min-height: 18px; }
.name-status.ok { color: var(--ok-ink); }
.name-status.bad { color: var(--bad-ink); }
.alias { font-size: 12px; color: var(--muted); display: block; }
.btn.xs { height: 24px; padding: 0 7px; font-size: 12px; vertical-align: middle; }
.btn.xs.icon { width: 24px; padding: 0; }
.btn.xs svg { width: 13px; height: 13px; }
.truck-live { flex-wrap: wrap; row-gap: 4px; } .truck-live a { white-space: nowrap; }

/* ---------- v3.5: Garagen, Hausbank, Wettbewerb, Erfolge, Abrechnung ---------- */
.garage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 18px; }
.garage-card { display: flex; flex-direction: column; gap: 12px; }
.garage-top { display: flex; gap: 12px; align-items: center; }
.garage-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(var(--accent-rgb), 0.12); color: var(--accent-2); flex: none; }
.garage-icon svg { width: 22px; height: 22px; }
.slots { display: flex; gap: 6px; flex-wrap: wrap; }
.slots i { width: 38px; height: 30px; border-radius: 8px; border: 1px dashed var(--line-2); display: grid; place-items: center; color: var(--dim); }
.slots i svg { width: 18px; height: 18px; opacity: 0.35; }
.slots i.on { border-style: solid; border-color: var(--line-accent); background: rgba(var(--accent-rgb), 0.14); color: var(--accent-3); }
.slots i.on svg { opacity: 1; }
.garage-trucks { display: flex; gap: 6px; flex-wrap: wrap; min-height: 28px; }
.garage-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.bank-card h3 { display: flex; align-items: center; gap: 8px; }
.bank-card h3 svg { width: 18px; height: 18px; color: var(--accent-2); }
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pict { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; vertical-align: -0.25em; color: var(--accent-2); }
.pict svg { width: 100%; height: 100%; }
.pict-box { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(var(--accent-rgb), 0.12); color: var(--accent-2); flex: none; }
.pict-box svg { width: 20px; height: 20px; }
.pict-box.gold { background: rgba(251, 191, 36, 0.14); color: #fbbf24; }
.pict-box.silver { background: rgba(203, 213, 225, 0.14); color: #cbd5e1; }
.pict-box.bronze { background: rgba(217, 119, 6, 0.16); color: #f59e0b; }
.pict-box.locked { background: rgba(var(--fg-rgb), 0.05); color: var(--dim); }
/* Erfolge mit Stufen */
.badge { --tc: var(--accent-2); color: var(--tc); }
.badge svg { width: 18px; height: 18px; }
.badge-card { --tc: var(--accent-2); align-items: flex-start; }
.badge-card .icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent); }
.badge-card .icon svg { width: 20px; height: 20px; }
.badge-card .grow { flex: 1; min-width: 0; }
.badge-card .tier { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tc); }
.badge-progress { height: 4px; border-radius: 4px; background: rgba(var(--fg-rgb), 0.06); margin: 8px 0 4px; overflow: hidden; }
.badge-progress i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.tier-bronze { --tc: #f59e0b; }
.tier-silver { --tc: #cbd5e1; }
.tier-gold { --tc: #fbbf24; }
.tier-platinum { --tc: #a5f3fc; }
.badge.tier-bronze, .badge-card.tier-bronze:not(.locked) { border-color: rgba(245, 158, 11, 0.35); }
.badge.tier-gold, .badge-card.tier-gold:not(.locked) { border-color: rgba(251, 191, 36, 0.4); }
.badge.tier-platinum, .badge-card.tier-platinum:not(.locked) { border-color: rgba(165, 243, 252, 0.4); }
:root[data-theme='light'] .tier-silver { --tc: #64748b; }
:root[data-theme='light'] .tier-platinum { --tc: #0891b2; }
:root[data-theme='light'] .tier-gold { --tc: #b45309; }
.badge-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.km-matrix table { min-width: 900px; }
.km-matrix th, .km-matrix td { white-space: nowrap; }
.km-matrix td.zero { color: var(--dim); }
.km-matrix .cur { background: rgba(var(--accent-rgb), 0.07); }
.km-matrix tfoot td { font-weight: 700; border-top: 1px solid var(--line-2); }
.km-matrix tr.dim td { opacity: 0.6; }
.driver-cell { display: inline-flex; align-items: center; gap: 8px; color: inherit; font-weight: 600; }
.kpis-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpis-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
tr.cur-row td { background: rgba(var(--accent-rgb), 0.06); }
table.data tfoot td { font-weight: 700; border-top: 1px solid var(--line-2); }
/* Abrechnung */
.statement-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.statement-bar .spacer { flex: 1; }
.statement { max-width: 880px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 4vw, 40px); }
.statement-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 2px solid var(--line-2); }
.statement-head h1 { font-size: clamp(26px, 4vw, 34px); margin: 4px 0; }
.statement-vtc { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-2); }
.statement-meta { display: grid; gap: 6px; font-size: 13px; }
.statement-meta div { display: flex; gap: 10px; justify-content: space-between; }
.statement-meta span { color: var(--muted); }
.statement-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 20px 0; }
.statement-kpis div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.statement-kpis > div > span { display: block; font-size: 12px; color: var(--muted); }
.statement-kpis b { font-size: 20px; font-variant-numeric: tabular-nums; }
.statement h2 { font-size: 16px; margin: 26px 0 10px; }
.statement-table tr.group td { font-weight: 700; padding-top: 14px; }
.statement-table tr.item td:first-child { padding-left: 22px; color: var(--text-2); }
.statement-sum { max-width: 420px; margin-left: auto; }
.statement-sum tr.total td, .statement-table tr.total td { font-weight: 800; border-top: 2px solid var(--line-2); font-size: 15px; }
.statement-note { font-size: 12.5px; margin-top: 18px; }
@media print {
  body { background: #fff !important; color: #111 !important; }
  .topbar, .foot, .bg-glow, .no-print, .toasts, .mobile-nav, .bottom-nav { display: none !important; }
  .view { padding: 0 !important; }
  .statement { border: 0; padding: 0; max-width: none; background: #fff; color: #111; }
  .statement * { color: #111 !important; }
  .statement .muted, .statement-meta span, .statement-kpis > div > span { color: #555 !important; }
  .statement-kpis div, .statement table td, .statement table th { border-color: #ccc !important; }
  .statement a { text-decoration: none; }
}
/* Piktogramme statt Emojis */
.wtx-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--accent-rgb), 0.1); color: var(--accent-2); }
.wtx-icon svg { width: 17px; height: 17px; }
.li-icon { color: var(--accent-2); }
.li-icon svg { width: 20px; height: 20px; }
.si-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: rgba(var(--accent-rgb), 0.12); color: var(--accent-2); }
.si-icon svg { width: 26px; height: 26px; }
.si-cell svg { width: 20px; height: 20px; color: var(--accent-2); }
.chip svg, .pill svg { width: 14px; height: 14px; }
.re-icon svg { width: 16px; height: 16px; }
/* Wettbewerb */
.board-row.comp-row { grid-template-columns: 40px auto minmax(0, 1fr) 130px; cursor: default; }
.board-row.comp-row .name { flex-direction: column; align-items: flex-start; gap: 1px; }
.board-row.comp-row .name small { font-weight: 500; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.board-row.comp-row .bar { grid-column: 3 / -1; }
.board-row.comp-row .pict-box { width: 34px; height: 34px; margin: 0 auto; }
.vtc-tag { display: inline-grid; place-items: center; min-width: 46px; height: 30px; padding: 0 8px; border-radius: 9px; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); color: var(--c, var(--accent-3)); border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 35%, transparent); }
.winner.comp-winner { display: grid; grid-template-columns: 120px minmax(0, 1fr); grid-template-rows: auto auto; gap: 2px 12px; align-items: center; }
.winner.comp-winner .month { grid-row: span 2; }
.winner.comp-winner > span:nth-child(2) { display: flex; align-items: center; gap: 8px; min-width: 0; }
.winner.comp-winner > span:nth-child(2) b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.winner.comp-winner .vtc-tag { height: 24px; min-width: 38px; font-size: 11px; }
.winner.comp-winner svg { width: 13px; height: 13px; vertical-align: -2px; }
@media (max-width: 760px) { .board-row.comp-row { grid-template-columns: 34px auto minmax(0, 1fr) 96px; } }
.garage-card .row { display: flex; justify-content: space-between; gap: 10px; }
.kpis-5 .kpi .value { font-size: clamp(18px, 1.75vw, 26px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis-4 .kpi .value { font-size: clamp(20px, 2.2vw, 30px); white-space: nowrap; }
.statement-kpis b span, .statement-kpis b .amount { font-size: inherit; }
.statement table td.num, .statement table th.num, .km-matrix td.num, .km-matrix th.num, table.data td.num, table.data th.num { text-align: right; }
.badge-card .tier { display: block; }

.gauge-row .limit-sign, .gauge-row .inst { min-width: 56px; }
.gauge-row .limit-sign figcaption, .gauge-row .inst figcaption { font-size: 9.5px; letter-spacing: 0.06em; }
.mini-signs { display: flex; gap: 4px; margin-top: 5px; }
.mini-signs .limit-sign svg { filter: none; }
.mini-signs .limit-sign.vtc svg { box-shadow: 0 0 0 2px var(--accent); border-radius: 50%; }

/* Benachrichtigungen: Auswahl */
.push-kinds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

/* Bewerbungen */
.app-item {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.app-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-head > div {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.app-answers {
  margin: 10px 0 0 52px;
  display: grid;
  gap: 4px 0;
}
.app-answers dt {
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}
.app-answers dd {
  margin: 0;
  white-space: pre-wrap;
}
.app-actions {
  display: flex;
  gap: 8px;
  margin: 12px 0 0 52px;
}

/* ------------------------------------------------------------------ */
/* Ruhigere Schrift: keine gesperrten Großbuchstaben-Etiketten mehr    */
/* ------------------------------------------------------------------ */
.eyebrow,
.kpi .label,
.record .label,
table.data th,
table.leit th,
.me-card .label,
.settings-group h4,
.help-toc b,
.record-summary div > span,
.divider,
.eta-alt span,
.pal-group,
.sp-tag {
  text-transform: none;
  letter-spacing: 0;
}
.eyebrow {
  font-size: 13.5px;
  font-weight: 600;
  gap: 8px;
}
.eyebrow::after {
  display: none;
}
.kpi .label,
.me-card .label,
.record .label {
  font-size: 13px;
  font-weight: 500;
}
table.data th,
table.leit th {
  font-size: 12.5px;
  font-weight: 600;
}

/* Kompakter Leer-Hinweis (statt großer Leerfläche) */
.empty-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  color: var(--muted);
  font-size: 14.5px;
}
.empty-inline b {
  color: var(--text-2);
  font-weight: 600;
}
.empty-inline svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--dim);
}

/* Lange Listen: erst das Wichtigste, Rest auf Knopfdruck */
.collapsible.collapsed .extra {
  display: none !important;
}
.show-all {
  margin-top: 12px;
}

.grid.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Handy: breite Tabellen scrollen innerhalb ihrer Karte statt die Seite zu verbreitern */
@media (max-width: 720px) {
  .statement-table,
  .card > table.data {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
/* Lange Hinweise in Pillen dürfen umbrechen */
.job-list .pill,
.app-item .pill,
.card .pill.warn,
.card .pill.bad {
  white-space: normal;
  max-width: 100%;
}
.badge-card .tier,
.inst figcaption,
.dealer-card .brand,
.statement-vtc {
  text-transform: none;
  letter-spacing: 0;
}
.badge-card .tier {
  font-size: 12px;
  font-weight: 600;
}
/* Handy: große Beträge nicht abschneiden */
@media (max-width: 520px) {
  .statement-kpis { grid-template-columns: 1fr 1fr; }
  .statement-kpis b { font-size: clamp(14px, 4.2vw, 20px); white-space: nowrap; }
  .stat-grid { grid-template-columns: 1fr; }
}

/* ---------- Verwaltung: Seitenleiste mit Gruppen (3.14) ---------- */
.manage-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.manage-side {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
}
.manage-side .input {
  height: 36px;
  margin-bottom: 6px;
  font-size: 13.5px;
}
.ms-group + .ms-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.ms-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dim);
  padding: 4px 10px 6px;
}
.ms-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.12s, color 0.12s;
}
.ms-item svg {
  width: 17px;
  height: 17px;
  flex: none;
}
.ms-item span {
  flex: 1;
  min-width: 0;
}
.ms-item:hover {
  background: rgba(var(--fg-rgb), 0.05);
  color: var(--text);
}
.ms-item.active {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--text);
  font-weight: 600;
}
.ms-item.active svg {
  color: var(--accent-2);
}
.ms-count {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--on-accent, #fff);
}
.ms-sub {
  display: flex;
  flex-direction: column;
  margin: 2px 0 4px 27px;
  border-left: 1px solid var(--line-2);
}
.ms-sub:empty {
  display: none;
}
.ms-sub a {
  padding: 5px 10px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 0 8px 8px 0;
}
.ms-sub a:hover {
  color: var(--text);
  background: rgba(var(--fg-rgb), 0.04);
}
.manage-main {
  min-width: 0;
}
.settings-layout.single {
  grid-template-columns: minmax(0, 1fr);
}
@media (max-width: 900px) {
  .manage-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .manage-side {
    position: static;
    max-height: none;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 8px;
    gap: 6px;
    scrollbar-width: none;
  }
  .manage-side .input,
  .ms-label,
  .ms-sub {
    display: none;
  }
  .ms-group {
    display: contents;
  }
  .ms-item {
    white-space: nowrap;
    flex: none;
  }
}
.ms-count[hidden] {
  display: none;
}
.manage-side > * {
  flex-shrink: 0;
}

/* ---------- Startseite: Zu erledigen (Leitung) ---------- */
.todo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 18px 0 4px;
}
.todo-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
a.todo-card:hover {
  border-color: var(--line-accent);
  transform: translateY(-1px);
}
.todo-card > svg:first-child {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--accent-2);
}
.todo-card.warn > svg:first-child {
  color: #f5b544;
}
.todo-card.ok > svg:first-child {
  color: #34d399;
}
.todo-card span {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--muted);
}
.todo-card span b {
  font-size: 18px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.todo-card .go {
  width: 16px;
  height: 16px;
  color: var(--dim);
}
.setup-done {
  margin-top: 10px;
}
.setup-done summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}
.setup-done summary::-webkit-details-marker {
  display: none;
}
.setup-done summary svg {
  width: 14px;
  height: 14px;
  color: #34d399;
}

/* Verwaltung → Fahrer: kompakte Tabelle */
.users-table td {
  vertical-align: middle;
}
.users-table .uc-name {
  display: flex;
  align-items: center;
  gap: 4px;
}
.users-table .uc-meta {
  font-size: 12px;
  margin-top: 1px;
}
.users-table .uc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.users-table .uc-pills .pill {
  font-size: 11px;
  padding: 2px 8px;
}
.users-table .uc-role {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 170px;
  max-width: 220px;
}
.users-table .row-actions {
  text-align: right;
  white-space: nowrap;
}
.users-table .row-actions .btn + .btn {
  margin-left: 6px;
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
}
.btn.ghost:hover {
  background: rgba(var(--fg-rgb), 0.06);
}
/* Verwaltung: Inhalte mit Seitenleiste – zweispaltige Layouts erst ab breitem Fenster */
@media (max-width: 1360px) {
  .manage-main .grid-main,
  .manage-main .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Handy: Rollen-Zeilen und Fahrer-Tabelle als Karten */
@media (max-width: 700px) {
  .role-row {
    grid-template-columns: 14px minmax(0, 1fr) !important;
  }
  .role-row .tools {
    grid-column: 2;
    justify-content: flex-start;
    margin-top: 8px;
  }
  .card-head {
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .users-table thead {
    display: none;
  }
  .users-table,
  .users-table tbody,
  .users-table tr,
  .users-table td {
    display: block;
    width: 100%;
  }
  .users-table tr {
    position: relative;
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
  }
  .users-table td {
    padding: 0 !important;
    border: 0 !important;
  }
  .users-table td + td {
    margin-top: 10px;
  }
  .users-table .uc-role {
    max-width: none;
    flex-direction: row;
  }
  .users-table .uc-role > * {
    flex: 1;
    min-width: 0;
  }
  .users-table td:nth-child(3) {
    position: absolute;
    top: 14px;
    right: 4px;
    width: auto;
    margin: 0;
  }
  .users-table .row-actions {
    text-align: left;
  }
}
@media (max-width: 700px) {
  .role-row {
    align-items: start;
  }
  .role-row .swatch {
    margin-top: 4px;
  }
}

/* Lade-Platzhalter */
.skeleton {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0 24px;
}
.sk-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.sk-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
}
.sk {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(var(--fg-rgb), 0.05) 0%, rgba(var(--fg-rgb), 0.1) 40%, rgba(var(--fg-rgb), 0.05) 80%);
  background-size: 300% 100%;
  animation: sk-shine 1.4s ease-in-out infinite;
}
.sk-kpi {
  height: 86px;
  border-radius: 14px;
}
.sk-line {
  height: 14px;
}
.sk-line.w40 {
  width: 40%;
  height: 18px;
}
.sk-line.w55 {
  width: 55%;
}
.sk-line.w70 {
  width: 70%;
}
@keyframes sk-shine {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sk {
    animation: none;
  }
}

/* Handy: Abrechnungs-Tabellen passen in die Breite */
@media (max-width: 520px) {
  .statement table.data td,
  .statement table.data th {
    padding-left: 6px !important;
    padding-right: 6px !important;
    font-size: 12.5px;
  }
  .statement table.data {
    table-layout: auto;
    width: 100%;
  }
  .statement .statement-table td:first-child {
    max-width: 110px;
    overflow-wrap: anywhere;
  }
  .statement {
    overflow-x: auto;
  }
}
@media (max-width: 520px) {
  .statement .payroll tr > *:nth-child(2),
  .statement .payroll tr > *:nth-child(4),
  .statement .payroll tr > *:nth-child(5),
  .statement .payroll tr > *:nth-child(6) {
    display: none;
  }
}

/* Fahrschule / Probezeit */
.prob-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.025);
}
.prob-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.prob-head b {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.prob-head b svg {
  width: 18px;
  height: 18px;
  color: var(--accent-2);
}
.progress.ok i {
  background: #34d399;
}
.prob-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 6px 18px;
}
.prob-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
}
.prob-list li svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--dim);
}
.prob-list li.ok {
  color: var(--text);
}
.prob-list li.ok svg {
  color: #34d399;
}
.prob-list li span {
  flex: 1;
}
.prob-list li em {
  font-style: normal;
  font-size: 12.5px;
  color: var(--dim);
  white-space: nowrap;
}
.prob-box.compact .prob-list {
  grid-template-columns: 1fr;
}
.prob-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 14px;
}
.prob-card .prob-box {
  margin-top: 4px;
}
@media (max-width: 520px) {
  .prob-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Ziele & Challenges ---------- */
.goal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}
.goal-grid.past .goal-card {
  opacity: 0.85;
}
.sub-title {
  font-size: 18px;
  margin: 34px 0 14px;
}
.goal-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.goal-top {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
}
.goal-top h3 {
  margin: 4px 0 0;
  font-size: 19px;
}
.goal-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.goal-meta svg {
  width: 15px;
  height: 15px;
  color: var(--accent-2);
}
.goal-desc {
  margin: 6px 0 0;
  font-size: 14px;
}
.goal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.goal-tools {
  display: flex;
  gap: 6px;
  flex: none;
}
.goal-nums {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}
.goal-nums b {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}
.goal-pct {
  margin-left: auto;
  font-weight: 700;
  color: var(--accent-2);
}
.progress.lg {
  height: 10px;
}
.goal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.goal-helpers {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.avatars {
  display: flex;
}
.avatars a + a {
  margin-left: -8px;
}
.avatars .avatar,
.avatars img {
  box-shadow: 0 0 0 2px var(--card);
  border-radius: 50%;
}
.goal-reward {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 600;
}
.goal-reward svg {
  width: 15px;
  height: 15px;
  color: #f5b544;
}
@media (max-width: 520px) {
  .goal-grid {
    grid-template-columns: 1fr;
  }
}
/* Startseite: laufendes Ziel */
.home-goals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.home-goal {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.home-goal:hover {
  border-color: var(--line-accent);
}
.home-goal .hg-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.home-goal b {
  font-size: 15px;
}

/* ---------- Stammkunden & Verträge ---------- */
.cust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 16px;
}
.cust-card {
  display: flex;
  flex-direction: column;
}
.cust-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.cust-title h3 {
  margin: 0;
}
.cust-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent-ink);
  flex: none;
}
.cust-rep {
  display: flex;
  gap: 6px;
  align-items: center;
}
.contracts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contract {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.025);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contract.inactive {
  opacity: 0.6;
}
.ct-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ct-tools {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.ct-what {
  font-size: 12.5px;
}
.ct-money,
.ct-history {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ct-history .pill {
  font-size: 11px;
  padding: 1px 7px;
}
.ct-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
@media (max-width: 520px) {
  .cust-grid {
    grid-template-columns: 1fr;
  }
}
.home-goal .hg-top span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.home-goal .hg-top svg {
  width: 14px;
  height: 14px;
  color: var(--accent-2);
}
.prob-card .user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}
.prob-card .card-head {
  flex-wrap: wrap;
  row-gap: 10px;
}
.home-prob .prob-box {
  margin-top: 16px;
  background: var(--card);
  padding: 18px 20px;
}
.goal-pct {
  white-space: nowrap;
}
@media (max-width: 520px) {
  .goal-nums {
    flex-wrap: wrap;
  }
  .goal-nums b {
    font-size: 21px;
  }
}

/* ==========================================================================
   Bedienelemente 3.17 – ein einheitliches, ruhiges System
   Knöpfe, Eingabefelder, Auswahllisten, Reiter, Filter, Schalter:
   gleiche Höhen (38/32/26/44), gleiche Ecken (10 px), keine Leucht-Schatten,
   sichtbarer Tastatur-Fokus. Statusplaketten (.pill) bleiben rund.
   ========================================================================== */
:root {
  --ctl-r: 10px;
  --ctl-h: 38px;
  --ctl-bg: rgba(var(--fg-rgb), 0.04);
  --ctl-bg-hover: rgba(var(--fg-rgb), 0.075);
  --ctl-line: rgba(var(--fg-rgb), 0.12);
  --ctl-line-hover: rgba(var(--fg-rgb), 0.22);
  --focus-ring: 0 0 0 3px rgba(var(--accent-rgb), 0.28);
}

/* ---------- Knöpfe ---------- */
.btn {
  height: var(--ctl-h);
  padding: 0 16px;
  gap: 7px;
  border-radius: var(--ctl-r);
  border: 1px solid var(--ctl-line);
  background: var(--ctl-bg);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, filter 0.15s, transform 0.1s;
}
.btn:hover {
  background: var(--ctl-bg-hover);
  border-color: var(--ctl-line-hover);
}
.btn:active {
  transform: translateY(0.5px);
}
.btn:focus-visible,
.icon-btn:focus-visible,
.tabs button:focus-visible,
.seg button:focus-visible,
.chip:focus-visible,
.nav-trigger:focus-visible,
.nav-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.btn.primary {
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--on-accent, #fff);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.btn.primary:hover {
  background: var(--accent);
  filter: brightness(1.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.btn.primary:focus-visible {
  box-shadow: var(--focus-ring);
}
.btn.danger {
  color: var(--bad-ink);
}
.btn.danger:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.45);
  color: var(--bad-ink);
}
.btn.danger.solid {
  background: #dc2626;
  border-color: transparent;
  color: #fff;
}
.btn.danger.solid:hover {
  background: #dc2626;
  filter: brightness(1.08);
  color: #fff;
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
}
.btn.ghost:hover {
  background: var(--ctl-bg-hover);
  border-color: transparent;
}
.btn.discord {
  border-color: transparent;
}
.btn.sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 9px;
}
.btn.xs {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 7px;
}
.btn.lg {
  height: 44px;
  padding: 0 22px;
  font-size: 14.5px;
  border-radius: 11px;
}
.btn.icon {
  width: var(--ctl-h);
  padding: 0;
}
.btn.sm.icon {
  width: 32px;
}
.btn.xs.icon {
  width: 26px;
}
.btn.sm svg {
  width: 15px;
  height: 15px;
}
.btn.xs svg {
  width: 13px;
  height: 13px;
}
.btn[disabled],
.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
  filter: none;
}
/* Kleine Löschen/Bearbeiten-Knöpfe in Listen: dezent, erst beim Drüberfahren betont */
.btn.icon.danger:not(:hover) {
  color: var(--muted);
}

/* ---------- Kopfzeile ---------- */
.icon-btn {
  height: 36px;
  border-radius: var(--ctl-r);
  border-color: var(--ctl-line);
  background: transparent;
}
.icon-btn:hover {
  background: var(--ctl-bg-hover);
  border-color: var(--ctl-line-hover);
}
.nav-trigger,
.nav-link {
  border-radius: 9px;
}
.nav-link.active,
.nav-group.active .nav-trigger {
  background: rgba(var(--accent-rgb), 0.12);
  box-shadow: none;
}

/* ---------- Eingabefelder & Auswahllisten ---------- */
.input,
.select {
  height: var(--ctl-h);
  border-radius: var(--ctl-r);
  border: 1px solid var(--ctl-line);
  background-color: var(--ctl-bg);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.input::placeholder {
  color: var(--dim);
}
.input:hover:not(:disabled):not(:focus),
.select:hover:not(:disabled) {
  border-color: var(--ctl-line-hover);
}
.input:focus,
.select:focus,
.dd-btn.open,
.dd-btn:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
  outline: none;
}
.textarea,
textarea.input {
  height: auto;
  min-height: 84px;
  padding: 10px 14px;
  line-height: 1.5;
}
.dd-pop {
  border-radius: 12px;
}
.dd-item {
  border-radius: 7px;
}

/* ---------- Reiter / Umschalter (alle gleich) ---------- */
.tabs,
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.035);
}
.tabs button,
.tabs a,
.seg button {
  height: 32px;
  padding: 0 13px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s, color 0.15s;
}
.tabs button:hover,
.seg button:hover {
  color: var(--text);
  background: rgba(var(--fg-rgb), 0.05);
}
.tabs button.active,
.seg button.active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 0 0 1px var(--line-2);
}
/* Knöpfe, die in einer Reiter-Leiste stehen (z. B. „Fuhrpark“ zurück) */
.tabs .btn {
  height: 32px;
  border-radius: 9px;
}

/* ---------- Filter-Chips ---------- */
.chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--ctl-line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover {
  color: var(--text);
  border-color: var(--ctl-line-hover);
  background: rgba(var(--fg-rgb), 0.04);
}
.chip.active {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.13);
}

/* ---------- Schalter & Häkchen ---------- */
.switch {
  width: 36px;
  height: 20px;
}
.switch span {
  background: rgba(var(--fg-rgb), 0.16);
  transition: background-color 0.18s;
}
.switch span::before {
  width: 14px;
  height: 14px;
  top: 3px;
  left: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s;
}
.switch input:checked + span::before {
  transform: translateX(16px);
}
.switch input:focus-visible + span {
  box-shadow: var(--focus-ring);
}
.switch input:disabled + span {
  opacity: 0.45;
  cursor: not-allowed;
}
.check input,
.perm input,
input[type='checkbox'],
input[type='radio'] {
  accent-color: var(--accent);
}
.check input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}
.perm {
  border-radius: var(--ctl-r);
  transition: border-color 0.15s, background-color 0.15s;
}
.perm:hover {
  border-color: var(--ctl-line-hover);
}
.perm:has(input:checked) {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.07);
}

/* ---------- Text-Links als Knopf ---------- */
.link-btn {
  border-radius: 6px;
}
.link-btn:focus-visible,
a.more:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 6px;
}

/* Dialoge: Knopfleiste rechtsbündig, gleiche Abstände */
.modal .actions {
  gap: 8px;
}
.tabs,
.seg {
  flex-wrap: wrap;
}

/* ---------- Garagen: Ausbauten & Personal ---------- */
.garage-block {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.gb-head {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.gb-upgrades {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.gb-up {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px dashed var(--ctl-line-hover, rgba(var(--fg-rgb), 0.22));
  background: transparent;
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
button.gb-up:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.07);
}
.gb-up > svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.gb-up span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.gb-up b {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gb-up small {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gb-up.built {
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.07);
  cursor: default;
}
.gb-up.built > svg:first-child {
  color: #34d399;
}
.gb-up .ok {
  width: 15px;
  height: 15px;
  color: #34d399;
}
.gb-up.off {
  opacity: 0.6;
  cursor: default;
}
.gb-staff {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gb-person {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gb-person .grow {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.gb-person b {
  font-size: 13.5px;
}
.gb-person small {
  font-size: 12px;
  color: var(--muted);
}
.gb-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(var(--fg-rgb), 0.08);
  color: var(--text-2);
  flex: none;
}
.gb-hire {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
@media (max-width: 520px) {
  .gb-upgrades {
    grid-template-columns: 1fr;
  }
}
/* Verträge & Kosten: automatische Betriebskosten */
.ops-card {
  margin-top: 14px;
}
.ops-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ops-card h3 svg {
  width: 18px;
  height: 18px;
  color: var(--accent-2);
}
.ops-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}
.ops-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.02);
}
.ops-item span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 13.5px;
}
.ops-item small {
  font-size: 12px;
  color: var(--muted);
}
.ops-item em {
  font-style: normal;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ops-item.zero {
  opacity: 0.65;
}
.ops-item.zero em {
  color: #34d399;
}
.garage-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
}
.gb-upgrades {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.gb-upgrades {
  grid-template-columns: 1fr;
  gap: 6px;
}
.gb-up b,
.gb-up small {
  white-space: normal;
}
.garage-top .grow,
.gb-person .grow {
  flex: 1;
  min-width: 0;
}

/* v3.19 Versicherungen */
.ins-card {
  margin-top: 14px;
}
.ins-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ins-card h3 svg {
  width: 18px;
  height: 18px;
  color: var(--accent-2);
}
.ins-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 10px;
}
.ins-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.02);
}
.ins-item.on {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.06);
}
.ins-item.mandatory {
  border-style: dashed;
  opacity: 0.85;
}
.ins-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ins-top .grow {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ins-top small {
  font-size: 12px;
  color: var(--muted);
}
.ins-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(var(--fg-rgb), 0.06);
  flex-shrink: 0;
}
.ins-icon svg {
  width: 18px;
  height: 18px;
}
.ins-item.on .ins-icon {
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
}
.ins-item p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}
.ins-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  font-size: 13px;
}
.gb-role-desc {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

/* v3.20 Alpha-Phase */
.stage-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  white-space: nowrap;
}
.brand .stage-pill {
  margin-left: 4px;
  align-self: center;
}
.alphabar {
  border-bottom: 1px solid rgba(251, 191, 36, 0.2);
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.08), rgba(251, 191, 36, 0.02));
  font-size: 13px;
}
.alphabar .wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 7px;
  padding-bottom: 7px;
}
.alphabar .grow {
  flex: 1;
  min-width: 0;
  color: var(--muted);
}
.alphabar .btn.xs,
.alphabar .icon-btn.xs {
  height: 28px;
  font-size: 12.5px;
}
.alphabar .icon-btn.xs {
  width: 28px;
  min-width: 28px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}
.alphabar .icon-btn.xs svg {
  width: 15px !important;
  height: 15px !important;
  display: block;
}
.alphabar .ab-short { display: none; }
@media (max-width: 720px) {
  .alphabar .ab-long { display: none; }
  .alphabar .ab-short { display: inline; }
  .alphabar .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .alphabar .btn.ghost { display: none; }
}
/* Filterleisten am Handy: Chips in einer wischbaren Zeile, Suche/Auswahl darunter in voller Breite */
@media (max-width: 640px) {
  .toolbar { flex-wrap: wrap; }
  .toolbar > .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .toolbar > .chips::-webkit-scrollbar { display: none; }
  .toolbar > .chips .chip { flex: none; }
  .toolbar > .spacer { display: none; }
  .toolbar > .input, .toolbar > .select { flex: 1 1 140px; width: auto !important; min-width: 0; }
}
.menu button[data-feedback] {
  width: 100%;
}
.changelog {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cl-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.cl-head .dim {
  font-size: 12.5px;
}
.cl-ver {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(var(--fg-rgb), 0.07);
}
.cl-entry ul {
  margin: 8px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  line-height: 1.5;
}
.cl-entry + .cl-entry {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.fb-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fb-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fb-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.fb-top .grow {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.fb-top small {
  font-size: 12px;
}
.fb-kind {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  background: rgba(var(--fg-rgb), 0.06);
}
.fb-kind svg {
  width: 18px;
  height: 18px;
}
.fb-kind.k-bug {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}
.fb-kind.k-idea {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
}
.fb-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.5;
}
.fb-note {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.07);
  border: 1px solid rgba(52, 211, 153, 0.25);
  font-size: 13.5px;
}
.fb-note svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  color: #34d399;
}
.fb-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.fb-actions .grow {
  flex: 1;
}
.fb-actions {
  flex-wrap: wrap;
}
.fb-note-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.fb-note-by {
  color: var(--muted, #9ca3af);
  font-size: 12px;
}
.fb-note-by b {
  color: var(--text, inherit);
  font-weight: 600;
}
.fb-actions .select.sm {
  width: auto;
  min-width: 170px;
}
.alpha-testers {
  width: 100%;
  min-height: 90px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 13px;
}

/* v3.20.1 Rechtliches */
.legal-wrap {
  max-width: 860px;
  margin: 0 auto;
}
.legal-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.legal-tabs a {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}
.legal-tabs a.active {
  background: rgba(var(--fg-rgb), 0.08);
  color: var(--text);
  border-color: var(--line-2);
}
.legal {
  line-height: 1.6;
  font-size: 14.5px;
}
.legal h2 {
  margin: 0 0 6px;
  font-size: 26px;
}
.legal h3 {
  margin: 22px 0 6px;
  font-size: 16px;
}
.legal p,
.legal ul {
  margin: 0 0 10px;
  color: var(--text-2);
}
.legal ul {
  padding-left: 20px;
}
.legal a {
  color: var(--accent-2);
}
.legal-missing {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border-radius: 4px;
  padding: 0 4px;
}
.legal-warn {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
  font-size: 13.5px;
}
.legal-warn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #fbbf24;
}
.terms-modal h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.terms-modal h3 svg {
  width: 20px;
  height: 20px;
  color: var(--accent-2);
}
.terms-points {
  margin: 4px 0 14px;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
}
.terms-modal .check a {
  color: var(--accent-2);
}

/* v3.25 Logo */
.brand-mark:has(.logo-img) {
  background: none;
  border: 0;
  overflow: hidden;
  box-shadow: 0 0 22px -6px rgba(167, 139, 250, 0.55);
}
.logo-img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
}

/* Menü 3.27: Icons in der Leiste, Einleitung im Dropdown, Abschnitte im Profil-Menü */
.nav-link .nav-ic,
.nav-trigger .nav-ic {
  width: 15px;
  height: 15px;
  margin-right: 3px;
  opacity: 0.75;
}
.nav-link.active .nav-ic,
.nav-group.active .nav-ic {
  opacity: 1;
  color: var(--accent-2);
}
.nav-drop .nd-intro {
  padding: 6px 12px 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.menu .menu-sec {
  padding: 10px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (max-width: 1080px) {
  .nav-trigger .nav-ic,
  .nav-link .nav-ic {
    margin-right: 8px;
  }
  .nav-trigger .chev {
    margin-left: auto;
  }
}

/* Wettbewerb 3.27: Monatssieger und Abzeichen */
.comp-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 18px; }
.comp-champ { display: flex; gap: 14px; align-items: center; background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), transparent 60%), var(--card-bg, transparent); border-color: rgba(251, 191, 36, 0.28); }
.comp-champ .pict-box { width: 48px; height: 48px; }
.comp-champ .eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #fbbf24; }
.comp-champ .champ-name { display: flex; align-items: center; gap: 8px; margin: 4px 0 2px; font-size: 17px; min-width: 0; flex-wrap: wrap; }
.comp-champ .dim { font-size: 13px; }
.vtc-badges { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.mini-badge { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: rgba(var(--accent-rgb), 0.12); color: var(--accent-2); }
.mini-badge svg { width: 13px; height: 13px; }
.mini-badge.gold { background: rgba(251, 191, 36, 0.16); color: #fbbf24; }
.mini-badge.silver { background: rgba(203, 213, 225, 0.16); color: #cbd5e1; }
.mini-badge.bronze { background: rgba(217, 119, 6, 0.18); color: #f59e0b; }
.mini-badge.platinum { background: rgba(167, 139, 250, 0.2); color: #c4b5fd; }
.pict-box.platinum { background: rgba(167, 139, 250, 0.18); color: #c4b5fd; }
.board-row.comp-row .name small svg { width: 12px; height: 12px; vertical-align: -1px; }

/* Hilfe 3.27: Schnellzugriff und Suche */
.help-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.help-tile { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(var(--fg-rgb), 0.02); color: var(--text); font-weight: 600; font-size: 14px; transition: border-color 0.15s, background 0.15s; }
.help-tile:hover { border-color: var(--line-accent); background: rgba(var(--accent-rgb), 0.08); }
.help-tile svg { width: 20px; height: 20px; color: var(--accent-2); flex: none; }
.help-search { position: relative; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.help-search > svg { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.help-search .input { padding-left: 38px; max-width: 520px; }
.help-search #help-hits { font-size: 13px; }
.help-sec[hidden], .help-toc a[hidden] { display: none !important; }

/* Startseite 3.27 */
.first-steps { margin-bottom: 14px; }
.first-steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.first-steps li { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(var(--fg-rgb), 0.02); }
.first-steps li > div { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 2px; }
.first-steps li span:not(.fs-dot) { font-size: 13px; color: var(--muted); }
.first-steps li.next { border-color: var(--line-accent); background: rgba(var(--accent-rgb), 0.07); }
.first-steps li.done b { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(var(--fg-rgb), 0.25); }
.first-steps .fs-dot { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; background: rgba(var(--fg-rgb), 0.06); color: var(--text-2); flex: none; }
.first-steps li.done .fs-dot { background: rgba(34, 197, 94, 0.16); color: #4ade80; }
.first-steps li.next .fs-dot { background: var(--accent); color: #fff; }
.first-steps .fs-dot svg { width: 14px; height: 14px; }
.setup-open > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13.5px; color: var(--text-2); }
.setup-open > summary::-webkit-details-marker { display: none; }
.setup-open > summary svg { width: 15px; height: 15px; transition: transform 0.15s; }
.setup-open[open] > summary svg { transform: rotate(180deg); }
.setup-open[open] > summary { margin-bottom: 8px; }

/* Website-Start 3.27 */
.vtc-item[hidden] { display: none; }
.welcome-stats { display: flex; justify-content: center; gap: 34px; flex-wrap: wrap; margin-top: 26px; }
.welcome-stats > div { display: flex; flex-direction: column; align-items: center; }
.welcome-stats b { font-size: 26px; letter-spacing: -0.02em; }
.welcome-stats span { font-size: 13px; color: var(--muted); }
.welcome-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.welcome-features .wf { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: rgba(var(--fg-rgb), 0.02); }
.welcome-features .wf svg { width: 22px; height: 22px; color: var(--accent-2); margin-bottom: 4px; }
.welcome-features .wf b { font-size: 15px; }
.welcome-features .wf span { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.welcome-steps ol { margin: 0; padding: 0; list-style: none; counter-reset: ws; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.welcome-steps li { counter-increment: ws; display: flex; flex-direction: column; gap: 4px; padding-left: 44px; position: relative; }
.welcome-steps li::before { content: counter(ws); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: rgba(var(--accent-rgb), 0.16); color: var(--accent-2); }
.welcome-steps li span { font-size: 13.5px; color: var(--muted); }
@media (max-width: 640px) {
  .board-row.abs-row { grid-template-columns: 36px minmax(0, 1fr) !important; }
  .board-row.abs-row .abs-acts { grid-column: 2; flex-wrap: wrap; }
}

/* v3.28 Speditions-Logos */
.brand-mark.has-logo { background: rgba(var(--fg-rgb), 0.04); overflow: hidden; padding: 0; }
.brand-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.vtc-logo.img { background: rgba(var(--fg-rgb), 0.05); overflow: hidden; padding: 3px; }
.vtc-logo.img img, .vtc-tag.img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.vtc-tag.img { min-width: 30px; width: 30px; padding: 2px; background: rgba(var(--fg-rgb), 0.05); border-color: var(--line); }
.logo-edit { display: flex; gap: 16px; align-items: flex-start; }
.logo-prev { width: 84px; height: 84px; flex: none; border-radius: 18px; display: grid; place-items: center; overflow: hidden; background: rgba(var(--fg-rgb), 0.05); border: 1px solid var(--line); }
.logo-prev img { width: 100%; height: 100%; object-fit: contain; }
.logo-prev b { width: 100%; height: 100%; display: grid; place-items: center; background: var(--c, var(--accent)); color: #fff; font-size: 18px; }
.logo-edit label.btn { cursor: pointer; }
.setup-card .card-head { flex-wrap: nowrap; align-items: flex-start; }
.setup-card .card-head h3 { flex: 1; min-width: 0; }
.cl-entry.latest { padding: 16px 18px; margin: -4px -6px 4px; border-radius: 14px; background: rgba(var(--accent-rgb), 0.07); border: 1px solid var(--line-accent); }
.cl-entry.latest + .cl-entry { border-top: 0; padding-top: 4px; }
.cl-new { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; background: var(--accent); color: #fff; }
.news-dlg .changelog { max-height: 60vh; overflow: auto; }
.news-dlg h3 { display: flex; align-items: center; gap: 8px; margin-top: 0; }

/* Garagen 3.30: Ausbaustufen */
.lv-pips { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.lv-pips i { width: 7px; height: 7px; border-radius: 50%; background: rgba(var(--fg-rgb), 0.15); }
.lv-pips i.on { background: var(--accent-2); box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.6); }
.lv-max { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding: 3px 7px; border-radius: 6px; background: rgba(var(--fg-rgb), 0.06); }
.gb-up.built.branch { border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.06); }
.gb-up.built.branch > svg { color: #fbbf24; }
.gb-up.built .btn.xs { margin-left: auto; flex: none; }
.pill.branch-pill { background: rgba(251, 191, 36, 0.14); color: #fbbf24; border-color: rgba(251, 191, 36, 0.3); }
tr.lv-row td { border-top-color: transparent; }
.gb-upgrades { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gb-up .lv-pips { display: inline-flex; flex-direction: row; flex: none; }
.gb-up .lv-max { flex: none; }
@media (max-width: 640px) { .gb-upgrades { grid-template-columns: 1fr; } }
.brand-mark svg.logo-img { width: 100%; height: 100%; }
.brand-mark:has(.logo-img) { box-shadow: none; }

/* Plattform: feste Wirtschaftswerte */
.eco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px 22px;
  font-size: 13px;
}
.eco-grid b {
  display: block;
  margin-bottom: 6px;
}
.eco-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.eco-row span:last-child {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.eco-row .eco-changed {
  color: var(--accent-ink, var(--accent));
  font-weight: 600;
}

/* Zwei-Faktor einrichten */
.mfa-setup {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin: 6px 0 14px;
}
.mfa-qr {
  width: 180px;
  height: 180px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  flex: none;
}
.mfa-qr svg {
  width: 100%;
  height: 100%;
  display: block;
}
.mfa-secret {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  letter-spacing: 0.5px;
  user-select: all;
  word-break: break-all;
}
.mfa-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 4px;
}
.mfa-codes code {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  font-size: 15px;
  user-select: all;
}

/* Öffentliche Statusseite */
.status-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  margin-bottom: 14px;
}
.status-hero b {
  display: block;
  font-size: 20px;
}
.status-hero small {
  color: var(--muted);
}
.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: none;
  background: #34d399;
  box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.15);
}
.st-slow .status-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.15);
}
.st-down .status-dot {
  background: #ef4444;
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.15);
}
.status-list {
  padding: 4px 18px;
}
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.status-row:last-child {
  border-bottom: 0;
}

/* Fahrstil-Sterne */
.stars {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin-top: 6px;
}
.stars svg {
  width: 16px;
  height: 16px;
  fill: var(--line);
}
.stars svg.on {
  fill: #f59e0b;
}
.embed-code {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12.5px;
  resize: none;
  user-select: all;
}

/* Duelle */
.duel-list {
  display: grid;
  gap: 12px;
}
.duel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.duel.active {
  border-color: var(--accent);
}
.duel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.duel-head .pill {
  margin-left: auto;
}
.duel-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}
.duel-score {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.duel-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
  margin-top: 6px;
}
.duel-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.duel-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
/* Was ist neu: luftiger – Überschrift fett, Erklärung darunter, Punkte als Akzent */
.cl-entry ul { gap: 10px; padding-left: 0; list-style: none; margin-top: 12px; }
.cl-entry li { position: relative; padding-left: 18px; line-height: 1.55; }
.cl-entry li::before { content: ''; position: absolute; left: 2px; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0.85; }
.cl-entry li b { display: block; font-weight: 650; }
.cl-entry li span { display: block; color: var(--muted, var(--fg-2)); font-size: 13.5px; }
/* Tracker-Download auf der Startseite */
.dl-card { display: flex; align-items: center; gap: 14px; max-width: 520px; margin: 18px auto 0; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-accent, var(--line)); background: rgba(var(--accent-rgb), 0.08); color: inherit; text-decoration: none; text-align: left; transition: background 0.15s, transform 0.15s; }
.dl-card:hover { background: rgba(var(--accent-rgb), 0.14); transform: translateY(-1px); }
.dl-ic { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent); color: #fff; }
.dl-ic .i, .dl-ic svg { width: 20px; height: 20px; }
.dl-txt { flex: 1; min-width: 0; }
.dl-txt b { display: block; font-size: 15px; }
.dl-txt span { display: block; font-size: 12.5px; color: var(--muted); }
.dl-go { flex: none; color: var(--muted); }
.foot-by { opacity: 0.75; white-space: nowrap; }
/* Kopf: immer Truck Desk, die Spedition klein daneben */
.brand-vtc { display: inline-flex; align-items: center; gap: 8px; margin-left: 4px; padding: 4px 10px 4px 4px; border-left: 1px solid var(--line); padding-left: 12px; font-size: 13px; font-weight: 600; color: var(--muted); max-width: 220px; }
.brand-vtc img { width: 26px; height: 26px; border-radius: 7px; object-fit: contain; background: rgba(var(--fg-rgb), 0.05); flex: none; }
.brand-vtc > span:not(.vtc-honors) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) { .brand-vtc > span:not(.vtc-honors) { display: none; } }
/* Fahrerkarte Rückseite: alles passt in die Karte, Knopf immer ganz sichtbar */
.flip-face.back .back-kv { margin-top: 12px; gap: 10px 14px; }
.flip-face.back .back-kv b { font-size: 15px; }
.flip-face.back .back-badges { margin-top: 12px; min-height: 0; }
.flip-face.back .badge-row.one { flex-wrap: nowrap; overflow: hidden; }
.flip-face.back .back-open { margin-top: auto; align-self: flex-start; flex: none; }
.repair-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.repair-list b { color: var(--text); }
.rel-state { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 4px 0 10px; }
.rel-state div { padding: 8px 10px; border-radius: 10px; background: rgba(var(--fg-rgb), 0.04); border: 1px solid var(--line); min-width: 0; }
.rel-state span { display: block; font-size: 11.5px; color: var(--muted); }
.rel-state b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.rel-hist { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; margin-bottom: 12px; }
@media (max-width: 640px) { .rel-state { grid-template-columns: 1fr; } }
/* Mein Monat: Fahrstil-Trend und Weg zum nächsten Rang */
.trend { font-size: 12px; font-weight: 700; margin-left: 4px; }
.trend.up { color: var(--ok, #34d399); }
.trend.down { color: var(--warn, #fbbf24); }
.next-rank { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.next-rank b { color: var(--text); }
.nr-bar { height: 5px; border-radius: 3px; background: rgba(var(--fg-rgb), 0.08); margin-top: 5px; overflow: hidden; }
.nr-bar i { display: block; height: 100%; border-radius: 3px; }
.terr td { vertical-align: top; }
.terr-text { font-family: var(--mono, ui-monospace, monospace); font-size: 12px; word-break: break-word; }

/* Handy: Kopfzeile passt immer in die Breite (Menü-Knopf nie außerhalb) */
@media (max-width: 480px) {
  .topbar .wrap { gap: 10px; }
  .brand { flex-shrink: 1; min-width: 0; overflow: hidden; gap: 8px; }
  .brand-text { display: none; }
  .brand .stage-pill { display: none; }
  .brand-vtc { border-left: 0; padding-left: 0; margin-left: 0; }
  .top-actions { flex-shrink: 0; }
}
@media (max-width: 480px) {
  .earn-tx td:first-child { display: none; }
  .earn-tx td { padding-left: 6px; padding-right: 6px; }
  .earn-tx td:last-child { white-space: nowrap; }
}
.fleet-eco td a { color: inherit; }
.fleet-eco .pill { white-space: nowrap; }

/* Auszeichnungen einer Spedition: Partner, Spedition des Monats, Kilometer-König */
.vtc-honors { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: -4px; flex: none; }
.honor { display: inline-flex; align-items: center; gap: 5px; height: 20px; min-width: 20px; padding: 0 4px; justify-content: center; border-radius: 6px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.honor svg { width: 12px; height: 12px; flex: none; }
.honor.partner { background: rgba(56, 189, 248, 0.16); color: #38bdf8; box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.35); }
.honor.gold { background: rgba(251, 191, 36, 0.16); color: #fbbf24; box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.35); }
.honor.platinum { background: rgba(196, 181, 253, 0.16); color: #c4b5fd; box-shadow: inset 0 0 0 1px rgba(196, 181, 253, 0.4); }
.brand-vtc .vtc-honors { margin-left: 2px; }
.brand-vtc .honor { height: 18px; min-width: 18px; padding: 0 3px; }
/* In der Kopfzeile nur, wenn genug Platz ist – die Startseite zeigt sie immer mit Beschriftung */
@media (max-width: 1599px) { .brand-vtc .vtc-honors { display: none; } }
.hero-honors { margin-top: 10px; }
.hero-honors .vtc-honors { margin-left: 0; gap: 8px; flex-wrap: wrap; }
.hero-honors .honor { height: 26px; padding: 0 10px 0 8px; font-size: 12.5px; border-radius: 8px; }
.hero-honors .honor svg { width: 14px; height: 14px; }
