/* ==========================================================================
   Werkstattportal – Designsystem
   Prinzip: Reduktion. Typografie trägt, Haarlinien gliedern, Farbe ist Signal.
   ========================================================================== */
:root {
  --accent: #c8102e;
  --bg: #0b0b0c;
  --surface: #121213;
  --surface-2: #19191b;
  --surface-3: #212124;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);
  --text: #f5f5f4;
  --text-2: #a3a3a0;
  --text-3: #6e6e6b;
  --ok: #3fb27f;
  --warn: #d9a441;
  --bad: #e5484d;
  --info: #8e9bb3;
  --r: 2px;
  --r-card: 4px;
  --font: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.25, .1, .25, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--font); font-size: 15px; line-height: 1.55; font-weight: 400; letter-spacing: -.005em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; min-height: 100dvh; font-feature-settings: "ss01", "cv11"; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
::selection { background: var(--text); color: var(--bg); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 300; letter-spacing: -.03em; line-height: 1.08; }
h2 { font-size: 22px; font-weight: 400; letter-spacing: -.02em; line-height: 1.2; }
h3 { font-size: 16px; font-weight: 500; letter-spacing: -.01em; }
.display { font-size: clamp(40px, 8vw, 72px); font-weight: 200; letter-spacing: -.045em; line-height: .95; }
.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.muted { color: var(--text-2); } .faint { color: var(--text-3); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.light { font-weight: 300; }
.row { display: flex; align-items: center; gap: 12px; } .row.wrap { flex-wrap: wrap; } .row.top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; } .between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; } .stack-sm > * + * { margin-top: 6px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hidden { display: none !important; }
.grid { display: grid; gap: 1px; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 15px; height: 15px; } svg.i.lg { width: 24px; height: 24px; stroke-width: 1.2; }

/* ---------- Layout ---------- */
.main { max-width: 1180px; margin: 0 auto; padding: 32px 20px calc(var(--nav-h) + 48px + var(--safe-b)); }
.page > * + * { margin-top: 56px; }
.page > .tight + * { margin-top: 28px; }
@media (min-width: 768px) { .main { padding: 56px 40px 96px; } }

.topbar { position: sticky; top: 0; z-index: 20; background: rgba(11, 11, 12, .86); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1180px; margin: 0 auto; height: 64px; padding: 0 20px; display: flex; align-items: center; gap: 8px; }
@media (min-width: 768px) { .topbar-in { padding: 0 40px; } }
.wordmark { font-size: 13px; font-weight: 600; letter-spacing: .32em; text-transform: uppercase; white-space: nowrap; }
.wordmark-sub { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); padding-left: 14px; margin-left: 14px; border-left: 1px solid var(--line-2); white-space: nowrap; }
.iconbtn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; background: transparent; border: 0; color: var(--text-2); cursor: pointer; border-radius: var(--r); transition: color .2s var(--ease); }
.iconbtn:hover { color: var(--text); }
.dot-badge { position: absolute; top: 9px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.count { font-size: 11px; font-weight: 600; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; display: inline-grid; place-items: center; }

/* Navigation – mobil: flache Leiste unten */
.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; background: rgba(11, 11, 12, .94); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--line); }
.nav a { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--text-3); font-size: 10px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; transition: color .2s var(--ease); }
.nav a.active { color: var(--text); }
.nav a.active::before { content: ""; position: absolute; top: -1px; left: 30%; right: 30%; height: 1px; background: var(--text); }
.nav a .dot-badge { top: 12px; right: calc(50% - 16px); }
@media (min-width: 1024px) {
  .admin .nav { top: 64px; bottom: 0; right: auto; width: 248px; height: auto; flex-direction: column; padding: 40px 0; border-top: 0; border-right: 1px solid var(--line); background: var(--bg); }
  .admin .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 12px 32px; font-size: 14px; letter-spacing: -.005em; text-transform: none; color: var(--text-2); }
  .admin .nav a:hover { color: var(--text); }
  .admin .nav a.active { color: var(--text); }
  .admin .nav a.active::before { top: 10px; bottom: 10px; left: 0; right: auto; width: 2px; height: auto; background: var(--accent); }
  .admin .nav a .dot-badge { position: static; margin-left: auto; }
  .admin .nav .nav-foot { margin-top: auto; padding: 0 32px; }
  .admin .main { margin-left: 248px; max-width: 1180px; padding-bottom: 80px; }
  .admin .topbar-in { max-width: none; }
}
.nav .nav-foot { display: none; }
@media (min-width: 1024px) { .admin .nav .nav-foot { display: block; } }

