/* =========================================================================
   Leitstellen-Simulation – Design-System „Nachtschicht"
   Schriften (per <link> eingebunden): Barlow Condensed (Display),
   Barlow (Text), JetBrains Mono (FMS-Codes, Zahlen).
   ========================================================================= */

:root {
    /* Basis für halbtransparente Flächen (hell auf dunkel, im hellen Spiel umgekehrt) */
    --tint: 255, 255, 255;

    /* Flächen – von tief nach hoch */
    --ink-0: #070b15;
    --ink-1: #0b1220;
    --ink-2: #0f182a;
    --ink-3: #152036;
    --ink-4: #1b2944;
    --line: #22314d;
    --line-soft: #1a2740;

    /* Text */
    --text: #e6ecf7;
    --text-dim: #8d9bb6;
    --text-faint: #5c6b88;

    /* Blaulicht = Hauptakzent, Rot nur für Alarm/Gefahr */
    --blue: #4c8dff;
    --blue-strong: #2f6ff0;
    --blue-soft: rgba(76,141,255,0.14);
    --red: #f0473c;
    --red-strong: #d8352b;
    --red-soft: rgba(240,71,60,0.14);
    --amber: #f2b33d;
    --amber-soft: rgba(242,179,61,0.14);
    --green: #35c77c;
    --green-soft: rgba(53,199,124,0.14);
    --violet: #a47bff;
    --violet-soft: rgba(164,123,255,0.15);
    --cyan: #3ec3df;
    --cyan-soft: rgba(62,195,223,0.14);

    /* FMS-Status (gleiche Bedeutung wie FMS_STATUS in app.js) */
    --fms-1: var(--cyan);
    --fms-2: var(--green);
    --fms-3: var(--amber);
    --fms-4: var(--red);
    --fms-7: var(--violet);

    --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --font-body: 'Barlow', 'Segoe UI', Roboto, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

    --r-sm: 6px;
    --r: 10px;
    --r-lg: 16px;
    --shadow: 0 12px 32px rgba(2,6,16,0.45);
    --shadow-lg: 0 30px 80px rgba(2,6,16,0.65);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);

    /* Alte Variablennamen – falls noch irgendwo referenziert */
    --bg-dark: var(--ink-1);
    --panel-bg: var(--ink-2);
    --panel-bg-light: var(--ink-3);
    --border-col: var(--line);
    --text-main: var(--text);
    --accent-red: var(--red);
    --accent-blue: var(--blue);
    --accent-green: var(--green);
    --accent-yellow: var(--amber);
    --accent-purple: var(--violet);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    background: var(--ink-1);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; }

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

::selection { background: rgba(76,141,255,0.35); }

* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------------- Marke ---------------- */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
}

/* Kleines Blaulicht: rotierender Lichtkegel in einer Kapsel */
.brand-light {
    position: relative;
    width: 22px;
    height: 12px;
    border-radius: 6px 6px 3px 3px;
    background: #10204a;
    overflow: hidden;
    flex: 0 0 auto;
    box-shadow: 0 0 0 1px rgba(76,141,255,0.45);
}

.brand-light::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, #8fb8ff 45%, var(--blue) 55%, transparent 100%);
    animation: brand-sweep 1.6s linear infinite;
}

@keyframes brand-sweep {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

.brand-word {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
}

.brand-word span {
    color: var(--text-faint);
    font-weight: 500;
    margin-left: 6px;
}

/* ---------------- Buttons (Landing/Auth) ---------------- */
.btn,
.landing-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s var(--ease);
    white-space: nowrap;
}

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

.btn-primary, .landing-btn.primary {
    background: var(--blue-strong);
    border-color: var(--blue);
    color: #fff;
}
.btn-primary:hover, .landing-btn.primary:hover { background: var(--blue); }

.btn-ghost, .landing-btn.secondary {
    background: rgba(var(--tint), 0.02);
    border-color: var(--line);
    color: var(--text);
}
.btn-ghost:hover, .landing-btn.secondary:hover { border-color: var(--text-faint); background: rgba(var(--tint), 0.05); }

.btn-lg, .landing-btn.large { padding: 14px 24px; font-size: 15px; }

/* =========================================================================
   Landing Page
   ========================================================================= */
.landing-body {
    min-height: 100vh;
    background: var(--ink-0);
    overflow-x: hidden;
}

.landing-bg {
    position: absolute;
    inset: 0 0 auto 0;
    height: min(100vh, 980px);
    background:
        linear-gradient(180deg, rgba(7,11,21,0.35) 0%, rgba(7,11,21,0.55) 55%, var(--ink-0) 100%),
        linear-gradient(90deg, rgba(7,11,21,0.92) 0%, rgba(7,11,21,0.55) 55%, rgba(7,11,21,0.2) 100%),
        url('../images/leitstellen-simulation-hintergrund-4k.png') center 30% / cover no-repeat;
    z-index: 0;
    pointer-events: none;
}

.landing-nav,
.landing-main,
.landing-footer { position: relative; z-index: 1; }

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 22px 32px;
}

.landing-nav-actions { display: flex; gap: 10px; }

.landing-main { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* ---- Hero ---- */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 56px;
    align-items: center;
    min-height: min(760px, calc(100vh - 90px));
    padding: 40px 0 72px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 0 0 rgba(240,71,60,0.6);
    animation: eyebrow-ping 1.8s ease-out infinite;
}

@keyframes eyebrow-ping {
    0% { box-shadow: 0 0 0 0 rgba(240,71,60,0.6); }
    100% { box-shadow: 0 0 0 9px rgba(240,71,60,0); }
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(48px, 7.4vw, 96px);
    line-height: 0.92;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    margin: 0 0 26px;
}

.hero-title em {
    font-style: normal;
    color: var(--blue);
}

.hero-sub {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-dim);
    max-width: 520px;
    margin: 0 0 34px;
}

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

.hero-note {
    margin: 18px 0 0;
    font-size: 13px;
    color: var(--text-faint);
}

/* ---- Einsatzmeldung (Hero-Vorschau) ---- */
.hero-card {
    background: rgba(15,24,42,0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.hc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line-soft);
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-faint);
    letter-spacing: 0.04em;
}

.hc-alarm {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--red);
    font-weight: 700;
    text-transform: uppercase;
}

.hc-alarm::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: status-dot-pulse 1.1s ease-in-out infinite;
}

.hc-body { padding: 20px 18px 8px; }

.hc-mission { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }

.hc-mission img {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 12px;
    background: var(--amber-soft);
    padding: 6px;
}

.hc-mission-name {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 1.05;
}

.hc-mission-addr { font-size: 13px; color: var(--text-dim); }

.hc-progress {
    height: 6px;
    background: var(--ink-4);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}

.hc-progress span {
    display: block;
    height: 100%;
    width: 8%;
    background: var(--blue);
    border-radius: 6px;
    transition: width 1.2s var(--ease);
}

.hc-progress-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-faint);
    margin-bottom: 16px;
}

.hc-units { list-style: none; margin: 0; padding: 0 0 10px; }

.hc-unit {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--line-soft);
}

.hc-unit-name { font-weight: 600; font-size: 14px; }
.hc-unit-type { font-size: 12px; color: var(--text-faint); margin-left: 6px; }
.hc-unit-label { font-size: 12px; color: var(--text-dim); text-align: right; }

.hc-fms {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
    color: var(--fms-c, var(--text));
    background: color-mix(in srgb, var(--fms-c, var(--text)) 16%, transparent);
    transition: color 0.3s ease, background 0.3s ease;
}

.hc-unit[data-fms="1"] { --fms-c: var(--fms-1); }
.hc-unit[data-fms="2"] { --fms-c: var(--fms-2); }
.hc-unit[data-fms="3"] { --fms-c: var(--fms-3); }
.hc-unit[data-fms="4"] { --fms-c: var(--fms-4); }
.hc-unit[data-fms="7"] { --fms-c: var(--fms-7); }

.hc-unit.changed .hc-fms { animation: fms-flash 0.6s ease; }

@keyframes fms-flash {
    0% { transform: scale(1); }
    40% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

/* ---- Abschnitte ---- */
.landing-section { padding: 90px 0; border-top: 1px solid var(--line-soft); }

.section-label {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--blue);
    margin: 0 0 14px;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(32px, 4.2vw, 52px);
    line-height: 1;
    text-transform: uppercase;
    margin: 0 0 48px;
    max-width: 720px;
}

/* Schritte – echte Reihenfolge aus dem Onboarding */
.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    counter-reset: step;
}

.step {
    position: relative;
    padding: 28px 28px 8px 0;
    border-top: 2px solid var(--line);
}

.step::before {
    counter-increment: step;
    content: counter(step);
    display: block;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 18px;
}

.step:first-child { border-top-color: var(--blue); }

.step h3 {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 600;
    text-transform: uppercase;
    margin: 0 0 10px;
    line-height: 1.05;
}

.step p { margin: 0; color: var(--text-dim); max-width: 320px; }

/* Funktionen */
.features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--line-soft);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.feature {
    background: var(--ink-0);
    padding: 34px 34px 36px;
    transition: background 0.2s ease;
}

.feature:hover { background: var(--ink-1); }

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blue-soft);
    color: var(--blue);
    margin-bottom: 20px;
}

.feature-icon svg { width: 20px; height: 20px; }

.feature h3 { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
.feature p { margin: 0; color: var(--text-dim); max-width: 440px; }

/* Abschluss-CTA */
.cta-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
    padding: 44px 48px;
    margin: 0 0 90px;
    border-radius: var(--r-lg);
    border: 1px solid rgba(76,141,255,0.35);
    background:
        radial-gradient(600px 240px at 0% 0%, rgba(76,141,255,0.22), transparent 70%),
        var(--ink-2);
}

.cta-band h2 {
    font-family: var(--font-display);
    font-size: clamp(30px, 3.6vw, 44px);
    text-transform: uppercase;
    line-height: 1;
    margin: 0 0 8px;
}

.cta-band p { margin: 0; color: var(--text-dim); }

.landing-footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 26px 32px 40px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--line-soft);
    font-size: 13px;
    color: var(--text-faint);
}

.landing-footer p { margin: 0; }
.landing-footer a { color: var(--text-dim); text-decoration: none; }
.landing-footer a:hover { color: var(--text); }

