/* ==========================================================================
   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, #2a1d4f, 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: fadeUp 0.35s ease both;
}

.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, #9b6dff, var(--accent-deep));
  color: white;
  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);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  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, #2e1065, var(--accent-deep), #a78bfa, #f5f3ff);
}

.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: center;
  justify-content: center;
  gap: 18px;
  margin-top: 4px;
  width: 100%;
}

.limit-sign {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: white;
  border: 6px solid #e11d48;
  color: #111;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.limit-sign.none {
  border-color: #475569;
  color: #64748b;
  font-size: 14px;
}

.gear {
  min-width: 54px;
  height: 54px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  background: rgba(var(--fg-rgb), 0.03);
}

.cruise {
  font-size: 12px;
  color: var(--muted);
  text-align: left;
  line-height: 1.3;
}

.cruise b {
  display: block;
  color: var(--ok);
  font-size: 16px;
}

.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, #2a1d4f, 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 – Stempeluhr (Dienst an/ab) & Singleplayer-Aufträge
   ========================================================================== */

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

.duty-wrap {
  position: relative;
}

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

.duty-chip:hover {
  border-color: var(--line-accent);
  color: var(--text);
}

.duty-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
}

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

.duty-chip.on .dot {
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
}

.duty-chip.break {
  border-color: rgba(251, 191, 36, 0.35);
  color: var(--warn-ink);
}

.duty-chip.break .dot {
  background: var(--warn);
}

.duty-chip.sick .dot,
.duty-chip.due .dot {
  background: var(--bad);
  box-shadow: 0 0 10px var(--bad);
}

.duty-chip.due {
  border-color: rgba(248, 113, 113, 0.45);
  color: var(--bad-ink);
  animation: duty-pulse 1.6s ease-in-out infinite;
}

@keyframes duty-pulse {
  50% {
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.15);
  }
}

.duty-menu {
  top: 42px;
  right: 0;
  min-width: 270px;
}

.duty-head {
  display: block;
  padding: 10px 12px 12px;
}

.duty-head small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
}

@media (max-width: 1080px) {
  .duty-chip .txt {
    display: none;
  }
  .duty-chip {
    padding: 0 11px;
  }
}

/* Stempeluhr-Seite */
.duty-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 26px;
  align-items: center;
}

.duty-card.on {
  border-color: rgba(52, 211, 153, 0.28);
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.07), transparent 60%), var(--surface);
}

.duty-card.break {
  border-color: rgba(251, 191, 36, 0.28);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.07), transparent 60%), var(--surface);
}

.duty-card.sick {
  border-color: rgba(248, 113, 113, 0.28);
}

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

.duty-badge .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dim);
}

.duty-card.on .duty-badge .dot {
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
}

.duty-card.break .duty-badge .dot {
  background: var(--warn);
}

.duty-card.sick .duty-badge .dot {
  background: var(--bad);
}

.duty-big {
  font-size: clamp(38px, 6vw, 58px);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  margin: 6px 0 4px;
}

.duty-big small {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}

.duty-main .actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.duty-meters {
  display: grid;
  gap: 16px;
}

.duty-meters .row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  margin-bottom: 7px;
  color: var(--muted);
}

.duty-meters .row b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

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

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

.duty-mini div {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(var(--fg-rgb), 0.02);
}

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

.duty-mini b {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

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

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

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

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

.team-row small {
  display: block;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 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);
}

/* 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(250px, 1fr)); gap: 14px; }
.dealer-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.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: auto; 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; }
.limit-sign.company { border-color: var(--accent); flex-direction: column; line-height: 1; gap: 1px; font-size: 17px; }
.limit-sign.company small { font-size: 8.5px; font-weight: 800; letter-spacing: 0.08em; color: #444; }
.limit-sign.company.over { border-color: #e11d48; animation: pulse-red 1s ease-in-out infinite; }
@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; }