/* ---------- Bausteine ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.pad { padding: 28px; } @media (max-width: 600px) { .pad { padding: 20px; } }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); background: none; border: 0; padding: 0; cursor: pointer; }
.link svg { transition: transform .25s var(--ease); } .link:hover svg { transform: translateX(3px); }
.link.muted { color: var(--text-2); } .link.muted:hover { color: var(--text); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 48px; padding: 0 22px; border-radius: var(--r); border: 1px solid var(--line-2); background: transparent; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease); }
.btn:hover { border-color: var(--text); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary:hover { background: #fff; }
.btn.danger { color: var(--bad); } .btn.danger:hover { border-color: var(--bad); }
.btn.sm { height: 38px; padding: 0 16px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.field { display: block; }
.field > span { display: block; font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.input { width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r); background: transparent; border: 1px solid var(--line-2); outline: none; font-size: 15px; transition: border-color .2s var(--ease); }
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: rgba(255, 255, 255, .28); }
.input:focus { border-color: var(--text); }
select.input { appearance: none; 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='%23a3a3a0' stroke-width='1.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
select.input option { background: var(--surface-2); }
textarea.input { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
input[type=date].input, input[type=month].input { color-scheme: dark; }
.check { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; color: var(--text-2); }
.check input { appearance: none; width: 18px; height: 18px; border: 1px solid var(--line-2); border-radius: var(--r); margin: 0; display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--text); border-color: var(--text); }
.check input:checked::after { content: ""; width: 9px; height: 5px; border: solid var(--bg); border-width: 0 0 1.6px 1.6px; transform: rotate(-45deg) translate(1px, -1px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid, .form-grid.three { grid-template-columns: 1fr; } }

.seg { display: flex; border: 1px solid var(--line-2); border-radius: var(--r); }
.seg button { flex: 1; border: 0; background: transparent; height: 42px; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: all .2s var(--ease); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--text); color: var(--bg); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { height: 32px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 16px; background: transparent; font-size: 13px; color: var(--text-2); cursor: pointer; transition: all .2s var(--ease); }
.tag:hover { color: var(--text); border-color: var(--text); }

/* Status: nur Punkt + Text */
.st { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); flex: none; }
.st.ok::before { background: var(--ok); } .st.upcoming::before { background: var(--info); }
.st.soon::before { background: var(--warn); } .st.overdue::before { background: var(--bad); }
.st.overdue { color: var(--text); }
.st.live::before { background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* Kennzeichen – nüchtern, präzise */
.plate { display: inline-flex; align-items: stretch; height: 30px; border-radius: 3px; background: #ededea; color: #111; border: 1px solid #111; box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); font-family: "DIN Alternate", "DIN 1451", "Roboto Condensed", "Arial Narrow", var(--font); font-weight: 600; font-size: 17px; letter-spacing: .06em; white-space: nowrap; overflow: hidden; }
.plate .eu { width: 15px; background: #1f3c99; color: #fff; font-size: 7.5px; font-weight: 500; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 3px; letter-spacing: 0; }
.plate .txt { padding: 0 9px; display: flex; align-items: center; }
.plate.lg { height: 40px; font-size: 24px; } .plate.lg .eu { width: 20px; font-size: 9px; }
.plate.sm { height: 24px; font-size: 13.5px; } .plate.sm .eu { width: 12px; font-size: 6px; } .plate.sm .txt { padding: 0 7px; }

/* ---------- Fahrzeug ---------- */
.vehicle { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; transition: border-color .3s var(--ease); }
a.vehicle:hover, .vehicle.tap:hover { border-color: var(--line-2); cursor: pointer; }
.vehicle-media { position: relative; aspect-ratio: 16 / 8; background: linear-gradient(180deg, #161618 0%, #0f0f10 100%); overflow: hidden; }
.vehicle-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
a.vehicle:hover .vehicle-media img { transform: scale(1.025); }
.vehicle-media .lineart { position: absolute; left: 8%; right: 8%; bottom: 10%; color: rgba(255, 255, 255, .34); }
.vehicle-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.55) 100%); pointer-events: none; }
.vehicle-media .live-tag { position: absolute; z-index: 2; top: 16px; left: 16px; display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; background: rgba(11, 11, 12, .8); backdrop-filter: blur(10px); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; border-radius: var(--r); }
.vehicle-media .live-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
.vehicle-body { padding: 24px 24px 0; }
.vehicle-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.vehicle-title h2 { font-size: 26px; font-weight: 300; letter-spacing: -.025em; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 24px; border-top: 1px solid var(--line); }
.facts > div { padding: 18px 0 22px; } .facts > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.facts .v { font-size: 17px; font-weight: 400; margin: 6px 0 4px; letter-spacing: -.01em; }
@media (max-width: 420px) { .facts > div + div { padding-left: 14px; } .facts .v { font-size: 15px; } }

.hero { position: relative; border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line); background: linear-gradient(180deg, #161618, #0d0d0e); }
.hero .vehicle-media { aspect-ratio: 21 / 9; }
.hero-caption { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
@media (min-width: 768px) { .hero-caption { padding: 40px; } }
.hero:not(.has-img) .hero-caption { position: relative; padding-top: 8px; }
.hero:not(.has-img) .vehicle-media { aspect-ratio: 21 / 7; background: none; }
.hero:not(.has-img) .vehicle-media::after { display: none; }
@media (max-width: 700px) { .hero:not(.has-img) .vehicle-media { aspect-ratio: 16 / 7; } .hero.has-img .vehicle-media { aspect-ratio: 4 / 5; } }
.entry .price { align-self: start; padding-top: 2px; }
@media (max-width: 640px) { .entry .price { grid-row: 2; grid-column: 2; padding-top: 22px; } .entry > div:nth-child(2) { grid-row: 2; } }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metrics > div { padding: 28px 24px 28px 0; } .metrics > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.metrics .big { font-size: 48px; font-weight: 200; letter-spacing: -.04em; line-height: 1; margin: 16px 0 10px; font-variant-numeric: tabular-nums; }
.metrics .big small { font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--text-2); margin-left: 6px; }
@media (max-width: 760px) { .metrics { grid-template-columns: 1fr; } .metrics > div, .metrics > div + div { padding: 22px 0; border-left: 0; } .metrics > div + div { border-top: 1px solid var(--line); } .metrics .big { font-size: 40px; margin: 10px 0 8px; } }

.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); column-gap: 32px; }
.specs > div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.specs .l { color: var(--text-3); } .specs .v { text-align: right; word-break: break-word; }

/* Hinweise */
.notice { display: flex; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.notice:first-child { border-top: 1px solid var(--line); }

/* Historie */
.history .year { font-size: 13px; font-weight: 500; letter-spacing: .16em; color: var(--text-3); padding: 40px 0 12px; border-bottom: 1px solid var(--line); }
.history .year:first-child { padding-top: 8px; }
.entry { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .2s var(--ease); }
.entry:hover { background: linear-gradient(90deg, transparent, rgba(255,255,255,.015) 20%, rgba(255,255,255,.015) 80%, transparent); }
.entry .date { font-size: 14px; font-variant-numeric: tabular-nums; }
.entry h3 { font-size: 17px; font-weight: 400; margin: 6px 0 6px; }
.entry .price { font-size: 15px; font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 640px) { .entry { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; } .entry .when { grid-column: 1 / -1; display: flex; gap: 12px; } }
.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.lines td { padding: 12px 0; border-bottom: 1px solid var(--line); } .lines td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.lines tr.total td { border-bottom: 0; padding-top: 18px; font-size: 17px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r); cursor: zoom-in; filter: saturate(.9); }
.photo-add { display: grid; place-items: center; aspect-ratio: 1; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--text-3); cursor: pointer; transition: all .2s var(--ease); }
.photo-add:hover { color: var(--text); border-color: var(--text); }