/* =========================================================================
   Auth (Login / Registrierung)
   ========================================================================= */
.auth-body { min-height: 100vh; background: var(--ink-0); }

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
    min-height: 100vh;
}

.auth-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 32px 48px 48px;
    background:
        linear-gradient(180deg, rgba(7,11,21,0.4), rgba(7,11,21,0.85)),
        url('../images/leitstellen-simulation-hintergrund-4k.png') center / cover no-repeat;
    border-right: 1px solid var(--line-soft);
}

.auth-visual-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(40px, 5vw, 68px);
    line-height: 0.95;
    text-transform: uppercase;
    margin: 0 0 14px;
}

.auth-visual-title em { font-style: normal; color: var(--blue); }

.auth-visual-sub { color: var(--text-dim); max-width: 440px; margin: 0; }

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: var(--ink-1);
}

.auth-box { width: 100%; max-width: 380px; }

.auth-box h1 {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1;
    margin: 0 0 8px;
}

.auth-sub { color: var(--text-dim); margin: 0 0 28px; font-size: 14px; }

.auth-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.auth-form input:not([type="checkbox"]) {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 11px 13px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 15px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form input:not([type="checkbox"]):hover { border-color: var(--text-faint); }

.auth-form input:not([type="checkbox"]):focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-soft);
}

.auth-form button {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    background: var(--blue-strong);
    border: 1px solid var(--blue);
    border-radius: var(--r-sm);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.auth-form button:hover { background: var(--blue); }

.auth-error {
    background: var(--red-soft);
    border: 1px solid rgba(240,71,60,0.4);
    color: #ffb3ad;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    font-size: 13.5px;
    margin-bottom: 20px;
}

.auth-switch {
    margin: 24px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--line-soft);
    font-size: 14px;
    color: var(--text-dim);
}

.auth-switch a { color: var(--blue); text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

.auth-back-link {
    display: inline-flex;
    margin-bottom: 36px;
    font-size: 13px;
    color: var(--text-faint);
    text-decoration: none;
}
.auth-back-link:hover { color: var(--text); }

.auth-consent {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    font-size: 12.5px !important;
    font-weight: 400 !important;
    color: var(--text-dim);
    margin-bottom: 20px !important;
    line-height: 1.5;
    cursor: pointer;
}

.auth-consent input[type="checkbox"] {
    margin: 2px 0 0;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
}

/* =========================================================================
   Dashboard – Vollbild-Karte mit schwebenden Glas-Panels
   ========================================================================= */
.dashboard-body {
    --gap: 12px;
    --topbar-h: 58px;
    --panel-w: 332px;
    height: 100vh;
    overflow: hidden;
    font-size: 14px;
}

.app-layout { position: relative; height: 100%; }

.map-area { position: absolute; inset: 0; }

#map { position: absolute; inset: 0; background: #0a1322; }

/* Dunkle Karte: die OSM-Kacheln werden per Filter eingefärbt – nur die
   Kachel-Ebene, Marker und fahrende Fahrzeuge behalten ihre Farben. */
.map-area .leaflet-tile-pane {
    filter: invert(1) hue-rotate(190deg) brightness(0.88) contrast(0.92) saturate(0.55);
}

.glass {
    background: rgba(12, 20, 36, 0.8);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid rgba(130, 160, 220, 0.14);
    box-shadow: 0 18px 50px rgba(2, 6, 16, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ---------------- Befehlsleiste ---------------- */
.topbar {
    position: absolute;
    top: var(--gap);
    left: var(--gap);
    right: var(--gap);
    height: var(--topbar-h);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 8px 0 18px;
    border-radius: 16px;
}

.topbar-brand { flex: 0 0 auto; }

.topbar-actions {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.topbar-actions::-webkit-scrollbar { display: none; }

.topbar-sep {
    flex: 0 0 auto;
    width: 1px;
    height: 22px;
    margin: 0 8px;
    background: var(--line);
}

.topbar-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px 0 13px;
    border-radius: 11px;
    border: 1px solid transparent;
    background: var(--blue-strong);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(47, 111, 240, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s var(--ease);
}

.topbar-btn:hover:not(:disabled) { background: var(--blue); }
.topbar-btn:active:not(:disabled) { transform: translateY(1px); }

.topbar-btn:disabled {
    background: rgba(var(--tint), 0.05);
    color: var(--text-faint);
    box-shadow: none;
    cursor: not-allowed;
}

.topbar-btn.secondary {
    background: transparent;
    color: var(--text-dim);
    box-shadow: none;
}

.topbar-btn.secondary:hover:not(:disabled) { background: rgba(var(--tint), 0.06); color: var(--text); }

.topbar-btn.secondary.active {
    background: var(--amber-soft);
    border-color: rgba(242, 179, 61, 0.35);
    color: var(--amber);
}

.cmd-icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-play { display: none; }
.topbar-btn.active .icon-play { display: block; }
.topbar-btn.active .icon-pause { display: none; }

.topbar-user {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.credits,
.coins {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 13px;
    border-radius: 11px;
    background: rgba(var(--tint), 0.035);
    border: 1px solid var(--line-soft);
    font-family: var(--font-mono);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.credits::before,
.coins::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.credits::before { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.coins::before { background: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }

.chip-label {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

/* Benutzermenü (natives <details>, kein JS nötig) */
.user-menu { position: relative; margin-left: 4px; }

.username {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 40px;
    padding: 0 10px 0 5px;
    border-radius: 11px;
    list-style: none;
    cursor: pointer;
    color: var(--text);
    font-weight: 600;
    transition: background 0.15s ease;
}

.username::-webkit-details-marker { display: none; }
.username:hover, .user-menu[open] .username { background: rgba(var(--tint), 0.06); }

.topbar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--blue-strong), #6aa4ff);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}

.user-caret {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: var(--text-faint);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s var(--ease);
}

.user-menu[open] .user-caret { transform: rotate(180deg); }

.user-menu-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    min-width: 200px;
    padding: 6px;
    border-radius: 13px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: modal-pop 0.2s var(--ease);
}

.logout-link {
    display: block;
    padding: 10px 12px;
    border-radius: 9px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.logout-link:hover { background: rgba(var(--tint), 0.06); color: var(--text); }

/* ---------------- Schwebende Panels ---------------- */
.sidebar {
    position: absolute;
    top: calc(var(--gap) * 2 + var(--topbar-h));
    /* Panel wächst mit dem Inhalt und scrollt erst am unteren Rand */
    max-height: calc(100% - var(--gap) * 3 - var(--topbar-h));
    width: var(--panel-w);
    z-index: 900;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
}

.sidebar-left { left: var(--gap); }
.sidebar-right { right: var(--gap); }

.panel-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 15px 16px 13px 18px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--line-soft);
    color: inherit;
    text-align: left;
    cursor: pointer;
}


.panel-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text);
}

.panel-count {
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--tint), 0.07);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 700;
}

.panel-count.is-alert { background: var(--red-soft); color: #ff8a82; }

.panel-caret {
    margin-left: auto;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--text-faint);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s var(--ease), stroke 0.15s ease;
}

.panel-head:hover .panel-caret { stroke: var(--text); }

.panel-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
}


.empty-hint {
    color: var(--text-faint);
    font-size: 13px;
    padding: 8px 10px;
    margin: 0;
}

/* ---------------- Wachen-Liste (linkes Panel) ---------------- */
.station-card {
    --type-c: var(--text-faint);
    border-radius: 11px;
    margin-bottom: 2px;
    transition: background 0.15s ease;
}

.station-card[data-type="leitstelle"] { --type-c: #2cc5b9; }
.station-card[data-type="feuerwehr"] { --type-c: var(--red); }
.station-card[data-type="rettungsdienst"] { --type-c: var(--blue); }
.station-card[data-type="polizei"] { --type-c: #7d97e8; }
.station-card[data-type="krankenhaus"] { --type-c: var(--violet); }

.station-card:hover { background: rgba(var(--tint), 0.04); }
.station-card.expanded { background: rgba(var(--tint), 0.045); }

.station-card-header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    cursor: pointer;
}

.station-card-header::before {
    content: '';
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 3px;
    background: var(--type-c);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--type-c) 22%, transparent);
}

.station-card-chevron {
    flex: 0 0 auto;
    margin-left: auto;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    color: var(--text-faint);
    transition: transform 0.2s var(--ease);
}

.station-card-chevron::before {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(-45deg);
}

.station-card:hover .station-card-chevron { color: var(--text); }
.station-card.expanded .station-card-chevron { transform: rotate(90deg); }

.station-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    font-size: 13.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.station-card .vehicle-rows { padding: 0 6px 8px 22px; }

.vehicle-rows { display: flex; flex-direction: column; gap: 4px; }

.station-card-hospital-beds { font-size: 13px; font-weight: 600; color: var(--violet); margin: 0 0 4px; }

.vehicle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: var(--r-sm);
    background: var(--ink-3);
    border: 1px solid var(--line-soft);
    box-shadow: inset 3px 0 0 var(--line);
    transition: background 0.15s ease;
}

.vehicle-row:hover { background: var(--ink-4); }

.vehicle-cat-icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    background: rgba(var(--tint), 0.05);
}

