﻿/* AVUS Connect Kundenportal — Designsystem (schwarz/weiß, Akzent = Logo-Rot) */
:root {
  --schwarz: #000000;
  --kohle: #141414;
  --tinte: #0b0b0b;
  --leise: #6b6b6b;
  --linie: #e8e8e8;
  --flaeche: #ffffff;
  --grau-flaeche: #f6f6f6;
  --rot: #cc3126;
  --rot-flaeche: #fdecea;
  --gruen: #0e8345;
  --gruen-flaeche: #e6f4ec;
  --blau: #1d5cc0;
  --blau-flaeche: #e9f0fc;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { font-size: 14px; }
html[data-schrift="klein"] { font-size: 12.5px; }
html[data-schrift="gross"] { font-size: 16px; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--flaeche);
  color: var(--tinte);
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 750; letter-spacing: -0.02em; }

/* ---------- Ladezustand ---------- */
.lade {
  height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 26px;
  background: var(--schwarz);
}
.lade-logo { font-size: 24px; font-weight: 800; color: #fff; letter-spacing: .06em; }
.lade-logo span { color: var(--rot); }
.lade-balken { width: 180px; height: 3px; background: #2a2a2a; overflow: hidden; }
.lade-balken div { width: 40%; height: 100%; background: #fff; animation: laden 1.1s ease-in-out infinite; }
@keyframes laden { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* ---------- App-Rahmen ---------- */
.app { display: flex; min-height: 100vh; background: var(--flaeche); }
.seitenleiste {
  width: 252px; flex-shrink: 0;
  background: var(--schwarz);
  color: #b3b3b3;
  display: flex; flex-direction: column;
  padding: 26px 16px 18px;
  position: sticky; top: 0; height: 100vh;
}
.logo-block { padding: 0 8px 26px; }
.logo-block img { width: 100%; max-width: 190px; display: block; }
.logo-block img.connect { margin-top: 0; }
.logo-block img.mini { width: 34px; margin: 4px auto 0; }
.logo-sub { font-size: 11px; color: #8a8a8a; margin-top: 10px; letter-spacing: .14em; text-transform: uppercase; }

/* Eingeklappte Seitenleiste: nur Icons + Mini-C */
.seitenleiste { transition: width .18s ease; }
.seitenleiste.schmal { width: 76px; padding: 26px 12px 18px; }
.seitenleiste.schmal .logo-block { padding: 0 0 22px; text-align: center; }
.seitenleiste.schmal .nav-text { display: none; }
.seitenleiste.schmal nav a { justify-content: center; padding: 12px 0; position: relative; }
.seitenleiste.schmal .zaehler {
  position: absolute; top: 5px; right: 8px; margin: 0;
  font-size: 9px; padding: 1px 5px;
}
.seitenleiste.schmal .nutzer-karte { justify-content: center; padding: 8px; }
.seitenleiste.schmal .nutzer-info, .seitenleiste.schmal .abmelden { display: none; }

.seitenleiste nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.seitenleiste nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px; border-radius: 8px;
  color: #b3b3b3; text-decoration: none; font-weight: 500; font-size: 14.5px;
  transition: background .12s, color .12s;
}
.seitenleiste nav a:hover { background: #1a1a1a; color: #fff; }
.seitenleiste nav a.active { background: #ffffff; color: #000; font-weight: 650; }
.seitenleiste nav svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.zaehler {
  margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700;
  background: var(--rot); color: #fff; border-radius: 10px; padding: 2px 7px;
}

.nutzer-karte {
  display: flex; align-items: center; gap: 10px;
  background: var(--kohle); border-radius: 10px; padding: 10px 12px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: #2b2b2b;
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.avatar.klein { width: 30px; height: 30px; font-size: 11px; background: #f0f0f0; color: #000; }
.nutzer-info { min-width: 0; }
.nutzer-info b { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nutzer-info small { color: #8a8a8a; font-size: 11px; white-space: nowrap; }
.abmelden {
  margin-left: auto; background: none; border: none; cursor: pointer; padding: 6px;
  border-radius: 8px; color: #8a8a8a;
}
.abmelden:hover { background: #262626; color: #fff; }
.abmelden svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.hauptbereich { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.inhalt { flex: 1; padding: 30px 48px 40px; min-width: 0; }

/* ---------- Topbar (moderner Windows-Stil) ---------- */
.topbar {
  height: 54px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px 0 28px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 20;
}
.topbar-links { display: flex; align-items: center; gap: 14px; }
.einklappen {
  border: none; background: transparent; cursor: pointer; padding: 8px;
  border-radius: 6px; color: var(--tinte); display: flex;
}
.einklappen:hover { background: #efefef; }
.einklappen svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.brotkrume { font-size: 13px; color: var(--leise); display: flex; align-items: center; gap: 8px; }
.brotkrume span { color: #c4c4c4; }
.brotkrume b { color: var(--tinte); font-weight: 650; }
.topbar-rechts { display: flex; align-items: center; gap: 12px; }
.segment {
  display: flex; align-items: center; gap: 2px;
  background: #f2f2f2; border: 1px solid var(--linie); border-radius: 8px; padding: 3px;
}
.segment button {
  border: none; background: transparent; cursor: pointer;
  min-width: 34px; padding: 5px 9px; border-radius: 6px;
  font-family: inherit; font-weight: 650; color: var(--leise); line-height: 1;
  transition: background .1s, color .1s;
}
.segment button:hover { background: #e7e7e7; color: var(--tinte); }
.segment button.aktiv {
  background: #fff; color: var(--tinte);
  box-shadow: 0 1px 2px rgba(0,0,0,.1); border: 1px solid #dedede;
}

/* ---------- Sortierbare Spaltenköpfe ---------- */
th.sortierbar { cursor: pointer; user-select: none; transition: color .1s, background .1s; }
th.sortierbar:hover { color: var(--tinte); background: #f0f0f0; }
th.sortierbar.aktiv { color: var(--tinte); }
th .kopf-inhalt { display: inline-flex; align-items: center; gap: 6px; }
th .pfeil { font-size: 9px; color: var(--tinte); }

/* ---------- Seitenkopf + KPIs ---------- */
.seitenkopf {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 26px;
}
.seitenkopf h1 { font-size: 2.43rem; }
.untertitel { margin: 8px 0 0; color: var(--leise); font-size: 1.07rem; }
.kpis { display: flex; gap: 10px; align-items: stretch; }
.kpi {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px;
  padding: 12px 18px; text-align: center; min-width: 96px;
}
.kpi b { display: block; font-size: 1.57rem; letter-spacing: -0.02em; }
.kpi span { font-size: .79rem; color: var(--leise); text-transform: uppercase; letter-spacing: .05em; }
.kpi.betont { border-color: var(--schwarz); background: var(--schwarz); }
.kpi.betont b, .kpi.betont span { color: #fff; }
.kpi.live { display: flex; align-items: center; gap: 8px; color: var(--gruen); font-weight: 650; }

/* ---------- Karten & Tabellen ---------- */
.karten-box {
  height: calc(100vh - 220px); border-radius: var(--radius); overflow: hidden;
  background: var(--flaeche); border: 1px solid var(--linie);
}
.tabellen-karte {
  background: var(--flaeche); border-radius: var(--radius);
  border: 1px solid var(--linie); overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; padding: 13px 18px;
  font-size: .79rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
  color: var(--leise); background: var(--grau-flaeche); border-bottom: 1px solid var(--linie);
}
td { padding: .93rem 1.29rem; border-bottom: 1px solid #f0f0f0; font-size: 1rem; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: #fafafa; }
td.rechts { text-align: right; }
.leer { padding: 40px; text-align: center; color: var(--leise); }

.fahrzeug-zelle { display: flex; align-items: center; gap: 12px; }
.fahrzeug-zelle b { display: block; font-weight: 650; }
.fahrzeug-zelle small { color: var(--leise); }

.tempo { font-variant-numeric: tabular-nums; font-weight: 650; }
.tempo small { color: var(--leise); font-weight: 400; }

/* ---------- Chips, Punkte, Meldungen ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 20px; font-size: .86rem; font-weight: 650;
  white-space: nowrap;
}
.chip.gruen { background: var(--gruen-flaeche); color: var(--gruen); }
.chip.grau { background: #efefef; color: var(--leise); }
.chip.rot { background: var(--rot-flaeche); color: var(--rot); }
.chip.blau { background: var(--blau-flaeche); color: var(--blau); }

.punkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.punkt.an { background: var(--gruen); }
.punkt.aus { background: #b9b9b9; }
.punkt.puls { animation: puls 1.6s ease-out infinite; }
@keyframes puls {
  0% { box-shadow: 0 0 0 0 rgba(14,131,69,.4); }
  70% { box-shadow: 0 0 0 7px rgba(14,131,69,0); }
  100% { box-shadow: 0 0 0 0 rgba(14,131,69,0); }
}

.meldung {
  background: var(--grau-flaeche); border: 1px solid var(--linie); color: #3d3d3d;
  border-radius: 10px; padding: 14px 16px; margin-bottom: 18px; font-size: 14px;
}
.meldung.fehler-box { background: var(--rot-flaeche); border-color: #f3c4bf; color: var(--rot); }
.fehler { color: var(--rot); font-size: 13px; }

.schalter { display: flex; align-items: center; gap: 7px; color: var(--leise); font-size: 13px; align-self: center; }

button.leise {
  background: #efefef; border: none; padding: 8px 15px; border-radius: 8px;
  cursor: pointer; font-size: 13px; font-weight: 550; color: var(--tinte);
  transition: background .12s;
}
button.leise:hover { background: #e2e2e2; }
button.primaer {
  background: var(--schwarz); color: #fff; border: none;
  padding: 13px 20px; border-radius: 8px;
  font-weight: 650; font-size: 14.5px; cursor: pointer;
  transition: background .12s;
}
button.primaer:hover { background: #262626; }
button.primaer:disabled { opacity: .45; cursor: default; }

/* ---------- Karten-Layout mit Fahrzeug-Panel ---------- */
.karten-layout { display: flex; gap: 14px; align-items: stretch; }
.karten-layout .karten-box { flex: 1; min-width: 0; height: calc(100vh - 128px); }
.fahrzeug-panel {
  width: 280px; flex-shrink: 0; overflow-y: auto;
  height: calc(100vh - 128px);
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
}
.lucide { width: 20px; height: 20px; flex-shrink: 0; }
.status-badge {
  width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
}
.status-badge .lucide { width: 13px; height: 13px; }
.status-badge.faehrt { background: var(--gruen); color: #fff; }
.status-badge.haelt { background: #f2b705; color: #241a00; }
.status-badge.parkt { background: #e4e8ee; color: #3d4c63; }
.status-badge.offline { background: var(--rot-flaeche); color: var(--rot); border: 1px solid #f3c4bf; }
.panel-kopf {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: var(--grau-flaeche);
  border-bottom: 1px solid var(--linie);
  font-size: .79rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  color: var(--leise);
}
.panel-kopf label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.panel-zeile {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; border-bottom: 1px solid #f0f0f0;
  transition: background .1s;
}
.panel-zeile:hover { background: #f7f9fc; }
.panel-zeile:last-child { border-bottom: none; }
.panel-info { cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.panel-info b { font-size: .93rem; }
.panel-info small { color: var(--leise); display: flex; align-items: center; gap: 6px; font-size: .82rem; }

/* ---------- Fahrzeugakte / Formulare ---------- */
.akte { margin-top: 16px; padding: 20px 22px; }
.akte-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.akte-kopf h2 { font-size: 1.29rem; }
.akte-kopf .leise { margin-left: 8px; }
.formular-raster {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px;
}
.formular-raster.schmal { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); align-items: end; }
.formular-raster label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: .79rem; font-weight: 650; color: var(--leise);
  text-transform: uppercase; letter-spacing: .05em;
}
.formular-raster input, .formular-raster select {
  padding: 9px 11px; border: 1.5px solid var(--linie); border-radius: 8px;
  font-size: 1rem; font-family: inherit; background: var(--grau-flaeche);
  text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--tinte);
}
.formular-raster input:focus, .formular-raster select:focus {
  outline: none; border-color: var(--schwarz); background: #fff;
}
tr.gewaehlt td { background: #f3f3f3; }

/* ---------- Tarife ---------- */
.tarif-raster {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px;
}
.tarif-kachel {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .12s;
}
.tarif-kachel:hover { border-color: #cfcfcf; }
.tarif-kachel.gebucht { border: 2px solid var(--schwarz); }
.tarif-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tarif-kopf h3 { font-size: 1.21rem; }
.tarif-preis { font-size: 2.14rem; font-weight: 800; letter-spacing: -0.03em; }
.tarif-preis small { font-size: 13px; color: var(--leise); font-weight: 400; margin-left: 5px; letter-spacing: 0; }
.tarif-features { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tarif-features li { padding-left: 24px; position: relative; color: #333; font-size: 1rem; }
.tarif-features li::before {
  content: "✓"; position: absolute; left: 0; color: var(--schwarz); font-weight: 800;
}
.tarif-hinweis { margin: auto 0 0; font-size: 12px; color: var(--leise); }

/* ---------- Login ---------- */
.login-buehne {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--schwarz); padding: 24px;
}
.login-mitte { width: 400px; max-width: 100%; }
.login-wortmarke { width: 300px; max-width: 90%; margin: 0 auto 34px; }
.login-wortmarke img { width: 100%; display: block; }
.login-karte {
  background: #fff; padding: 34px 32px; border-radius: 14px;
  display: flex; flex-direction: column; gap: 16px;
}
.login-karte h2 { font-size: 22px; margin-bottom: 2px; }
.login-karte label { font-size: 12px; font-weight: 650; color: var(--leise); display: flex; flex-direction: column; gap: 6px; text-transform: uppercase; letter-spacing: .05em; }
.login-karte input {
  padding: 13px 14px; border: 1.5px solid var(--linie); border-radius: 8px;
  font-size: 15px; font-family: inherit; transition: border-color .12s;
  background: var(--grau-flaeche);
}
.login-karte input:focus { outline: none; border-color: var(--schwarz); background: #fff; }
.login-fuss { font-size: 12px; color: #8a8a8a; text-align: center; margin: 18px 0 0; }

@media (max-width: 760px) {
  .app { flex-direction: column; }
  .seitenleiste { width: 100%; height: auto; position: static; }
  .inhalt { padding: 20px; }
  .seitenkopf h1 { font-size: 26px; }
}