/* Listen & Tabellen */
.list > * { border-bottom: 1px solid var(--line); }
.li { display: flex; align-items: center; gap: 16px; padding: 16px 0; cursor: pointer; transition: opacity .2s; }
.li:hover .li-title { color: #fff; } .li:hover .chev { transform: translateX(3px); color: var(--text); }
.li .chev { color: var(--text-3); transition: transform .25s var(--ease); }
.li-title { font-size: 15px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 500; letter-spacing: .04em; border: 1px solid var(--line-2); color: var(--text-2); flex: none; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); padding: 0 16px 14px 0; border-bottom: 1px solid var(--line); }
.table td { padding: 18px 16px 18px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.click { cursor: pointer; } .table tr.click:hover td { color: #fff; }
@media (max-width: 700px) { .hide-sm { display: none; } }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kpis > a { padding: 24px 20px 26px 0; } .kpis > a + a { padding-left: 24px; border-left: 1px solid var(--line); }
.kpis .v { font-size: 52px; font-weight: 200; letter-spacing: -.045em; line-height: 1; margin-top: 18px; font-variant-numeric: tabular-nums; }
.kpis > a:hover .v { color: #fff; }
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr 1fr; } .kpis > a:nth-child(3) { padding-left: 0; border-left: 0; } .kpis > a:nth-child(n+3) { border-top: 1px solid var(--line); } .kpis .v { font-size: 40px; } }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
@media (max-width: 960px) { .cols-3, .cols-2 { grid-template-columns: 1fr; gap: 48px; } }
.empty { padding: 32px 0; color: var(--text-3); font-size: 14px; }
.notif { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.notif .mark { width: 6px; height: 6px; border-radius: 50%; margin-top: 8px; }
.notif.unread .mark { background: var(--accent); }
.notif:not(.unread) h3 { color: var(--text-2); font-weight: 400; }

/* Chat */
.chat { display: flex; flex-direction: column; height: calc(100dvh - 64px - var(--nav-h) - 96px - var(--safe-b)); min-height: 420px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.admin .chat { height: calc(100dvh - 64px - 200px); }
.chat-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 20px 22px; }
.msg { max-width: min(76%, 560px); padding: 11px 15px; border-radius: 3px; white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; line-height: 1.5; }
.msg .t { display: block; font-size: 10.5px; letter-spacing: .04em; margin-top: 5px; opacity: .5; }
.msg.me { align-self: flex-end; background: var(--text); color: var(--bg); }
.msg.them { align-self: flex-start; background: var(--surface-3); }
.msg + .msg.me, .msg + .msg.them { margin-top: 2px; }
.chat-day { align-self: center; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin: 18px 0 10px; }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; min-height: 48px; height: 48px; max-height: 160px; resize: none; padding: 13px 14px; border: 0; background: var(--surface-2); }
.composer textarea:focus { border: 0; box-shadow: inset 0 0 0 1px var(--line-2); }
.quick { display: flex; gap: 8px; padding: 12px 16px 0; overflow-x: auto; scrollbar-width: none; }
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 32px; }
.conv { display: flex; gap: 14px; padding: 16px 12px; margin: 0 -12px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: var(--r); }
.conv:hover, .conv.on { background: var(--surface); }
@media (max-width: 900px) { .inbox { grid-template-columns: 1fr; } .inbox.has-thread .inbox-list { display: none; } .inbox:not(.has-thread) .inbox-thread { display: none; } }