.vehicle-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.vehicle-main .vehicle-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vehicle-main .vehicle-type {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-faint);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.vehicle-status {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.vehicle-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

.vehicle-row.status-station { box-shadow: inset 3px 0 0 var(--fms-2); }
.vehicle-row.status-enroute { box-shadow: inset 3px 0 0 var(--fms-3); }
.vehicle-row.status-onscene { box-shadow: inset 3px 0 0 var(--fms-4); }
.vehicle-row.status-transporting { box-shadow: inset 3px 0 0 var(--fms-7); }
.vehicle-row.status-returning { box-shadow: inset 3px 0 0 var(--fms-1); }

.vehicle-row.status-station .vehicle-status,
.vehicle-row.status-station .fms-badge { color: var(--fms-2); background: var(--green-soft); }
.vehicle-row.status-enroute .vehicle-status,
.vehicle-row.status-enroute .fms-badge { color: var(--fms-3); background: var(--amber-soft); }
.vehicle-row.status-onscene .vehicle-status,
.vehicle-row.status-onscene .fms-badge { color: var(--fms-4); background: var(--red-soft); }
.vehicle-row.status-transporting .vehicle-status,
.vehicle-row.status-transporting .fms-badge { color: var(--fms-7); background: var(--violet-soft); }
.vehicle-row.status-returning .vehicle-status,
.vehicle-row.status-returning .fms-badge { color: var(--fms-1); background: var(--cyan-soft); }

.vehicle-row.status-onscene .vehicle-status-dot,
.vehicle-row.status-enroute .vehicle-status-dot,
.vehicle-row.status-transporting .vehicle-status-dot {
    animation: status-dot-pulse 1.4s ease-in-out infinite;
}

@keyframes status-dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Kompaktere Variante für die Wachen-Karten in der linken Sidebar:
   kein Icon, nur Funkname + FMS-Status für einen schnellen Überblick. */
.vehicle-row.compact {
    padding: 6px 9px;
    gap: 8px;
    background: transparent;
    border-color: transparent;
}

.vehicle-row.compact:hover { background: var(--ink-4); }

.vehicle-row.compact .vehicle-name {
    flex: 1 1 auto;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vehicle-row.compact .fms-wrap { flex: 0 0 auto; }
.vehicle-row.compact .fms-badge { width: 20px; height: 20px; font-size: 11px; }
.vehicle-row.compact .fms-label { font-size: 11px; }

/* ---------------- Einsatz-Liste (rechtes Panel) ---------------- */
.mission-card {
    position: relative;
    padding: 12px 12px 12px 20px;
    margin-bottom: 4px;
    border-radius: 11px;
    background: rgba(var(--tint), 0.035);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.mission-card::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 3px;
    background: var(--red);
    box-shadow: 0 0 10px rgba(240, 71, 60, 0.6);
}

.mission-card:hover { background: rgba(var(--tint), 0.065); border-color: var(--line); }

.mission-card.status-dispatched::before { background: var(--blue); box-shadow: none; }
.mission-card.escalated::before { background: var(--amber); box-shadow: 0 0 10px rgba(242, 179, 61, 0.5); }

.mission-escalated-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--amber);
    background: var(--amber-soft);
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 6px;
}

.mission-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 3px;
}

.mission-reward {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--amber);
    white-space: nowrap;
}

.mission-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }

.mission-requirements { font-size: 12px; color: var(--text-dim); }

.mission-card-progress-wrap { margin-top: 10px; }

.mission-card-progress-bar {
    height: 4px;
    background: rgba(var(--tint), 0.07);
    border-radius: 4px;
    overflow: hidden;
}

.mission-card-progress-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-faint);
    margin-top: 5px;
}

/* ---------------- Karten-Icons ---------------- */
.station-pin { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.55)); }

.mission-pin {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.55));
    animation: mission-pin-pulse 1.4s ease-in-out infinite;
}

/* Opacity statt transform: Leaflet positioniert Marker-Icons selbst über eine
   transform-Eigenschaft (translate3d) direkt am Icon-Element – eine eigene
   transform-Animation auf demselben Element würde die Positionierung
   überschreiben und den Marker an die falsche Stelle springen lassen. */
@keyframes mission-pin-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.mission-icon-inner {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    background: var(--amber);
    color: #21150a;
    font-weight: 700;
    animation: pulse-mission 1.4s ease-in-out infinite;
}

.moving-vehicle-inner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.55);
    transition: transform 0.2s ease;
    overflow: hidden;
}

.moving-vehicle-inner img { width: 100%; height: 100%; object-fit: cover; }

.moving-vehicle-inner.has-picture {
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    overflow: visible;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
}

.moving-vehicle-inner.has-picture img { object-fit: contain; image-rendering: -webkit-optimize-contrast; }

@keyframes pulse-mission {
    0%, 100% { box-shadow: 0 0 0 0 rgba(242,179,61,0.6); }
    50% { box-shadow: 0 0 0 9px rgba(242,179,61,0); }
}

/* ---------------- Leaflet an das Theme anpassen ---------------- */
.leaflet-container { font-family: var(--font-body); }

.leaflet-popup-content-wrapper {
    background: rgba(12, 20, 36, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    border: 1px solid rgba(130, 160, 220, 0.16);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.leaflet-popup-content { margin: 12px 16px; font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.leaflet-popup-content strong { color: var(--text); font-size: 14px; }
.leaflet-popup-tip { background: rgba(12, 20, 36, 0.92); }

.leaflet-container a.leaflet-popup-close-button { color: var(--text-faint); }
.leaflet-container a.leaflet-popup-close-button:hover { color: var(--text); }

/* Zoom + Attribution bleiben fest unten rechts. Damit ein langes Einsatz-Panel
   sie nicht verdeckt, endet das rechte Panel oberhalb davon. */
.dashboard-body .leaflet-bottom.leaflet-right { right: 0; }

.dashboard-body .sidebar-right {
    max-height: calc(100% - var(--gap) * 3 - var(--topbar-h) - 104px);
}

.leaflet-bar,
.leaflet-touch .leaflet-bar {
    border: 1px solid rgba(130, 160, 220, 0.16) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow) !important;
    overflow: hidden;
}

.leaflet-bar a,
.leaflet-touch .leaflet-bar a {
    width: 38px;
    height: 38px;
    line-height: 38px;
    background: rgba(12, 20, 36, 0.85);
    color: var(--text);
    border-bottom-color: var(--line-soft);
    font-weight: 400;
}

.leaflet-bar a:hover { background: rgba(27, 41, 68, 0.95); color: #fff; }

.leaflet-container .leaflet-control-attribution {
    background: rgba(7, 11, 21, 0.6);
    color: var(--text-faint);
    border-top-left-radius: 8px;
    font-size: 10.5px;
}

.leaflet-control-attribution a { color: var(--text-dim); }

/* ---------------- Platzierungs-Pin (Onboarding) ---------------- */
.placement-pin-inner {
    width: 24px;
    height: 24px;
    background: var(--blue);
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placement-pin-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    transform: rotate(45deg);
}

.placement-overlay {
    position: absolute;
    top: calc(var(--gap) * 2 + var(--topbar-h) + 4px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 950;
    pointer-events: none;
}

.placement-overlay.hidden { display: none; }

.placement-banner {
    background: rgba(15,24,42,0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(76,141,255,0.5);
    border-radius: var(--r);
    padding: 12px 18px;
    max-width: 480px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
}

.placement-banner strong { font-size: 14px; }
.placement-banner p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-dim); }

.placement-search-row {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.placement-search-row input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--ink-1);
    color: var(--text);
    font-size: 13px;
}

.placement-search-row input:focus { outline: none; border-color: var(--blue); }

.placement-search-row button {
    margin-top: 0;
    flex: 0 0 auto;
    white-space: nowrap;
}

.placement-search-status {
    min-height: 15px;
    word-break: break-word;
}

#build-vehicle-wrap.hidden { display: none; }

.build-cost-hint {
    margin: 6px 0 0;
    font-size: 12.5px;
    color: var(--text-dim);
}

.build-cost-hint.insufficient { color: var(--red); font-weight: 600; }

.placement-banner button {
    margin-top: 10px;
    padding: 7px 14px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.placement-banner button:hover { border-color: var(--text-faint); background: var(--ink-3); }

.placement-banner button.primary {
    background: var(--blue-strong);
    border-color: var(--blue);
    color: #fff;
    font-weight: 600;
}
.placement-banner button.primary:hover { background: var(--blue); }

/* ---------------- Onboarding-Willkommen / Platzierungs-Modal ---------------- */
.placement-modal-content { width: 440px; }

.onboarding-welcome-text {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.6;
    margin: 0 0 14px;
}
.onboarding-welcome-text strong { color: var(--text); }

.placement-modal-content label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 18px;
}

.placement-modal-content input[type="text"],
.placement-modal-content select {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 10px 12px;
    background: var(--ink-1);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 14px;
}

.placement-modal-content input[type="text"]:focus,
.placement-modal-content select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

.placement-modal-content select option {
    background: var(--ink-2);
    color: var(--text);
}

/* ---------------- Modals ---------------- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(4,7,14,0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: modal-fade 0.2s ease;
}

@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }

.modal.hidden { display: none; }

.modal.modal-top { z-index: 2100; }

.modal-content {
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    width: 440px;
    max-width: 92vw;
    max-height: 84vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modal-pop 0.25s var(--ease);
}

@keyframes modal-pop {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    color: var(--text-faint);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
}
.modal-close:hover { color: var(--text); background: var(--ink-3); border-color: var(--line); }

.modal-content h3 {
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 1.05;
    padding-right: 36px;
}

.dispatch-modal-content {
    width: 1100px;
    max-width: 95vw;
}

.dispatch-modal-content h3 { font-size: 28px; margin: 0 0 6px; }

.assigned-vehicle-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
}

.vehicle-select-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: var(--ink-3);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-sm);
    padding: 10px 12px;
    color: var(--text);
    font-size: 13.5px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.vehicle-select-row:hover { border-color: var(--line); background: var(--ink-4); }

.vehicle-select-row.selected {
    border-color: rgba(76,141,255,0.6);
    background: var(--blue-soft);
}

.vehicle-select-row.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vehicle-select-checkbox {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
    cursor: pointer;
}

.vehicle-select-info {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.vehicle-select-info .vehicle-station { margin-left: 0; }

.vehicle-emoji { margin-right: 6px; }

#dispatch-selected-btn {
    width: 100%;
    padding: 13px;
    background: var(--red-strong);
    border: 1px solid var(--red);
    border-radius: var(--r-sm);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.15s ease;
}

#dispatch-selected-btn:hover:not(:disabled) { background: var(--red); }

#dispatch-selected-btn:disabled {
    background: var(--ink-3);
    border-color: var(--line);
    color: var(--text-faint);
    cursor: not-allowed;
}

/* ---------------- Wachen-Detail-Modal ---------------- */
.station-modal-content {
    width: 1180px;
    max-width: 98vw;
    max-height: 94vh;
    padding: 32px;
}

.station-modal-content h3 { font-size: 28px; margin: 0 0 6px; }

.station-modal-subtitle {
    color: var(--text-dim);
    font-size: 13.5px;
    margin: 0 0 20px;
}

/* Modal mit fester Sidebar: die Höhe bleibt beim Umschalten (Tabs, Status-
   Updates) immer gleich, nur der Inhaltsbereich rechts scrollt. Wird sowohl
   vom Wachen-Modal als auch vom Einsatz-Modal genutzt. */
.modal-with-sidebar {
    display: flex;
    align-items: stretch;
    padding: 0;
    height: min(760px, 88vh);
    overflow: hidden;
}

#dispatch-modal .modal-with-sidebar {
    height: min(920px, 94vh);
}

.modal-sidebar {
    flex: 0 0 250px;
    padding: 30px 18px 24px 22px;
    background: var(--ink-1);
    border-right: 1px solid var(--line);
    overflow-y: auto;
}

.modal-sidebar .station-modal-subtitle { margin-bottom: 26px; }

.modal-main {
    flex: 1 1 auto;
    min-width: 0;
    overflow-y: auto;
    padding: 30px 34px;
}

/* Einsatz-Modal: Liste scrollt eigenständig, der Alarmieren-Button sitzt oben
   in einem eigenen Footer-Bereich und bleibt so immer sofort sichtbar/klickbar,
   egal wie lang die Fahrzeugliste wird (statt erst ans Ende scrollen zu
   müssen). Nur für das Einsatz-Modal überschrieben (statt global in
   .modal-main), damit das Wachen-Modal, das dieselbe Klasse ohne diese
   Aufteilung nutzt, sein normales Scroll-/Padding-Verhalten behält. */
#dispatch-modal .modal-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.modal-main-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 26px 34px 30px;
}

