/* ─────────────────────────────────────────────────────────────────────────
   Design-Tokens – helles, professionelles Theme (Zielgruppe: Autohändler)
   ───────────────────────────────────────────────────────────────────────── */
:root {
    --bg:             #f3f5f8;
    --surface:        #ffffff;
    --surface-alt:    #f7f9fb;
    --border:         #e2e8f0;
    --border-strong:  #cbd5e1;
    --text:           #1e293b;
    --text-muted:     #64748b;
    --text-faint:     #94a3b8;

    --accent:          #0e9488;
    --accent-hover:    #0c7c72;
    --accent-soft:     #e6f7f5;
    --accent-contrast: #ffffff;

    --danger:        #dc2626;
    --danger-soft:   #fef2f2;
    --danger-border: #fecaca;
    --success:        #16a34a;
    --success-soft:   #f0fdf4;
    --success-border: #bbf7d0;
    --warning:        #b45309;
    --warning-soft:   #fffbeb;
    --warning-border: #fde68a;

    --shadow:    0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
    --shadow-md: 0 4px 16px rgba(15,23,42,.10);
    --radius:    10px;
    --radius-lg: 14px;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

body {
    background-color: var(--bg);
    color: var(--text);
}

/* ─────────────────────────────────────────────────────────────────────────
   Account-Seiten (Anmelden, Registrieren, Profil, Passkeys, Admin …) – ein
   gemeinsames, helles Theme statt der früher pro Seite duplizierten Styles.
   ───────────────────────────────────────────────────────────────────────── */
.account-page-bg { width: 100%; min-height: 100vh; background: var(--bg); box-sizing: border-box; }
.account-page    { max-width: 420px; margin: 0 auto; padding: 60px 20px; color: var(--text); font-family: system-ui, sans-serif; }
.account-page.account-page-wide { max-width: 720px; }
.account-page h1 { font-size: 22px; margin-bottom: 16px; color: var(--text); }
.account-page label { display: block; font-size: 12px; color: var(--text-muted); margin: 12px 0 4px; font-weight: 600; }
.lead { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

.field {
    width: 100%; box-sizing: border-box; background: var(--surface); color: var(--text);
    border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px 12px; font-size: 14px;
}
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-err { display: block; color: var(--danger); font-size: 12px; margin-top: 4px; }

.password-wrapper { position: relative; display: block; }
.password-wrapper .field { padding-right: 40px; }
.toggle-pw { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 16px; color: var(--text-faint); padding: 0; line-height: 1; }
.toggle-pw.active { color: var(--accent); }

.forgot-link { display: block; margin-top: 6px; font-size: 12px; color: var(--accent); text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.checkbox-row :deep(input) { width: auto; }

.btn-primary {
    display: inline-block; margin-top: 20px; background: var(--accent); color: var(--accent-contrast);
    border: none; border-radius: 10px; padding: 12px 20px; font-size: 14px; font-weight: 700; cursor: pointer;
    transition: background .15s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
    display: inline-block; margin-top: 20px; background: var(--surface); color: var(--accent);
    border: 1px solid var(--accent); border-radius: 10px; padding: 12px 20px; font-size: 14px; cursor: pointer;
    transition: background .15s;
}
.btn-secondary:hover { background: var(--accent-soft); }

/* Kompakter Outline-Button für Aktionen in Tabellen/Listen (Admin, Passkeys) */
.btn-danger {
    background: var(--surface); color: var(--danger); border: 1px solid var(--danger-border);
    border-radius: 8px; padding: 6px 12px; font-size: 12px; cursor: pointer;
}
.btn-danger:hover { background: var(--danger-soft); }

/* Gefüllter, großer Button für destruktive Haupt-Aktionen (z. B. Konto löschen) */
.btn-danger-solid {
    display: inline-block; margin-top: 20px; background: var(--danger); color: #fff; border: none;
    border-radius: 10px; padding: 12px 20px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-danger-solid:hover { background: #b91c1c; }

.btn-sm    { margin-top: 0 !important; padding: 6px 12px !important; font-size: 12px !important; border-radius: 8px !important; }
.btn-block { display: block; width: 100%; text-align: center; box-sizing: border-box; }

.or-sep { text-align: center; color: var(--text-faint); font-size: 12px; margin: 16px 0 10px; }
.hint { font-size: 13px; color: var(--text-muted); margin-top: 16px; }
.hint a { color: var(--accent); }

.status-message { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.status-message.ok  { background: var(--success-soft); color: #15803d; border: 1px solid var(--success-border); }
.status-message.err { background: var(--danger-soft);  color: #b91c1c; border: 1px solid var(--danger-border); }

.warning-box {
    background: var(--warning-soft); border: 1px solid var(--warning-border); color: #92400e;
    border-radius: 8px; padding: 12px 14px; font-size: 13px; margin-bottom: 20px;
}

.account-links { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.account-links a { color: var(--accent); text-decoration: none; }
.account-links a:hover { text-decoration: underline; }
.account-links a.danger { color: var(--danger); }

.user-table, .passkey-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.user-table th { text-align: left; font-size: 11px; color: var(--text-muted); text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.user-table td, .passkey-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); }
.passkey-table td { padding: 10px 0; }
.passkey-table small { color: var(--text-muted); }

/* ─────────────────────────────────────────────────────────────────────────
   Top-Navigation – helle Kopfleiste, auf allen Seiten identisch
   ───────────────────────────────────────────────────────────────────────── */
.top-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: 48px;
    padding: 0 18px; background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex; justify-content: space-between; align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.top-nav-links, .top-nav-actions { display: flex; align-items: center; gap: 4px; }
.top-nav-brand {
    color: var(--text); text-decoration: none; font-weight: 700; font-size: 14px;
    margin-right: 14px; letter-spacing: -.01em;
}
.top-nav-link {
    color: var(--text-muted); text-decoration: none; font-size: 13px; font-weight: 500;
    padding: 6px 10px; border-radius: 6px; transition: background .15s, color .15s;
}
.top-nav-link:hover  { background: var(--surface-alt); color: var(--text); }
.top-nav-admin       { color: #92400e; }
.top-nav-user        { color: var(--accent); font-weight: 600; }
.top-nav-actions     { gap: 6px; }
.top-nav-logout {
    background: none; border: 1px solid var(--border-strong); color: var(--text-muted);
    border-radius: 6px; padding: 5px 12px; font-size: 12px; cursor: pointer; transition: background .15s;
}
.top-nav-logout:hover { background: var(--surface-alt); color: var(--text); }
.top-nav-spacer { padding-top: 48px; }

/* ─────────────────────────────────────────────────────────────────────────
   App-Shell v0.80 – Splash, Konto-Kopfzeile, Prozess-Schrittleiste
   ───────────────────────────────────────────────────────────────────────── */

/* Inhalts-Wrapper: Platz für die fixe Konto-Kopfzeile (44). Auf Flow-Seiten
   (dort rendert AppChrome die Schrittleiste) zusätzlich 38 px. */
.app-shell                          { padding-top: 44px; }
body:has(.flow-stepper-bar) .app-shell { padding-top: 82px; }

/* Vollbild-Panels der Aufnahmeseite unter der fixen Kopfzeile+Schrittleiste halten
   (sonst schimmert die immer im DOM liegende Kamera-Steuerleiste durch). */
.scanner-container .mode-select,
.scanner-container .ss-panel,
.scanner-container .file-only-panel {
    position: fixed; inset: 82px 0 0 0; z-index: 40;
    background: var(--bg); overflow-y: auto;
    display: flex; flex-direction: column; align-items: center;
    padding: 20px 20px 40px;
}

/* ── Konto-Kopfzeile (ersetzt die frühere Top-Navigation) ─────────────── */
.top-account {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: 44px;
    padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex; align-items: center; justify-content: space-between;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.top-account__home     { display: flex; align-items: center; text-decoration: none; }
.top-account__home img { height: 30px; width: 30px; border-radius: 7px; display: block; }
.top-account__login    { color: var(--accent); font-weight: 600; text-decoration: none; font-size: 13px; }

/* Login-Kopf: Logo inline zur Überschrift */
.account-logo { height: 1.15em; width: 1.15em; border-radius: 5px; vertical-align: -0.2em; }

/* ── Splashscreen ─────────────────────────────────────────────────────── */
.splash {
    position: fixed; inset: 0; z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(150deg, var(--accent) 0%, var(--accent-hover) 70%);
    color: #fff;
    animation: splashOut .5s ease-in 1.6s forwards;
}
.splash.splash--gone  { opacity: 0; visibility: hidden; pointer-events: none; }
.splash__inner        { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.splash__logo         { width: 104px; height: 104px; border-radius: 22px; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: splashPop .5s ease-out; }
.splash__title        { font-size: 26px; font-weight: 800; letter-spacing: .01em; }
.splash__claim        { font-size: 13px; opacity: .85; }
@keyframes splashOut  { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@keyframes splashPop  { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .splash { animation: none; opacity: 0; visibility: hidden; pointer-events: none; }
}

/* ── Prozess-Schrittleiste (unter der Konto-Kopfzeile) ────────────────── */
.flow-stepper-bar {
    position: fixed; left: 0; right: 0; top: 44px; z-index: 999; height: 38px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
}
.flow-stepper {
    display: flex; align-items: center; gap: 6px; max-width: 520px; width: 100%;
    padding: 0 14px;
}
.flow-step {
    display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0;
    font-size: 11px; color: var(--text-faint);
}
button.flow-step {
    background: none; border: none; padding: 0; margin: 0; font: inherit;
    color: inherit; text-align: left; cursor: pointer;
}
.flow-step--link:hover .flow-step__label { color: var(--accent); text-decoration: underline; }
.flow-step--link:hover .flow-step__dot   { border-color: var(--accent); color: var(--accent); }
.flow-step:not(:last-child)::after {
    content: ""; flex: 1; height: 1px; background: var(--border-strong); margin: 0 2px;
}
.flow-step__dot {
    flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700;
    background: var(--surface-alt); color: var(--text-faint); border: 1px solid var(--border-strong);
}
.flow-step__label     { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-step--active     { color: var(--text); font-weight: 600; }
.flow-step--active .flow-step__dot   { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.flow-step--done       { color: var(--text-muted); }
.flow-step--done .flow-step__dot     { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* ── Coach-Marks ─────────────────────────────────────────────────────── */
.coach {
    position: fixed; inset: 0; z-index: 2500;
    background: rgba(15,23,42,.45);
    display: flex; align-items: flex-end; justify-content: center;
    padding: 16px;
}
.coach__card {
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg); padding: 16px 18px; width: 100%; max-width: 420px;
}
.coach__title  { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--text); }
.coach__list   { margin: 0 0 12px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.coach__list li { font-size: 13px; color: var(--text-muted); }
.coach__ok {
    width: 100%; background: var(--accent); color: var(--accent-contrast); border: none;
    border-radius: 10px; padding: 11px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.coach__ok:hover { background: var(--accent-hover); }

/* ── Konto-Menü in der Kopfzeile ─────────────────────────────────────── */
.acc-trigger {
    display: flex; align-items: center; gap: 6px; background: none; border: none;
    color: var(--text); font-size: 13px; cursor: pointer; padding: 6px 8px; border-radius: 8px;
}
.acc-trigger:hover { background: var(--surface-alt); }
.acc-user     { font-weight: 600; }
.acc-chevron  { color: var(--text-faint); transition: transform .15s; }
.acc-chevron.open { transform: rotate(180deg); color: var(--accent); }
.acc-menu {
    position: fixed; right: 8px; top: 46px; z-index: 1250;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
    box-shadow: var(--shadow-md); overflow: hidden; min-width: 240px;
}
.acc-menu__item {
    display: block; width: 100%; text-align: left; background: none; border: none;
    border-bottom: 1px solid var(--border); padding: 12px 14px; font-size: 14px;
    color: var(--text); cursor: pointer;
}
.acc-menu__item:last-child { border-bottom: none; }
.acc-menu__item:hover      { background: var(--accent-soft); color: var(--accent); }
.acc-menu__item--logout        { color: var(--danger); }
.acc-menu__item--logout:hover  { background: var(--danger-soft); color: var(--danger); }
.acc-scrim { position: fixed; inset: 0; z-index: 1240; background: transparent; }

.acc-modal-backdrop {
    position: fixed; inset: 0; z-index: 1300; background: rgba(15,23,42,.45);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.acc-modal {
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg); width: 100%; max-width: 420px; overflow: hidden;
}
.acc-modal__head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; border-bottom: 1px solid var(--border);
    font-size: 14px; font-weight: 600; color: var(--text);
}
.acc-modal__x { background: none; border: none; color: var(--text-faint); font-size: 16px; cursor: pointer; }
.acc-modal__x:hover { color: var(--text); }
.acc-modal__body { padding: 16px 18px; }
.acc-big     { font-size: 22px; font-weight: 800; color: var(--text); margin: 0 0 4px; }
.acc-hint    { font-size: 12px; color: var(--text-muted); margin: 8px 0 0; }
.acc-context { font-size: 12px; color: var(--text-faint); margin: 12px 0 0; }
.acc-table   { width: 100%; border-collapse: collapse; font-size: 14px; }
.acc-table td { padding: 8px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.acc-table tr:last-child td { border-bottom: none; }
.acc-table td:last-child { text-align: right; }
.acc-label   { display: block; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; font-weight: 600; }
.acc-level-row { display: flex; align-items: center; gap: 12px; }
.acc-level-row input[type=range] { flex: 1; }
.acc-level-val { font-size: 15px; font-weight: 700; color: var(--accent); min-width: 20px; text-align: right; }
.acc-save {
    margin-top: 12px; background: var(--accent); color: var(--accent-contrast); border: none;
    border-radius: 8px; padding: 10px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.acc-save:hover:not(:disabled) { background: var(--accent-hover); }
.acc-save:disabled { opacity: .5; cursor: default; }

.showroom-pick-one {
    display: flex; flex-direction: column; gap: 4px; width: 100%; max-width: 520px;
    font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px;
}
.showroom-pick-one select {
    font-weight: 400; background: var(--surface-alt); color: var(--text);
    border: 1px solid var(--border-strong); border-radius: 8px; padding: 9px 12px; font-size: 14px;
}

/* Drei-Karten-Auswahl der Erfassungsart (Index /scan). Auf schmalen Screens untereinander. */
.mode-cards--3 { flex-wrap: wrap; }
.mode-cards--3 .mode-card { cursor: pointer; }
.mode-cards--3 .mode-card { flex: 1 1 150px; }
@media (max-width: 560px) {
    .mode-cards--3 .mode-card { flex-basis: 100%; }
}

/* ── Datei-Modus: Positions-Raster ───────────────────────────────────── */
.pos-grid {
    display: grid; gap: 8px; width: 100%; max-width: 560px;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    margin: 8px 0 4px;
}
.pos-tile {
    position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden;
    border: 1px solid var(--border-strong); background: var(--surface-alt);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pos-tile--empty        { border-style: dashed; }
.pos-tile--done         { border-color: var(--accent); }
.pos-tile--busy         { opacity: .5; pointer-events: none; }
.pos-tile:hover         { border-color: var(--accent); }
.pos-tile__img          { width: 100%; height: 100%; object-fit: cover; display: block; }
.pos-tile__plus         { font-size: 22px; color: var(--text-faint); }
.pos-tile__num          { position: absolute; left: 3px; top: 3px; font-size: 10px; font-weight: 700;
                          background: rgba(15,23,42,.6); color: #fff; border-radius: 4px; padding: 1px 4px; }
.pos-tile__name         { position: absolute; left: 0; right: 0; bottom: 0; font-size: 9px; line-height: 1.2;
                          padding: 2px 4px; color: #fff; background: rgba(15,23,42,.55);
                          white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-tile--empty .pos-tile__num  { background: var(--border-strong); color: var(--text-muted); }
.pos-tile__plus                  { display: flex; flex-direction: column; }
.pos-tile__emptyname             { position: absolute; left: 4px; right: 4px; bottom: 3px;
                                   font-size: 9px; line-height: 1.15; color: var(--text-faint);
                                   text-align: center; }

.page {
    display: flex;
    flex-direction: row;
}

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
    color: white;
    padding: 1rem 0;
}

.top-row {
    background-color: #f7f6f3;
    border-bottom: 1px solid rgba(0,0,0,.1);
    padding-right: 1rem;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
}

main {
    flex: 1;
}

.content {
    padding-top: 1.1rem;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.0rem;
    position: fixed;
    right: 0;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.nav-item {
    z-index: 100;
}

.nav-link {
    color: #d7dadf;
    display: flex;
    padding: 0.5rem 1rem;
    text-decoration: none;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-link.active {
    background-color: rgba(255,255,255,.25);
    color: white;
}

.nav-link span {
    margin-right: 0.5rem;
}

.scanner-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #111;
    color: #fff;
}

.camera-wrapper {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.camera-feed {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.capture-canvas {
    position: absolute;
}

.overlay-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