/* Login */
.login { min-height: 100dvh; display: grid; grid-template-columns: 1.15fr 1fr; }
.login-art { position: relative; overflow: hidden; border-right: 1px solid var(--line); background: radial-gradient(1200px 600px at 30% 120%, #1a1a1c, var(--bg) 60%); display: flex; flex-direction: column; justify-content: space-between; padding: 48px; }
.login-art .lineart { position: absolute; left: -6%; right: 4%; bottom: 14%; color: rgba(255, 255, 255, .22); }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 96px); }
.login-form form { width: 100%; max-width: 380px; }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-art { min-height: 300px; padding: 28px 24px; border-right: 0; border-bottom: 1px solid var(--line); } .login-art .lineart { bottom: 10%; left: 4%; right: 4%; } .login-form { padding: 40px 24px 56px; } }

/* Sheet */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .72); display: flex; align-items: flex-end; justify-content: center; animation: fade .25s var(--ease); }
.sheet { width: 100%; max-width: 640px; max-height: 94dvh; overflow-y: auto; background: var(--surface); border-top: 1px solid var(--line-2); padding: 28px 24px calc(28px + var(--safe-b)); animation: up .35s var(--ease); }
.sheet.wide { max-width: 860px; }
@media (min-width: 720px) { .sheet-bg { align-items: center; padding: 24px; } .sheet { border: 1px solid var(--line-2); border-radius: var(--r-card); padding: 36px 40px 40px; } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.sheet-head h2 { font-size: 26px; font-weight: 300; letter-spacing: -.025em; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } } @keyframes fade { from { opacity: 0; } }
details.more { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
details.more summary { list-style: none; cursor: pointer; padding: 16px 0; display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; font-weight: 300; font-size: 20px; color: var(--text-2); }
details.more[open] summary::after { content: "–"; }
details.more > div { padding-bottom: 20px; }

/* Toasts */
.toast-wrap { position: fixed; z-index: 70; top: 76px; right: 20px; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; gap: 14px; padding: 16px 18px; background: var(--surface-2); border: 1px solid var(--line-2); border-left: 2px solid var(--text); border-radius: var(--r); animation: up .3s var(--ease); cursor: pointer; }
.toast.err { border-left-color: var(--bad); }
@media (max-width: 600px) { .toast-wrap { left: 20px; right: 20px; width: auto; top: 72px; } }

/* Scanner */
.scan-area { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; aspect-ratio: 16 / 7; min-height: 220px; border: 1px solid var(--line-2); border-radius: var(--r-card); cursor: pointer; background: var(--surface); transition: border-color .3s var(--ease); text-align: center; padding: 24px; }
.scan-area:hover { border-color: var(--text); }
.scan-area .frame { position: absolute; inset: 22%; pointer-events: none; }
.scan-area .frame i { position: absolute; width: 22px; height: 22px; border-color: var(--text-2); border-style: solid; border-width: 0; }
.scan-area .frame i:nth-child(1) { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.scan-area .frame i:nth-child(2) { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.scan-area .frame i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.scan-area .frame i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.scan-preview { width: 100%; max-height: 260px; object-fit: contain; background: #000; border-radius: var(--r); }
.plate-input { text-transform: uppercase; font-size: 26px; font-weight: 300; letter-spacing: .12em; height: 64px; text-align: center; }
.progress { height: 1px; background: var(--line); overflow: hidden; } .progress > div { height: 100%; width: 0; background: var(--text); transition: width .3s var(--ease); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.7; color: var(--text-2); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; overflow-x: auto; white-space: pre; }
.keybox { font-family: ui-monospace, monospace; font-size: 13px; line-height: 1.7; padding: 18px 20px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg); white-space: pre-wrap; word-break: break-word; }
code { font-family: ui-monospace, monospace; font-size: .92em; color: var(--text); }
.skeleton { height: 240px; border-radius: var(--r-card); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sh 1.4s infinite; }
@keyframes sh { to { background-position: -200% 0; } }
.fade-in { animation: fadeup .5s var(--ease) both; }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Feinschliff ---------- */
.login-art .lineart { top: 26%; bottom: auto; }
@media (max-width: 900px) { .login-art { min-height: 380px; } .login-art .lineart { top: 70px; } }
.vehicle-media:not(:has(img)) { aspect-ratio: 16 / 6.5; }
@media (min-width: 900px) {
  .customer .nav { top: 0; bottom: auto; left: auto; right: max(40px, calc((100vw - 1180px) / 2 + 40px)); height: 64px; padding: 0; width: auto; gap: 36px; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; }
  .customer .nav a { flex: none; flex-direction: row; gap: 0; font-size: 11px; letter-spacing: .16em; }
  .customer .nav a svg { display: none; }
  .customer .nav a.active::before { top: auto; bottom: 0; left: 0; right: 0; }
  .customer .nav a .dot-badge { position: absolute; top: 22px; right: -10px; }
  .customer .topbar .iconbtn { display: none; }
  .customer .main { padding-bottom: 96px; }
  .customer .chat { height: calc(100dvh - 64px - 160px); }
}
@media (max-width: 520px) {
  .vehicle-body { padding: 20px 18px 0; }
  .vehicle-title h2.ellipsis { white-space: normal; font-size: 22px; }
  .facts > div + div { padding-left: 12px; }
  .facts .st { white-space: normal; align-items: flex-start; font-size: 12px; line-height: 1.35; }
  .facts .st::before { margin-top: 5px; }
  .facts .v { font-size: 14.5px; }
}

/* ==========================================================================
   Bewegung & Bildsprache
   ========================================================================== */
:root { --spring: cubic-bezier(.16, 1, .3, 1); }
.logo-mark { height: 24px; width: auto; display: block; }
@media (min-width: 768px) { .logo-mark { height: 28px; } }

/* Seitenaufbau: Abschnitte gleiten gestaffelt herein */
.enter { animation: rise .9s var(--spring) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(22px); filter: blur(6px); } }
.rv { opacity: 0; transform: translateY(16px); }
.rv.in { animation: rvIn .8s var(--spring) forwards; animation-delay: calc(var(--k, 0) * 55ms); }
@keyframes rvIn { to { opacity: 1; transform: none; } }

/* Fahrzeugbilder */
.vehicle-media { background: #050506; }
.vehicle-media img { opacity: 0; transform: translateY(var(--py, 0)) scale(var(--s, 1.08)); transition: opacity 1.1s var(--ease), transform 1.8s var(--spring), translate .9s var(--spring); will-change: transform; }
.vehicle-media img.in { opacity: 1; --s: 1; }
.vehicle .vehicle-media { aspect-ratio: 16 / 9; }
.vehicle .vehicle-media::after { background: linear-gradient(180deg, rgba(0,0,0,0) 62%, var(--surface) 100%); }
.vehicle:hover .vehicle-media img.in { --s: 1.045; }
a.vehicle:hover .vehicle-media img { transform: translateY(var(--py, 0)) scale(var(--s)); }
.sheen { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.10) 48%, rgba(255,255,255,.02) 55%, transparent 65%); transform: translateX(-120%); animation: sweep 2.2s .5s var(--ease) forwards; }
.vehicle:hover .sheen { animation: sweep 1.4s var(--ease) forwards; }
@keyframes sweep { from { transform: translateX(-120%); } to { transform: translateX(120%); } }

/* Licht folgt dem Zeiger, sanfte Neigung */
.vehicle { position: relative; transition: transform .6s var(--spring), border-color .4s var(--ease), box-shadow .6s var(--ease); transform-style: preserve-3d; }
.vehicle::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .5s var(--ease); background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 30%), rgba(255,255,255,.07), transparent 45%); }
.vehicle:hover::before { opacity: 1; }
.vehicle:hover { box-shadow: 0 40px 80px -40px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.06); }
.vehicle .vehicle-body { position: relative; z-index: 3; }