.modal-main-footer {
    flex: 0 0 auto;
    padding: 16px 70px 16px 34px;
    border-bottom: 1px solid var(--line);
    background: var(--ink-2);
}

.modal-main-footer:empty { display: none; }

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

.station-tab {
    position: relative;
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    padding: 9px 12px;
    border-radius: var(--r-sm);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.station-tab:hover { color: var(--text); background: var(--ink-3); }

.station-tab.active {
    background: var(--blue-soft);
    border-color: rgba(76,141,255,0.35);
    color: #cfe0ff;
    font-weight: 600;
}

.station-tab.active::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--blue);
}

.station-tab.hidden { display: none; }

.open-market-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 18px;
    padding: 12px;
    background: var(--blue-strong);
    border: 1px solid var(--blue);
    border-radius: var(--r-sm);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.open-market-btn:hover { background: var(--blue); }

.market-capacity-hint {
    font-size: 13px;
    color: var(--text-dim);
    margin: 0 0 18px;
}

/* ---------------- Fahrzeug-Tabelle (Wachen-Modal, alle Kategorien) ---------------- */
.vehicle-table-wrap {
    overflow-x: auto;
    margin-bottom: 20px;
}

.vehicle-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    font-size: 13.5px;
}

.vehicle-table thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    padding: 0 14px 6px;
    white-space: nowrap;
}

.vehicle-table tbody tr.vehicle-table-row:hover td { background: var(--ink-4); }

.vehicle-table tbody tr.vehicle-table-row td {
    background: var(--ink-3);
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
    padding: 9px 14px;
    vertical-align: middle;
    transition: background 0.15s ease;
}

.vehicle-table tbody tr.vehicle-table-row td:first-child {
    border-left: 3px solid var(--line);
    border-top-left-radius: var(--r-sm);
    border-bottom-left-radius: var(--r-sm);
}

.vehicle-table tbody tr.vehicle-table-row td:last-child {
    border-right: 1px solid var(--line-soft);
    border-top-right-radius: var(--r-sm);
    border-bottom-right-radius: var(--r-sm);
}

.vehicle-table tbody tr.status-station td:first-child { border-left-color: var(--fms-2); }
.vehicle-table tbody tr.status-enroute td:first-child { border-left-color: var(--fms-3); }
.vehicle-table tbody tr.status-onscene td:first-child { border-left-color: var(--fms-4); }
.vehicle-table tbody tr.status-transporting td:first-child { border-left-color: var(--fms-7); }
.vehicle-table tbody tr.status-returning td:first-child { border-left-color: var(--fms-1); }

.vt-vehicle { white-space: nowrap; }
.vt-vehicle .vehicle-name { font-size: 13.5px; font-weight: 600; color: var(--text); }

.vt-fms { white-space: nowrap; }

.fms-wrap { display: inline-flex; align-items: center; gap: 8px; }

.fms-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    background: rgba(var(--tint), 0.07);
    color: var(--text);
}

.vehicle-table tbody tr.status-station .fms-badge { background: var(--green-soft); color: var(--fms-2); }
.vehicle-table tbody tr.status-enroute .fms-badge { background: var(--amber-soft); color: var(--fms-3); }
.vehicle-table tbody tr.status-onscene .fms-badge { background: var(--red-soft); color: var(--fms-4); }
.vehicle-table tbody tr.status-transporting .fms-badge { background: var(--violet-soft); color: var(--fms-7); }
.vehicle-table tbody tr.status-returning .fms-badge { background: var(--cyan-soft); color: var(--fms-1); }

.fms-label { font-size: 12px; color: var(--text-dim); }

.vt-mission {
    color: var(--text-dim);
    font-size: 13px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vt-crew { text-align: center; font-family: var(--font-mono); font-weight: 600; font-size: 12.5px; }

.vt-action { text-align: right; }

.station-buy-heading {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 12px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

/* ---------------- Fahrzeugmarkt ---------------- */
.market-group { margin-bottom: 26px; }
.market-group:last-child { margin-bottom: 0; }

.market-group-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.market-group-title::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: var(--line-soft);
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    /* Ohne das strecken sich CSS-Grid-Zellen standardmäßig auf die Höhe der
       größten Karte einer Zeile – kombiniert mit .market-card-descs flex-grow
       konnte das bei einer ungewöhnlich langen Beschreibung (z.B. lange
       Erweiterungs-Texte) den Kaufen-Button benachbarter Karten weit nach
       unten schieben. */
    align-items: start;
}

.market-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--ink-3);
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    padding: 14px;
    transition: border-color 0.15s ease;
}

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

.market-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.market-card-name { font-weight: 600; font-size: 14.5px; }
.market-card-cost { font-family: var(--font-mono); color: var(--amber); font-size: 12px; font-weight: 600; white-space: nowrap; }

.market-card-locked { opacity: 0.5; }

.market-card-desc {
    font-size: 12.5px;
    color: var(--text-dim);
    line-height: 1.45;
    margin: 0;
}

.market-card-specs {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    background: var(--ink-1);
    border-radius: var(--r-sm);
    padding: 7px 9px;
}

/* ---------------- Fahrzeug-Kapazität & Personal ---------------- */
.station-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.station-stat {
    background: var(--ink-3);
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.station-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
}

.station-stat-value {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.personnel-panel {
    background: var(--ink-3);
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    padding: 16px 18px;
    margin-bottom: 20px;
}

.personnel-info { font-size: 13px; color: var(--text-dim); margin: 0 0 12px; line-height: 1.55; }
.personnel-info strong { color: var(--green); font-size: 13.5px; }

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

.personnel-btn {
    padding: 8px 14px;
    border-radius: var(--r-sm);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    background: var(--blue-strong);
    border: 1px solid var(--blue);
    color: #fff;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.personnel-btn:hover:not(:disabled) { background: var(--blue); }

.personnel-btn.secondary {
    background: transparent;
    border-color: var(--line);
    color: var(--text-dim);
}

.personnel-btn.secondary:hover:not(:disabled) { background: var(--ink-4); color: var(--text); border-color: var(--text-faint); }

.personnel-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------------- Gebäudekomplex-Tab ---------------- */
.gk-field {
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line-soft);
}

.gk-field:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.gk-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-bottom: 9px;
}

.gk-name-row { display: flex; gap: 8px; }

.gk-name-row input {
    flex: 1 1 auto;
    padding: 9px 12px;
    background: var(--ink-1);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 14px;
}

.gk-name-row input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

.gk-name-row button, .gk-level-row button {
    padding: 9px 14px;
    background: var(--blue-strong);
    border: 1px solid var(--blue);
    border-radius: var(--r-sm);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.gk-name-row button:hover, .gk-level-row button:hover:not(:disabled) { background: var(--blue); }
.gk-level-row button:disabled { opacity: 0.4; cursor: not-allowed; }

.gk-level-row, .gk-active-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.gk-level-value { font-family: var(--font-mono); font-size: 16px; font-weight: 600; }
.gk-level-max { font-size: 12.5px; color: var(--text-faint); }

.gk-active-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.gk-active-badge.active { color: var(--green); background: var(--green-soft); }
.gk-active-badge.inactive { color: var(--red); background: var(--red-soft); }

.gk-toggle-active-btn,
.gk-move-btn {
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.gk-toggle-active-btn:hover,
.gk-move-btn:hover { border-color: var(--text-faint); background: var(--ink-3); }

.gk-generates { font-size: 14px; margin: 0; }

.gk-demolish-btn {
    padding: 8px 14px;
    background: transparent;
    border: 1px solid rgba(240,71,60,0.5);
    border-radius: var(--r-sm);
    color: var(--red);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.gk-demolish-btn:hover { background: var(--red-soft); }

.vehicle-buy-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--green);
    border: 1px solid var(--green);
    border-radius: var(--r-sm);
    padding: 9px 12px;
    color: #06240f;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.vehicle-buy-btn:hover:not(:disabled) { filter: brightness(1.1); }

.vehicle-buy-btn:disabled {
    cursor: not-allowed;
    background: var(--ink-2);
    border-color: var(--line);
    color: var(--text-faint);
}

.vehicle-station {
    margin-left: auto;
    color: var(--text-faint);
    font-size: 11.5px;
}

/* ---------------- Fahrzeug-Einstellungen ---------------- */
.vehicle-edit-btn,
.vehicle-cancel-btn {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text-dim);
    font-size: 14px;
    padding: 0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.vehicle-edit-btn:hover { color: #fff; border-color: var(--blue); background: var(--blue-soft); }
.vehicle-cancel-btn:hover { color: #fff; border-color: var(--amber); background: var(--amber-soft); }

.vt-action-buttons { display: flex; justify-content: flex-end; gap: 6px; }

.vehicle-select-hint { font-style: normal; color: var(--amber); font-size: 11.5px; }

.vehicle-edit-modal-content {
    width: 460px;
    max-width: 92vw;
    padding: 28px;
}

.vehicle-edit-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--text-dim);
}

.vehicle-edit-form label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 14px;
}

.vehicle-edit-form input {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 10px 12px;
    background: var(--ink-1);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 14px;
}

.vehicle-edit-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

.vehicle-edit-actions { display: flex; gap: 8px; margin-top: 8px; }

.vehicle-edit-actions button {
    flex: 1;
    padding: 10px;
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--line);
}

.ve-save-btn { background: var(--blue-strong); border-color: var(--blue) !important; color: #fff; }
.ve-save-btn:hover { background: var(--blue); }
.ve-cancel-btn { background: transparent; color: var(--text-dim); }
.ve-cancel-btn:hover { color: var(--text); background: var(--ink-3); }

.ve-delete-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 10px;
    background: transparent;
    border: 1px solid rgba(240,71,60,0.5);
    border-radius: var(--r-sm);
    color: var(--red);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ve-delete-btn:hover { background: var(--red-soft); }

/* ---------------- Einsatzmeldung / Alarm ---------------- */
.meldung-label {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    color: var(--red);
    font-weight: 700;
    margin: 0 0 8px;
}

.meldung-text {
    font-size: 15px;
    line-height: 1.55;
    margin: 0 0 16px;
}

.meldung-escalated {
    font-size: 13px;
    line-height: 1.5;
    color: var(--amber);
    font-weight: 600;
    background: var(--amber-soft);
    border: 1px solid rgba(242,179,61,0.3);
    border-radius: var(--r-sm);
    padding: 9px 12px;
    margin: 0 0 16px;
}

.meldung-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12.5px;
    color: var(--text-dim);
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
    padding: 11px 0;
    margin-bottom: 18px;
}

.mission-progress-wrap { margin-bottom: 22px; }

.mission-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--text-dim);
    margin-bottom: 7px;
}

.mission-progress-bar {
    height: 10px;
    background: var(--ink-4);
    border-radius: 10px;
    overflow: hidden;
}

.mission-progress-fill {
    height: 100%;
    background: var(--blue);
    border-radius: inherit;
    transition: background 0.3s ease;
}

.mission-progress-fill.idle {
    background: repeating-linear-gradient(45deg,
        var(--text-faint) 0, var(--text-faint) 8px,
        transparent 8px, transparent 16px);
    background-size: 22px 100%;
    opacity: 0.6;
    animation: mission-progress-idle-stripes 0.9s linear infinite;
}

@keyframes mission-progress-idle-stripes {
    from { background-position: 0 0; }
    to { background-position: 22px 0; }
}

.alarm-vehicle-heading {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 10px;
}

.alarm-vehicle-list { display: flex; flex-direction: column; gap: 4px; }

/* ---------------- Patienten (Einsatz-Modal) ---------------- */
.patient-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; }

.patient-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--ink-3);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-sm);
    padding: 9px 12px;
}

.patient-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; }

.patient-status {
    font-size: 12.5px;
    color: var(--text-dim);
    text-align: right;
}

.patient-status.done { color: var(--green); font-weight: 600; }

.patient-progress-wrap { flex: 1 1 auto; max-width: 220px; }

.patient-progress-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-faint);
    text-align: right;
    margin-bottom: 4px;
}

.patient-progress-bar {
    height: 6px;
    background: var(--ink-1);
    border-radius: 6px;
    overflow: hidden;
}

.patient-progress-fill {
    height: 100%;
    background: var(--violet);
    border-radius: inherit;
    transition: width 1s linear;
}

/* ---------------- Einsatz-Modal-Sidebar: Fahrzeuge nach Status gruppiert ---------------- */
.mission-sidebar-group { margin-bottom: 22px; }
.mission-sidebar-group:last-child { margin-bottom: 0; }

.mission-sidebar-group-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin: 0 0 8px;
}

.mission-sidebar-group .assigned-vehicle-list { margin-bottom: 0; }

/* ---------------- AAO-Verwaltung ---------------- */
.aao-modal-content {
    width: 720px;
    max-width: 94vw;
    max-height: 86vh;
    padding: 32px;
}

.aao-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; }

.aao-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--ink-3);
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    padding: 12px 14px;
}

.aao-list-item-name { font-weight: 600; font-size: 14px; }
.aao-list-item-items { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.aao-list-item-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.aao-form {
    background: var(--ink-1);
    border: 1px solid rgba(76,141,255,0.4);
    border-radius: var(--r);
    padding: 20px;
}

.aao-form-title { font-size: 15px; font-weight: 600; margin: 0 0 16px; }

.aao-form label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.aao-form input[type="text"] {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 10px 12px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 14px;
}

.aao-item-heading {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin: 0 0 8px;
}

.aao-item-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }

.aao-item-row select,
.aao-item-row input[type="number"] {
    padding: 9px 10px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 13px;
}

.aao-item-row select { flex: 1 1 auto; }
.aao-item-row input[type="number"] { width: 70px; font-family: var(--font-mono); }

.aao-form input:focus,
.aao-item-row select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

.aao-item-remove-btn {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s ease;
}

.aao-item-remove-btn:hover { color: #fff; border-color: var(--red); background: var(--red-soft); }

.aao-add-item-btn {
    background: transparent;
    border: 1px dashed var(--line);
    border-radius: var(--r-sm);
    color: var(--text-dim);
    padding: 8px 12px;
    font-size: 12.5px;
    cursor: pointer;
    margin-bottom: 18px;
    transition: all 0.15s ease;
}

.aao-add-item-btn:hover { color: var(--text); border-color: var(--blue); }

.aao-form-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ---------------- Einsatz-Modal: AAO-Schnellauswahl ---------------- */
.mission-aao-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }

.mission-aao-btn {
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 7px 14px;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mission-aao-btn:hover { border-color: var(--blue); background: var(--blue-soft); color: #cfe0ff; }

/* ---------------- Fahrzeug-Bilder-Verwaltung ---------------- */
.vehicle-gif-modal-content {
    width: 580px;
    max-width: 92vw;
    padding: 32px;
}

.vehicle-gif-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--ink-3);
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    padding: 14px;
    margin-bottom: 8px;
}

.vehicle-gif-preview {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: var(--r-sm);
    background: var(--ink-1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 22px;
}

.vehicle-gif-preview img { width: 100%; height: 100%; object-fit: contain; }

.vehicle-gif-info { flex: 1 1 auto; min-width: 0; }
.vehicle-gif-label { font-weight: 600; font-size: 14px; }
.vehicle-gif-status { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }

.vehicle-gif-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }

.vehicle-gif-actions input[type="file"] { display: none; }
.vehicle-gif-actions label.personnel-btn { display: block; text-align: center; }

/* ---------------- Personal-Tab ---------------- */
.employee-list { margin-top: 12px; }

.employee-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--ink-3);
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    padding: 12px 14px;
    margin-bottom: 6px;
}

.employee-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.employee-name-input,
.employee-vehicle-select {
    padding: 8px 10px;
    background: var(--ink-1);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 13px;
}

.employee-name-input { flex: 1 1 160px; }
.employee-vehicle-select { flex: 1 1 200px; }

.employee-name-input:focus,
.employee-vehicle-select:focus { outline: none; border-color: var(--blue); }

.employee-vehicle-select option { background: var(--ink-2); color: var(--text); }

.crew-status {
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.crew-status.full { color: var(--green); background: var(--green-soft); }
.crew-status.understaffed { color: var(--red); background: var(--red-soft); }

/* =========================================================================
   Fenster (Einsatz & Wache) – links der Kontext, rechts die Arbeit
   ========================================================================= */
.ui-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.modal { background: rgba(3, 6, 13, 0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

.modal-content {
    background: var(--ink-1);
    border: 1px solid rgba(130, 160, 220, 0.16);
    border-radius: 20px;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.modal-close { top: 16px; right: 16px; }

.modal-with-sidebar { height: min(820px, 90vh); }
#dispatch-modal .modal-with-sidebar { height: min(860px, 92vh); }
.dispatch-modal-content { width: 1120px; }

.modal-sidebar {
    flex: 0 0 330px;
    display: flex;
    flex-direction: column;
    padding: 24px 22px;
    background: linear-gradient(180deg, rgba(var(--tint), 0.025), transparent 40%), var(--ink-2);
    border-right: 1px solid var(--line-soft);
}

#station-modal .modal-sidebar { flex-basis: 272px; padding: 24px 16px 20px; }

.modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
#station-modal .modal-head { padding: 0 6px; }

.modal-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--red-soft);
    color: var(--red);
    box-shadow: inset 0 0 0 1px rgba(240, 71, 60, 0.25);
}

.modal-icon img { width: 40px; height: 40px; object-fit: contain; }
.modal-icon .ui-icon { width: 24px; height: 24px; }

.modal-head-text { min-width: 0; }

.modal-content .modal-head h3 {
    font-size: 24px;
    margin: 0 0 3px;
    padding-right: 0;
    overflow-wrap: anywhere;
}

.modal-head .station-modal-subtitle { margin: 0; font-size: 13px; line-height: 1.4; }

/* Akzentfarbe des Wachen-Fensters je Gebäudetyp */
#station-modal { --type-c: var(--blue); }
#station-modal[data-type="leitstelle"] { --type-c: #2cc5b9; }
#station-modal[data-type="feuerwehr"] { --type-c: var(--red); }
#station-modal[data-type="rettungsdienst"] { --type-c: var(--blue); }
#station-modal[data-type="polizei"] { --type-c: #7d97e8; }
#station-modal[data-type="krankenhaus"] { --type-c: var(--violet); }

.modal-icon.station-icon {
    background: color-mix(in srgb, var(--type-c) 15%, transparent);
    color: var(--type-c);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--type-c) 32%, transparent);
}

.station-side-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 0 6px 18px;
}

.station-side-stats .gk-active-badge { grid-column: 1 / -1; justify-self: start; margin-bottom: 4px; }

.side-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 11px;
    border-radius: 10px;
    background: rgba(var(--tint), 0.035);
    border: 1px solid var(--line-soft);
}