/* Großes Fahrzeugbild */
.hero { background: #050506; }
.hero .vehicle-media { aspect-ratio: 21 / 9; }
.hero .vehicle-media::after { background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 50%, rgba(0,0,0,.85) 100%); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(900px circle at var(--mx, 50%) var(--my, 40%), rgba(255,255,255,.05), transparent 50%); }
.hero-caption { z-index: 3; transition: opacity .2s linear; }
.hero-caption h1 { font-size: clamp(34px, 5.4vw, 64px); font-weight: 200; letter-spacing: -.035em; }
@media (max-width: 700px) { .hero .vehicle-media, .hero.has-img .vehicle-media { aspect-ratio: 16 / 12; } .hero .vehicle-media img { object-position: 50% 60%; } .hero-caption { padding: 22px; } }

/* Fortschrittslinien */
.meter { position: relative; height: 1px; background: var(--line-2); margin: 4px 0 14px; overflow: hidden; max-width: 260px; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--text); transition: width 1.8s var(--spring) .2s; }
.meter i.go { width: var(--w); }
.meter i.soon { background: var(--warn); } .meter i.overdue { background: var(--bad); } .meter i.upcoming { background: var(--info); } .meter i.ok { background: var(--ok); }

/* Status: überfällig pulsiert dezent */
.st.overdue::before { animation: ring 2.4s var(--ease) infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(229, 72, 77, 0); } }

/* Login mit Fotografie */
.login-art { padding: 0; }
.login-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 40% 60%; opacity: 0; animation: photoIn 2.4s var(--ease) .1s forwards, drift 28s ease-in-out 2.5s infinite alternate; }
@keyframes photoIn { from { opacity: 0; transform: scale(1.12); } to { opacity: 1; transform: scale(1.02); } }
@keyframes drift { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.09) translate(-1.5%, -1%); } }
.login-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,11,12,.55) 0%, rgba(11,11,12,0) 30%, rgba(11,11,12,.2) 55%, rgba(11,11,12,.92) 100%); }
.login-logo { position: absolute; z-index: 2; top: 44px; left: 48px; width: 150px; opacity: 0; animation: rise 1.2s var(--spring) .4s forwards; }
.login-claim { position: absolute; z-index: 2; left: 48px; right: 48px; bottom: 48px; max-width: 560px; }
.reveal-line { display: block; overflow: hidden; padding-bottom: .06em; }
.reveal-line > span { display: inline-block; transform: translateY(110%); animation: lineUp 1.2s var(--spring) forwards; animation-delay: calc(.6s + var(--d, 0s)); }
@keyframes lineUp { to { transform: none; } }
.login-form form { animation: rise 1s var(--spring) .3s both; }
@media (max-width: 900px) { .login-art { min-height: 62vh; } .login-logo { top: 28px; left: 24px; width: 120px; } .login-claim { left: 24px; right: 24px; bottom: 28px; } .login-claim .display { font-size: 44px; } }