.side-stat-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.side-stat-value { font-family: var(--font-mono); font-size: 14px; font-weight: 700; }
.side-stat-value small { font-family: var(--font-body); font-size: 11.5px; font-weight: 500; color: var(--text-dim); }

.station-tabs { gap: 2px; padding-top: 14px; border-top: 1px solid var(--line-soft); }

.station-tab {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
}

.station-tab .ui-icon { width: 17px; height: 17px; opacity: 0.75; }

.station-tab.active {
    background: color-mix(in srgb, var(--type-c) 14%, transparent);
    border-color: transparent;
    color: var(--text);
}

.station-tab.active .ui-icon { color: var(--type-c); opacity: 1; }
.station-tab.active::before { background: var(--type-c); }

.modal-main { padding: 28px 32px; background: var(--ink-1); }
.modal-main-scroll { padding: 26px 30px 20px; }

.modal-main-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px 14px 30px;
    border-bottom: none;
    border-top: 1px solid var(--line-soft);
    background: var(--ink-2);
}

/* Kopfzeile jedes Tabs / der Alarmliste */
.tab-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 0 48px 20px 0;
}

.tab-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1;
}

.tab-sub { margin: 6px 0 0; font-size: 13px; color: var(--text-dim); }

.tab-head .open-market-btn,
.tab-head .personnel-btn {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 10px;
    font-size: 13px;
    box-shadow: 0 8px 20px rgba(47, 111, 240, 0.3);
}

/* ---------------- Einsatz-Fenster: Lage (links) ---------------- */
.lage-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 26px;
    padding: 0 11px;
    border-radius: 13px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.chip-reward { background: var(--amber-soft); color: var(--amber); font-family: var(--font-mono); }
.chip-red { background: var(--red-soft); color: #ff8a82; }
.chip-blue { background: var(--blue-soft); color: #9fc2ff; }
.chip-amber { background: var(--amber-soft); color: var(--amber); }

.chip-red::before,
.chip-amber::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: status-dot-pulse 1.2s ease-in-out infinite;
}

.side-section { padding: 16px 0; border-top: 1px solid var(--line-soft); }

.side-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.side-label-hint {
    padding: 1px 8px;
    border-radius: 10px;
    background: var(--amber-soft);
    color: var(--amber);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.modal-sidebar .meldung-text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text); }

.meldung-escalated { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; }
.meldung-escalated .ui-icon { margin-top: 2px; }

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

.req-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(var(--tint), 0.05);
    border: 1px solid var(--line-soft);
    font-size: 12.5px;
    font-weight: 600;
}

.req-chip b { font-family: var(--font-mono); font-weight: 700; color: var(--text-dim); }
.req-chip .ui-icon { width: 13px; height: 13px; stroke-width: 3; }
.req-chip.done { background: var(--green-soft); border-color: rgba(53, 199, 124, 0.35); color: var(--green); }
.req-chip.done b { color: inherit; }

.modal-sidebar .mission-progress-wrap { margin: 0; }
.modal-sidebar .patient-list { margin: 0; }

.modal-sidebar .patient-row { flex-direction: column; align-items: stretch; gap: 7px; background: rgba(var(--tint), 0.03); }
.modal-sidebar .patient-status { text-align: left; }
.modal-sidebar .patient-progress-wrap { max-width: none; }
.modal-sidebar .patient-progress-label { order: 2; margin: 5px 0 0; text-align: left; font-family: var(--font-body); font-size: 12px; }
.modal-sidebar .patient-progress-wrap { display: flex; flex-direction: column; }

.mission-sidebar-group { margin-bottom: 14px; }
.mission-sidebar-group-title { margin: 0 0 6px; font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--text-dim); }
.mission-sidebar-group-title span { font-family: var(--font-mono); color: var(--text-faint); margin-left: 4px; }

.modal-sidebar .vehicle-row { padding: 7px 8px; gap: 10px; background: rgba(var(--tint), 0.03); }
.vehicle-row .vehicle-main .vehicle-type { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11.5px; }

.vehicle-edit-btn .ui-icon,
.vehicle-cancel-btn .ui-icon { width: 15px; height: 15px; }

.patient-status { display: inline-flex; align-items: center; gap: 5px; }
.patient-status .ui-icon { width: 13px; height: 13px; stroke-width: 3; }

/* ---------------- Einsatz-Fenster: Alarmierung (rechts) ---------------- */
.mission-aao-row { align-items: center; margin-bottom: 18px; }