/* Buttons: Lichtkante beim Überfahren */
.btn { position: relative; overflow: hidden; }
.btn.primary::after { content: ""; position: absolute; top: 0; bottom: 0; width: 60%; left: -80%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.65), transparent); transform: skewX(-18deg); transition: left .8s var(--ease); }
.btn.primary:hover::after { left: 130%; }
.btn:active { transform: scale(.985); }

/* Navigation */
.nav a.active::before { animation: grow .5s var(--spring); }
@keyframes grow { from { transform: scaleX(0); } }
@media (min-width: 1024px) { .admin .nav a.active::before { animation: growY .5s var(--spring); } }
@keyframes growY { from { transform: scaleY(0); } }
.nav a svg { transition: transform .4s var(--spring); } .nav a:active svg { transform: scale(.88); }

/* Nachrichten, Mitteilungen, Fenster */
.msg { animation: msgIn .45s var(--spring) both; }
.msg.me { transform-origin: 100% 100%; } .msg.them { transform-origin: 0 100%; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.sheet { animation: sheetUp .6s var(--spring); }
@keyframes sheetUp { from { opacity: 0; transform: translateY(40px) scale(.985); } }
.sheet-bg { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.toast { animation: toastIn .6s var(--spring); }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } }
.li, .conv, .entry { transition: background .3s var(--ease), padding .4s var(--spring); }
.entry:hover { padding-left: 8px; }
.kpis > a .v { transition: color .3s var(--ease), transform .5s var(--spring); }
.kpis > a:hover .v { transform: translateX(6px); }
.plate { transition: transform .5s var(--spring); } .vehicle:hover .plate { transform: translateZ(30px); }