.aao-row-label {
    margin-right: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.mission-aao-btn { height: 32px; padding: 0 14px; background: rgba(var(--tint), 0.04); }

.alarm-vehicle-list { gap: 4px; }

.vehicle-select-row {
    position: relative;
    display: grid;
    grid-template-columns: 22px 72px minmax(0, 1fr) auto 64px;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 10px 14px;
    border-radius: 11px;
    background: rgba(var(--tint), 0.03);
    border: 1px solid transparent;
}

.vehicle-select-row:hover { background: rgba(var(--tint), 0.055); border-color: var(--line); }

.vehicle-select-row.selected { background: rgba(76, 141, 255, 0.11); border-color: rgba(76, 141, 255, 0.45); }

/* Native Checkbox bleibt für Tastatur und Screenreader erhalten, gezeichnet wird .vs-check */
.vehicle-select-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.vs-check {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--text-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.vs-check .ui-icon { width: 13px; height: 13px; stroke-width: 3; }
.vehicle-select-row.selected .vs-check { background: var(--blue); border-color: var(--blue); color: #fff; }
.vehicle-select-checkbox:focus-visible + .vs-check { outline: 2px solid var(--blue); outline-offset: 2px; }

.vs-type {
    --cat-c: var(--text-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--cat-c) 16%, transparent);
    color: var(--cat-c);
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vs-type[data-cat="feuerwehr"] { --cat-c: #ff7a70; }
.vs-type[data-cat="rettungsdienst"] { --cat-c: #7fb0ff; }
.vs-type[data-cat="polizei"] { --cat-c: #a5b8f2; }

.vehicle-select-info { gap: 1px; }

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

.vehicle-select-info .vehicle-station { font-size: 12px; color: var(--text-faint); }

.vehicle-select-hint { margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--cyan); }

.crew-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    font-family: var(--font-mono);
    font-size: 11.5px;
}

.crew-status .ui-icon { width: 13px; height: 13px; }

.vs-dist { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-dim); text-align: right; }

.dispatch-summary { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--text-dim); }
.dispatch-summary strong { font-family: var(--font-mono); font-size: 15px; color: var(--text); }

.dispatch-clear-btn {
    padding: 4px 8px;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.dispatch-clear-btn:hover { background: var(--blue-soft); }

#dispatch-selected-btn {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 15px;
    box-shadow: 0 10px 28px rgba(240, 71, 60, 0.35);
}

#dispatch-selected-btn .ui-icon { width: 18px; height: 18px; }
#dispatch-selected-btn:disabled { box-shadow: none; }

/* ---------------- Wachen-Fenster: Inhalte ---------------- */
.vehicle-table tbody tr.vehicle-table-row td { background: rgba(var(--tint), 0.03); }
.vehicle-table tbody tr.vehicle-table-row:hover td { background: rgba(var(--tint), 0.055); }
.vt-vehicle .vs-type { margin-right: 10px; vertical-align: middle; }

.settings-card {
    margin-bottom: 16px;
    border-radius: 14px;
    background: rgba(var(--tint), 0.025);
    border: 1px solid var(--line-soft);
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 20px;
    border-top: 1px solid var(--line-soft);
}

.setting-row:first-child { border-top: none; }

.setting-text { min-width: 0; }
.setting-label { font-size: 14px; font-weight: 600; }
.setting-desc { margin-top: 2px; font-size: 12.5px; color: var(--text-dim); }

.setting-control { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.setting-control:empty { display: none; }
.setting-control .gk-name-row input { width: 240px; }

.gk-leitstelle-select {
    min-width: 220px;
    padding: 9px 12px;
    background: var(--ink-1);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 13.5px;
}

.gk-leitstelle-select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

.gk-move-btn,
.gk-demolish-btn,
.gk-level-row button,
.gk-toggle-active-btn { display: inline-flex; align-items: center; gap: 7px; }

.settings-card.danger { background: rgba(240, 71, 60, 0.05); border-color: rgba(240, 71, 60, 0.3); }
.settings-card.danger .setting-label { color: #ff8a82; }

.market-card {
    gap: 12px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(var(--tint), 0.03);
}

.market-card.is-owned { border-color: rgba(53, 199, 124, 0.3); }
.market-card.is-building { border-color: rgba(242, 179, 61, 0.3); }

.market-card-specs {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 14px;
    padding: 0;
    background: none;
    font-family: var(--font-body);
    font-size: 12.5px;
    color: var(--text-dim);
}

.market-card-specs span { display: inline-flex; align-items: center; gap: 5px; }
.market-card-specs .ui-icon { width: 14px; height: 14px; color: var(--text-faint); }

.vehicle-buy-btn {
    background: var(--blue-strong);
    border-color: var(--blue);
    border-radius: 9px;
    color: #fff;
    font-weight: 600;
}

.market-locked {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 12.5px;
    color: var(--text-faint);
}

.ext-state { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ext-state .ui-icon { width: 13px; height: 13px; stroke-width: 2.5; }
.ext-state.active { color: var(--green); }
.ext-state.building { color: var(--amber); font-family: var(--font-mono); }

.employee-list { margin-top: 0; }

.employee-card {
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 12px;
    background: rgba(var(--tint), 0.03);
}

.employee-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blue-soft);
    color: #9fc2ff;
    font-weight: 700;
    text-transform: uppercase;
}

.personnel-btn { display: inline-flex; align-items: center; gap: 6px; }
.personnel-btn .ui-icon { width: 15px; height: 15px; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1100px) {
    .topbar-btn.secondary .cmd-label { display: none; }
    .topbar-btn.secondary { padding: 0 11px; }
}

@media (max-width: 1280px) {
    .brand-word span { display: none; }
    .dashboard-body { --panel-w: 300px; }
    .chip-label, .user-name-text { display: none; }
}

@media (max-width: 960px) {
    .hero { grid-template-columns: minmax(0, 1fr); gap: 48px; min-height: 0; padding-top: 32px; }
    .hero-card { max-width: 520px; }
    .steps { grid-template-columns: 1fr; }
    .step { padding-right: 0; padding-bottom: 24px; }
    .features { grid-template-columns: 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
}

@media (max-width: 900px) {
    .dashboard-body { --gap: 8px; height: auto; min-height: 100vh; overflow: auto; }
    .app-layout { display: flex; flex-direction: column; height: auto; padding-bottom: 8px; }
    .topbar { position: sticky; top: var(--gap); left: auto; right: auto; order: 0; margin: var(--gap); padding: 0 6px 0 12px; gap: 8px; }
    .topbar-brand .brand-word { display: none; }
    .topbar-actions { justify-content: flex-start; }
    .topbar-btn .cmd-label { display: none; }
    .topbar-btn { padding: 0 11px; }
    .credits, .coins { padding: 0 9px; font-size: 12px; }
    .map-area { position: relative; inset: auto; order: 1; height: 58vh; margin: 0 var(--gap); border-radius: 16px; overflow: hidden; }
    .sidebar { position: relative; top: auto; bottom: auto; left: auto; right: auto; width: auto; order: 2; margin: var(--gap) var(--gap) 0; }
    .sidebar { max-height: none; }
    .sidebar .panel-list { max-height: 55vh; }
    .placement-overlay { top: 12px; width: calc(100% - 24px); }
    .dashboard-body .sidebar-right { max-height: none; }
    .modal-with-sidebar { flex-direction: column; height: 92vh; }
    .modal-sidebar { flex: 0 0 auto; max-height: 40%; border-right: none; border-bottom: 1px solid var(--line); }
    .station-tabs { flex-direction: row; flex-wrap: wrap; }
    .station-tab { width: auto; }
    .station-tab.active::before { display: none; }
    .modal-main, .modal-main-scroll { padding: 20px; }
    .modal-main-footer { padding: 14px 20px; }
    #station-modal .modal-sidebar { flex-basis: auto; }
    .station-side-stats { grid-template-columns: repeat(3, 1fr); }
    .tab-head { flex-wrap: wrap; align-items: flex-start; margin-right: 40px; }
    .vehicle-select-row { grid-template-columns: 22px auto minmax(0, 1fr) auto; gap: 10px; }
    .vs-dist { display: none; }
    .setting-row { flex-wrap: wrap; }
    .setting-control .gk-name-row input { width: 100%; }
}

@media (max-width: 600px) {
    .landing-nav, .landing-main, .landing-footer { padding-left: 16px; padding-right: 16px; }
    .landing-nav-actions .btn-ghost { display: none; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; white-space: normal; }
    .landing-nav .btn { padding: 9px 14px; }
    .hc-unit-type { display: none; }
    .landing-section { padding: 64px 0; }
    .feature { padding: 26px 22px; }
    .cta-band { padding: 30px 22px; }
    .landing-footer { flex-direction: column; }
    .auth-panel { padding: 32px 16px; }
    .credits, .coins { font-size: 11.5px; padding: 5px 8px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================================================================
   Spiel: helles, cleanes Theme
   Überschreibt nur die Tokens und die wenigen festen Farben – Layout und
   Komponenten bleiben dieselben wie oben.
   ========================================================================= */
.dashboard-body {
    --tint: 15, 23, 42;

    --ink-0: #eef1f5;
    --ink-1: #ffffff;
    --ink-2: #f7f8fa;
    --ink-3: #f2f4f7;
    --ink-4: #e9edf2;
    --line: #dde2ea;
    --line-soft: #eaedf2;

    --text: #111827;
    --text-dim: #4b5568;
    --text-faint: #8a93a6;

    --blue: #2563eb;
    --blue-strong: #1d4ed8;
    --blue-soft: rgba(37, 99, 235, 0.09);
    --red: #dc2626;
    --red-strong: #c81e1e;
    --red-soft: rgba(220, 38, 38, 0.08);
    --amber: #b45309;
    --amber-soft: rgba(245, 158, 11, 0.14);
    --green: #15803d;
    --green-soft: rgba(22, 163, 74, 0.1);
    --violet: #7c3aed;
    --violet-soft: rgba(124, 58, 237, 0.1);
    --cyan: #0e7490;
    --cyan-soft: rgba(8, 145, 178, 0.1);

    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.14);

    background: var(--ink-0);
    color: var(--text);
}

.dashboard-body ::selection { background: rgba(37, 99, 235, 0.18); }

/* Helle Karte: Originalkacheln, nur leicht entsättigt, damit Marker hervorstechen */
.dashboard-body #map { background: #e8ebef; }
.dashboard-body .map-area .leaflet-tile-pane { filter: saturate(0.75) contrast(0.96) brightness(1.02); }

.dashboard-body .glass {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.07);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12), 0 1px 2px rgba(15, 23, 42, 0.06);
}

.dashboard-body .brand-light { background: #dbe6ff; box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35); }
.dashboard-body .brand-word span { color: var(--text-faint); }

.dashboard-body .topbar-btn { box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25); }
.dashboard-body .topbar-btn.secondary { box-shadow: none; }
.dashboard-body .topbar-sep { background: var(--line); }

.dashboard-body .credits,
.dashboard-body .coins { background: var(--ink-2); border-color: var(--line-soft); }

.dashboard-body .topbar-avatar { background: linear-gradient(135deg, #2563eb, #60a5fa); }

/* Panels & Listen */
.dashboard-body .station-card[data-type="leitstelle"] { --type-c: #0d9488; }
.dashboard-body .station-card[data-type="polizei"] { --type-c: #4f46e5; }
.dashboard-body .panel-count.is-alert { color: var(--red); }

.dashboard-body .mission-card { background: var(--ink-1); border-color: var(--line-soft); }
.dashboard-body .mission-card:hover { background: var(--ink-1); border-color: var(--line); box-shadow: var(--shadow); }
.dashboard-body .mission-card::before { box-shadow: none; }

.dashboard-body .mission-icon-inner { color: #3b2506; }

/* Leaflet */
.dashboard-body .leaflet-popup-content-wrapper,
.dashboard-body .leaflet-popup-tip { background: #fff; border-color: var(--line); }

.dashboard-body .leaflet-bar,
.dashboard-body .leaflet-touch .leaflet-bar { border-color: var(--line) !important; }

.dashboard-body .leaflet-bar a,
.dashboard-body .leaflet-touch .leaflet-bar a { background: #fff; color: var(--text); border-bottom-color: var(--line-soft); }
.dashboard-body .leaflet-bar a:hover { background: var(--ink-2); color: var(--text); }

.dashboard-body .leaflet-container .leaflet-control-attribution { background: rgba(255, 255, 255, 0.8); }

.dashboard-body .placement-banner { background: rgba(255, 255, 255, 0.96); border-color: rgba(37, 99, 235, 0.4); }

/* Fenster */
.dashboard-body .modal { background: rgba(15, 23, 42, 0.32); }

.dashboard-body .modal-content {
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22), 0 2px 6px rgba(15, 23, 42, 0.06);
}

.dashboard-body .modal-sidebar { background: var(--ink-2); border-right-color: var(--line-soft); }

.dashboard-body .modal-close:hover { background: var(--ink-3); }

.dashboard-body .modal-icon { box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.2); }

.dashboard-body #station-modal[data-type="leitstelle"] { --type-c: #0d9488; }
.dashboard-body #station-modal[data-type="polizei"] { --type-c: #4f46e5; }

.dashboard-body .station-tab.active { color: var(--text); }
.dashboard-body .station-tab:hover { background: var(--ink-4); }

.dashboard-body .side-stat,
.dashboard-body .req-chip { background: var(--ink-1); }

.dashboard-body .chip-red { color: var(--red); }
.dashboard-body .chip-blue { color: var(--blue); }

.dashboard-body .vehicle-select-row { background: var(--ink-1); border-color: var(--line-soft); }
.dashboard-body .vehicle-select-row:hover { background: var(--ink-2); border-color: var(--line); }
.dashboard-body .vehicle-select-row.selected { background: #eff5ff; border-color: rgba(37, 99, 235, 0.5); }

.dashboard-body .vs-type[data-cat="feuerwehr"] { --cat-c: #dc2626; }
.dashboard-body .vs-type[data-cat="rettungsdienst"] { --cat-c: #2563eb; }
.dashboard-body .vs-type[data-cat="polizei"] { --cat-c: #4f46e5; }

.dashboard-body .mission-aao-btn { background: var(--ink-1); }
.dashboard-body .mission-aao-btn:hover { color: var(--blue); }

.dashboard-body .vehicle-table tbody tr.vehicle-table-row td { background: var(--ink-1); }
.dashboard-body .vehicle-table tbody tr.vehicle-table-row:hover td { background: var(--ink-2); }

.dashboard-body .settings-card,
.dashboard-body .market-card,
.dashboard-body .employee-card { background: var(--ink-1); border-color: var(--line); }

.dashboard-body .settings-card.danger { background: #fff7f7; border-color: rgba(220, 38, 38, 0.25); }
.dashboard-body .settings-card.danger .setting-label { color: var(--red); }

.dashboard-body .employee-avatar { color: var(--blue); }

.dashboard-body .vehicle-buy-btn:disabled { background: var(--ink-3); }

.dashboard-body .vehicle-edit-btn:hover { color: var(--blue); }
.dashboard-body .vehicle-cancel-btn:hover { color: var(--amber); }
.dashboard-body .aao-item-remove-btn:hover { color: var(--red); }

.dashboard-body .modal-sidebar .vehicle-row,
.dashboard-body .modal-sidebar .patient-row { background: var(--ink-1); }

.dashboard-body .mission-progress-bar,
.dashboard-body .mission-card-progress-bar { background: var(--ink-4); }

.dashboard-body .patient-progress-bar { background: var(--ink-4); }

/* =========================================================================
   Wachen-Fenster: einklappbares Menü + Fahrzeug-Karten
   ========================================================================= */
#station-modal .modal-sidebar {
    overflow: hidden;
    transition: flex-basis 0.32s var(--ease), padding 0.32s var(--ease), opacity 0.2s ease, border-color 0.2s ease;
}

/* Inhalt behält seine Breite, während die Leiste zuschiebt – sonst
   würden Name und Tabs beim Animieren umbrechen. */
#station-modal .modal-sidebar > * { min-width: 236px; }

.station-tab .tab-label { white-space: nowrap; }

/* Knopf "Menü ausblenden" rechts neben dem Wachen-Namen */
.station-nav-toggle {
    flex: 0 0 auto;
    align-self: flex-start;
    width: 32px;
    height: 32px;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink-1);
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--text-dim);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.station-nav-toggle:hover { color: var(--text); border-color: var(--text-faint); }

/* Knopf "Menü" oben im Inhalt – nur sichtbar, wenn das Menü ausgeblendet ist */
.station-nav-open {
    display: none;
    align-items: center;
    gap: 7px;
    margin: -6px 0 14px;
    padding: 7px 12px 7px 10px;
    background: var(--ink-1);
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.station-nav-open:hover { border-color: var(--type-c); box-shadow: var(--shadow); }
.station-nav-open .ui-icon { width: 16px; height: 16px; color: var(--type-c); }

#station-modal .nav-collapsed .modal-sidebar {
    flex-basis: 0;
    padding-left: 0;
    padding-right: 0;
    border-right-color: transparent;
    opacity: 0;
    pointer-events: none;
}

.nav-collapsed .station-nav-open { display: inline-flex; }

.station-main-name {
    display: none;
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--type-c);
}

.nav-collapsed .station-main-name { display: block; }

@media (max-width: 900px) {
    .station-nav-toggle, .station-nav-open { display: none !important; }
    #station-modal .nav-collapsed .modal-sidebar { flex-basis: auto; padding: 20px 16px; opacity: 1; pointer-events: auto; }
    #station-modal .modal-sidebar > * { min-width: 0; }
}

/* Statusfarbe je Fahrzeug (FMS) */
.vcard.status-station, .vcard-summary-item.status-station { --st-c: var(--fms-2); }
.vcard.status-enroute, .vcard-summary-item.status-enroute { --st-c: var(--fms-3); }
.vcard.status-onscene, .vcard-summary-item.status-onscene { --st-c: var(--fms-4); }
.vcard.status-transporting, .vcard-summary-item.status-transporting { --st-c: var(--fms-7); }
.vcard.status-returning, .vcard-summary-item.status-returning { --st-c: var(--fms-1); }

.vcard-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }

.vcard-summary-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--st-c) 10%, transparent);
    color: var(--st-c);
    font-size: 12.5px;
    font-weight: 600;
}

.vcard-summary-item b {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--st-c);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 11.5px;
}

.vcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: 14px;
}

.vcard {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 16px;
    background: var(--ink-1);
    border: 1px solid var(--line);
    transition: transform 0.2s var(--ease), box-shadow 0.2s ease, border-color 0.2s ease;
}

.vcard:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: color-mix(in srgb, var(--st-c) 45%, var(--line));
}

.vcard-media {
    position: relative;
    height: 124px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(120% 90% at 50% 100%, color-mix(in srgb, var(--st-c) 20%, transparent), transparent 70%),
        var(--ink-2);
    border-bottom: 3px solid var(--st-c);
}

.vcard-media img {
    max-width: 82%;
    max-height: 94px;
    object-fit: contain;
    filter: drop-shadow(0 8px 10px rgba(15, 23, 42, 0.2));
}

.vcard-emoji { font-size: 52px; }

.vcard-fms {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--st-c);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--st-c) 45%, transparent);
}

.vcard.status-enroute .vcard-fms,
.vcard.status-onscene .vcard-fms,
.vcard.status-transporting .vcard-fms { animation: vcard-fms-ring 1.6s ease-out infinite; }

@keyframes vcard-fms-ring {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--st-c) 55%, transparent); }
    100% { box-shadow: 0 0 0 9px transparent; }
}

.vcard-actions { position: absolute; top: 9px; right: 9px; display: flex; gap: 5px; }

.vcard-actions .vehicle-edit-btn,
.vcard-actions .vehicle-cancel-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.92);
    border-color: var(--line);
    color: var(--text-dim);
    backdrop-filter: blur(6px);
}

.vcard-body { display: flex; flex-direction: column; gap: 8px; padding: 13px 15px 15px; }

.vcard-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.vcard-name {
    min-width: 0;
    font-size: 16px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vcard-title .vs-type { flex: 0 0 auto; }

.vcard-status { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--st-c); }

.vcard.status-enroute .vehicle-status-dot,
.vcard.status-onscene .vehicle-status-dot,
.vcard.status-transporting .vehicle-status-dot { animation: status-dot-pulse 1.4s ease-in-out infinite; }

.vcard-mission { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; color: var(--text-dim); }
.vcard-mission span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcard-mission .ui-icon { width: 14px; height: 14px; color: var(--text-faint); }
.vcard-mission.is-empty { color: var(--text-faint); }

.vcard-crew {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 6px 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
    font-size: 12px;
    color: var(--text-dim);
}

.vcard-crew-label { display: inline-flex; align-items: center; gap: 6px; }
.vcard-crew-label .ui-icon { width: 14px; height: 14px; }
.vcard-crew-value { font-family: var(--font-mono); font-weight: 700; color: var(--text); }

.vcard-crew-bar { grid-column: 1 / -1; height: 5px; border-radius: 5px; background: var(--ink-4); overflow: hidden; }
.vcard-crew-bar span { display: block; height: 100%; border-radius: inherit; background: var(--green); }

.vcard-crew.understaffed .vcard-crew-value { color: var(--red); }
.vcard-crew.understaffed .vcard-crew-bar span { background: var(--red); }


/* =========================================================================
   Karten-Panels: gleiten zur Seite weg, Reiter am Rand holt sie zurück
   ========================================================================= */
.sidebar {
    transition: transform 0.35s var(--ease), opacity 0.25s ease;
}

.sidebar-left.collapsed {
    transform: translateX(calc(-100% - var(--gap) - 8px));
    opacity: 0;
    pointer-events: none;
}

.sidebar-right.collapsed {
    transform: translateX(calc(100% + var(--gap) + 8px));
    opacity: 0;
    pointer-events: none;
}

.panel-head:hover .panel-caret { transform: translateX(-2px); }
.sidebar-right .panel-head:hover .panel-caret { transform: translateX(2px); }

.panel-handle {
    position: absolute;
    top: calc(var(--gap) * 2 + var(--topbar-h));
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px 8px 10px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
    color: var(--text);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s var(--ease), opacity 0.25s ease, background 0.15s ease;
}

.panel-handle-left { left: 0; border-left: none; border-radius: 0 14px 14px 0; transform: translateX(-100%); }
.panel-handle-right { right: 0; border-right: none; border-radius: 14px 0 0 14px; transform: translateX(100%); }

.panel-handle:hover { background: #fff; }
.panel-handle .ui-icon { width: 18px; height: 18px; color: var(--blue); }

.panel-handle-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.panel-handle-right .panel-handle-label { transform: none; }

.left-collapsed .panel-handle-left,
.right-collapsed .panel-handle-right {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

@media (max-width: 900px) {
    .panel-handle { display: none; }
    .sidebar-left.collapsed,
    .sidebar-right.collapsed { transform: none; opacity: 1; pointer-events: auto; }
    .sidebar.collapsed .panel-list { display: none; }
    .sidebar.collapsed .panel-caret { transform: rotate(-90deg); }
}

/* =========================================================================
   Einsatz-Fenster: Kopf über volle Breite mit großem, ablaufendem Balken
   ========================================================================= */
.dispatch-modal-content {
    display: flex;
    flex-direction: column;
    width: 1180px;
    height: min(880px, 92vh);
    padding: 0;
    overflow: hidden;
}

.dispatch-header {
    flex: 0 0 auto;
    padding: 22px 64px 22px 26px;
    border-bottom: 1px solid var(--line-soft);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--red) 6%, transparent), transparent 70%),
        var(--ink-1);
}

.dispatch-header-top { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.dispatch-header .modal-head { flex: 1 1 auto; min-width: 0; margin: 0; }
.dispatch-header .modal-content h3,
.dispatch-header h3 { font-size: 28px; }
.dispatch-header .lage-chips { margin: 0; }

.dispatch-body { flex: 1 1 auto; min-height: 0; display: flex; }
.dispatch-body .modal-sidebar { overflow-y: auto; padding-top: 6px; }
.dispatch-body .modal-sidebar .side-section:first-child { border-top: none; }

/* Großer Countdown-Balken */
.mission-hero-progress {
    --phase-c: var(--text-faint);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px 22px;
    margin-top: 20px;
}

.mission-hero-progress[data-phase="running"] { --phase-c: var(--blue); }
.mission-hero-progress[data-phase="paused"] { --phase-c: var(--amber); }

.mhp-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dim);
}

.mhp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--phase-c);
}

.mission-hero-progress[data-phase="running"] .mhp-dot { animation: status-dot-pulse 1.2s ease-in-out infinite; }

.mhp-countdown {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    min-width: 4ch;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--phase-c);
}

.mhp-bar {
    grid-column: 1;
    height: 16px;
    border-radius: 10px;
    background: var(--ink-4);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.mhp-bar .mission-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue-strong), #60a5fa);
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.35);
    transition: width 0.3s linear, background 0.3s ease;
}

.mission-hero-progress[data-phase="paused"] .mhp-bar .mission-progress-fill {
    background: repeating-linear-gradient(45deg, #f59e0b 0 10px, #fbbf24 10px 20px);
    background-size: 28px 100%;
    box-shadow: none;
    opacity: 1;
    animation: mission-progress-idle-stripes 0.9s linear infinite;
}

.mission-hero-progress[data-phase="waiting"] .mhp-bar .mission-progress-fill { box-shadow: none; }

@media (max-width: 900px) {
    .dispatch-modal-content { height: 94vh; }
    .dispatch-header { padding: 18px 52px 16px 18px; }
    .dispatch-body { flex-direction: column; overflow-y: auto; }
    .dispatch-body .modal-sidebar { flex: 0 0 auto; max-height: none; border-right: none; border-bottom: 1px solid var(--line-soft); }
    .mhp-countdown { font-size: 30px; }
}