@media (prefers-reduced-motion: reduce) { .rv, .vehicle-media img, .login-photo, .login-logo, .reveal-line > span { opacity: 1 !important; transform: none !important; } }
/* Beschriftung unter dem Fahrzeug – ragt nur in die Bodenspiegelung */
.hero .hero-caption { position: relative; margin-top: -84px; padding: 0 40px 36px; }
.hero .vehicle-media::after { background: linear-gradient(180deg, rgba(0,0,0,.2) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 62%, #050506 100%); }
.hero .vehicle-media { aspect-ratio: 16 / 7.4; }
@media (max-width: 700px) { .hero .vehicle-media, .hero.has-img .vehicle-media { aspect-ratio: 16 / 10; } .hero .hero-caption { margin-top: -36px; padding: 0 20px 22px; } }

/* ==========================================================================
   Layout-Feinschliff
   ========================================================================== */
.center { text-align: center; }
.page.narrow { max-width: 820px; margin-inline: auto; }
.page.narrow.wide-narrow { max-width: 900px; }

/* Admin: Inhalt mittig im Raum neben der Seitenleiste */
@media (min-width: 1024px) {
  .admin .main { margin-left: max(248px, calc(248px + (100vw - 248px - 1180px) / 2)); margin-right: auto; }
}

/* Navigation: kurze Bezeichnungen auf dem Handy */
.nav .lbl-short { display: none; }
@media (max-width: 1023px) {
  .admin .nav a { letter-spacing: .06em; padding: 0 2px; }
  .admin .nav .lbl-long { display: none; }
  .admin .nav .lbl-short { display: inline; }
}
@media (max-width: 899px) {
  .customer .nav .lbl-long { display: none; }
  .customer .nav .lbl-short { display: inline; }
}

/* Kennzeichen erfassen – zentrierte Komposition */
.scan-page { max-width: 560px; }
.scan-page > * + * { margin-top: 40px; }
.scan-page header h1 { font-size: clamp(32px, 5vw, 44px); }
.scan-block { display: flex; flex-direction: column; }
.scan-area { aspect-ratio: 4 / 3; min-height: 0; gap: 20px; overflow: hidden; }
.scan-area .frame { inset: 18% 14%; }
.scan-area .frame i { width: 28px; height: 28px; border-color: var(--text); transition: all .5s var(--spring); }
.scan-area:hover .frame i:nth-child(1) { transform: translate(-6px, -6px); } .scan-area:hover .frame i:nth-child(2) { transform: translate(6px, -6px); }
.scan-area:hover .frame i:nth-child(3) { transform: translate(-6px, 6px); } .scan-area:hover .frame i:nth-child(4) { transform: translate(6px, 6px); }
.scan-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); color: var(--text); background: var(--surface-2); }
.scan-line { position: absolute; left: 14%; right: 14%; top: 18%; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); box-shadow: 0 0 18px var(--accent); opacity: .8; animation: scanMove 3.2s ease-in-out infinite; }
@keyframes scanMove { 0%, 100% { top: 18%; } 50% { top: 82%; } }
.or { display: flex; align-items: center; gap: 16px; margin: 32px 0 24px; color: var(--text-3); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
/* Eingabe im Stil eines Kennzeichens */
.plate-field { display: flex; height: 68px; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; background: #ededea; transition: box-shadow .3s var(--ease); cursor: text; }
.plate-field:focus-within { box-shadow: 0 0 0 1px var(--text), 0 0 0 6px rgba(255,255,255,.08); }
.plate-field .eu { width: 36px; flex: none; background: #1f3c99; color: #fff; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 9px; font-size: 13px; font-weight: 500; }
.plate-field .plate-input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: #111; text-align: center; font-family: "DIN Alternate", "DIN 1451", "Roboto Condensed", "Arial Narrow", var(--font); font-size: 30px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.plate-field .plate-input::placeholder { color: rgba(17,17,17,.28); }
#results:empty { display: none; }

/* Kopfzeilen & Aktionsleisten auf dem Handy */
@media (max-width: 640px) {
  .page-head { align-items: stretch !important; gap: 20px !important; }
  .page-head > .row, .page-head > .btn { width: 100%; }
  .page-head > .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .page-head .btn { width: 100%; padding: 0 12px; }
  .toolbar { flex-direction: column; align-items: stretch !important; }
  .toolbar > .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .toolbar > .row .btn { width: 100%; padding: 0 8px; }
  .toolbar > .row .btn.primary { grid-column: 1 / -1; order: -1; }
  .kpis .v { font-size: 44px; }
  .scan-area { aspect-ratio: 1 / 1; }
}
.page.narrow.scan-page { max-width: 560px; }
@media (max-width: 640px) {
  .scan-area { aspect-ratio: 4 / 3; }
  .scan-page > * + * { margin-top: 32px; }
  .toolbar > .row { display: flex; flex-wrap: wrap; }
  .toolbar > .row .btn { flex: 1 1 0; }
  .toolbar > .row .btn.primary { flex-basis: 100%; }
}
@media (max-width: 640px) {
  .scan-area { gap: 14px; }
  .scan-area .frame { inset: 10% 8%; }
  .scan-area .small.faint { display: none; }
  .li .st { flex: none; font-size: 12px; }
  .li > .plate + .grow { min-width: 0; }
}
.cols-2 > *, .cols-3 > *, .inbox > *, .kpis > *, .metrics > *, .facts > * { min-width: 0; }
#vlist { overflow-x: auto; }
@media (max-width: 400px) {
  .table td, .table th { padding-right: 10px; }
  .table td:nth-child(2) .muted { display: block; }
  .main { padding-left: 16px; padding-right: 16px; }
}
