/* KIBspector - Deutsche Bahn Style Design System */
:root {
    /* DB Brand Colors */
    --db-red: #ec0016;
    --db-red-dark: #c50014;
    --db-red-100: #fEE6E6;
    --db-red-200: #FCC8C3;
    --db-red-300: #FA9090;

    /* Cool Grays */
    --db-cool-gray-100: #F0F3F5;
    --db-cool-gray-200: #D7DCE1;
    --db-cool-gray-300: #AFB4BB;
    --db-cool-gray-400: #878C96;
    --db-cool-gray-500: #646973;
    --db-cool-gray-600: #3C414B;
    --db-cool-gray-700: #282D37;
    --db-cool-gray-800: #131821;

    /* Semantic */
    --db-success: #508B1B;
    --db-success-bg: #E2f3E5;
    --db-warning: #f75f00;
    --db-warning-bg: #FFF4D8;
    --db-error: #ec0016;
    --db-error-bg: #fEE6E6;
    --db-info: #0087B9;
    --db-info-bg: #E0EFFB;

    /* Entity Colors (DB Palette) */
    --bridge-color: #1455C0;
    --tunnel-color: #814997;
    --bst-color: #F39200;
    --bue-color: #ec0016;

    /* Mapped Aliases */
    --primary: #282D37;
    --primary-light: #3C414B;
    --primary-dark: #131821;
    --accent: #ec0016;
    --accent-light: #FA9090;
    --success: #508B1B;
    --warning: #f75f00;
    --danger: #ec0016;
    --bg: #F0F3F5;
    --bg-dark: #D7DCE1;
    --text: #131821;
    --text-light: #646973;
    --border: #D7DCE1;
    --shadow: 0 2px 8px rgba(0,0,0,.08);
    --shadow-lg: 0 5px 30px rgba(0,0,0,.12);
    --radius: 4px;
    --radius-lg: 4px;
    --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-head: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-mono: 'Menlo', 'Consolas', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ====== SPLASH SCREEN ====== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .5s ease, visibility .5s ease;
}
.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.splash-content {
    text-align: center;
    color: #fff;
}
.splash-logo {
    margin-bottom: 24px;
}
.splash-logo img {
    height: 80px;
    width: auto;
    background: #fff;
    border-radius: 8px;
    padding: 8px 12px;
}
.splash-title {
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-head);
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}
.splash-subtitle {
    font-size: 14px;
    color: var(--db-cool-gray-400);
    letter-spacing: 0.5px;
    margin-bottom: 32px;
}
.splash-spinner {
    width: 200px;
    margin: 0 auto 24px;
}
.splash-spinner-track {
    height: 3px;
    background: rgba(255,255,255,.1);
    border-radius: 2px;
    overflow: hidden;
}
.splash-spinner-fill {
    height: 100%;
    width: 40%;
    background: var(--db-red);
    border-radius: 2px;
    animation: splash-loading 1.2s ease-in-out infinite;
}
@keyframes splash-loading {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(150%); }
    100% { transform: translateX(350%); }
}
.splash-user {
    min-height: 44px;
}
.splash-user-name {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}
.splash-user-abteilung {
    font-size: 13px;
    color: var(--db-cool-gray-400);
    margin-top: 4px;
}
.splash-user-region {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 16px;
    background: rgba(236, 0, 22, 0.15);
    border: 1px solid rgba(236, 0, 22, 0.3);
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--db-red);
}
.splash-user-pd {
    font-size: 14px;
    color: var(--db-cool-gray-400);
    margin-top: 4px;
}

/* ====== LAYOUT ====== */
#app {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
}

#sidebar {
    width: 380px;
    min-width: 380px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid var(--border);
    z-index: 10;
    transition: transform .3s ease;
}

#sidebar.hidden {
    transform: translateX(-100%);
    min-width: 0;
    width: 0;
}

#map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

/* ====== HEADER (DB Style) ====== */
.sidebar-header {
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.logo-icon img {
    height: 34px;
    width: auto;
    display: block;
    background: #fff;
    border-radius: 3px;
    padding: 2px 3px;
}

.header-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

.header-actions button {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

.header-actions button:hover {
    background: rgba(255,255,255,.2);
}

.header-actions button svg {
    width: 18px;
    height: 18px;
}

/* ====== SEARCH ====== */
.search-box {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: #fff;
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrap .search-icon {
    position: absolute;
    left: 12px;
    color: var(--db-cool-gray-400);
    pointer-events: none;
    display: flex;
}

.search-input-wrap .search-icon svg {
    width: 16px;
    height: 16px;
}

#search-input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
}

#search-input:focus {
    border-color: var(--db-info);
    box-shadow: 0 0 0 2px rgba(0,135,185,.15);
}

#search-input::placeholder {
    color: var(--db-cool-gray-400);
}

.search-hints {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.search-hint {
    font-size: 11px;
    padding: 3px 8px;
    background: var(--db-cool-gray-100);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-light);
    cursor: pointer;
    transition: all .2s;
}

.search-hint:hover {
    background: var(--db-cool-gray-200);
    border-color: var(--db-cool-gray-300);
}

/* ====== MEIN NETZ ====== */
/* ====== REGION SECTION ====== */
.region-section {
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.region-toggle {
    width: 100%;
    padding: 10px 16px;
    background: var(--db-cool-gray-100);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    font-family: var(--font);
    transition: background .15s;
}
.region-toggle:hover { background: var(--db-cool-gray-200); }
.region-toggle svg:first-child {
    width: 18px;
    height: 18px;
    color: var(--db-red);
    flex-shrink: 0;
}
.region-count {
    background: var(--db-red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}
.region-chevron {
    width: 16px;
    height: 16px;
    margin-left: auto;
    transition: transform .2s;
    color: var(--db-cool-gray-400);
}
.region-section.open .region-chevron { transform: rotate(180deg); }
.region-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}
.region-section.open .region-content {
    max-height: 500px;
    overflow-y: auto;
}
.region-type-chips {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid var(--db-cool-gray-100);
    overflow-x: auto;
}
.region-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--db-cool-gray-100);
    border: 1px solid var(--db-cool-gray-200);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-light);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.region-chip:hover { background: var(--db-cool-gray-200); }
.region-chip.active {
    background: var(--db-red);
    border-color: var(--db-red);
    color: #fff;
}
.region-chip span {
    font-weight: 400;
    opacity: .8;
}
.region-list {
    max-height: 350px;
    overflow-y: auto;
}
.region-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 10px;
    border-bottom: 1px solid var(--db-cool-gray-100);
    cursor: pointer;
    transition: background .15s;
    background: #fff;
}
.region-item:hover { background: var(--db-cool-gray-100); }
.region-more {
    width: 100%;
    padding: 10px;
    background: #fff;
    border: none;
    border-top: 1px solid var(--db-cool-gray-100);
    color: var(--db-info);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: background .15s;
}
.region-more:hover { background: var(--db-cool-gray-100); }

/* ====== BEZIRK SECTION ====== */
.bezirk-section {
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.bezirk-toggle {
    width: 100%;
    padding: 10px 16px;
    background: var(--db-cool-gray-100);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    font-family: var(--font);
    transition: background .15s;
}
.bezirk-toggle:hover { background: var(--db-cool-gray-200); }
.bezirk-toggle svg:first-child {
    width: 18px;
    height: 18px;
    color: var(--db-red);
    flex-shrink: 0;
}
.bezirk-count {
    background: var(--db-red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}
.bezirk-chevron {
    width: 16px;
    height: 16px;
    margin-left: auto;
    transition: transform .2s;
    color: var(--db-cool-gray-400);
}
.bezirk-section.open .bezirk-chevron { transform: rotate(180deg); }
.bezirk-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}
.bezirk-section.open .bezirk-list {
    max-height: 400px;
    overflow-y: auto;
}
.bezirk-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    gap: 10px;
    border-bottom: 1px solid var(--db-cool-gray-100);
    cursor: pointer;
    transition: background .15s;
    background: #fff;
}
.bezirk-item:hover { background: var(--db-cool-gray-100); }
.bezirk-item-info {
    flex: 1;
    min-width: 0;
}
.bezirk-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}
.bezirk-item-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--text-light);
}
.bezirk-item-icon svg {
    width: 16px;
    height: 16px;
}
.bezirk-item-meta {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}
.bezirk-item-remove {
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    border: none;
    background: transparent;
    color: var(--db-cool-gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .15s;
}
.bezirk-item-remove:hover {
    background: var(--db-red-100);
    color: var(--db-red);
}
.bezirk-empty {
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
}
.bezirk-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--db-red);
    color: var(--db-red);
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all .15s;
}
.bezirk-add-btn:hover {
    background: var(--db-red);
    color: #fff;
}
.bezirk-add-btn.added {
    background: var(--db-success);
    border-color: var(--db-success);
    color: #fff;
    cursor: default;
}

/* ====== RESULTS ====== */
.results-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.results-count {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
    background: var(--db-cool-gray-100);
}

.result-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .15s;
    display: flex;
    gap: 10px;
    align-items: center;
}

.result-item:hover {
    background: var(--db-cool-gray-100);
}

.result-item.active {
    background: var(--db-info-bg);
    border-left: 4px solid var(--db-red);
}

.result-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.result-icon svg {
    width: 18px;
    height: 18px;
}

.result-icon.bruecke { background: var(--bridge-color); }
.result-icon.tunnel { background: var(--tunnel-color); }
.result-icon.bahnuebergang { background: var(--bue-color); }
.result-icon.betriebsstelle { background: var(--bst-color); }
.result-icon.koordinate { background: var(--db-cool-gray-500); }

.result-info {
    flex: 1;
    min-width: 0;
}

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

.result-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
}

.results-clear {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-light);
    display: flex;
    align-items: center;
}

.results-clear:hover {
    color: var(--text);
}

.results-clear svg {
    width: 16px;
    height: 16px;
}

.result-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: var(--radius);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.result-badge.bruecke { background: var(--db-info-bg); color: var(--bridge-color); }
.result-badge.tunnel { background: #F4EEFA; color: var(--tunnel-color); }
.result-badge.betriebsstelle { background: var(--db-warning-bg); color: #C05E00; }
.result-badge.bahnuebergang { background: var(--db-error-bg); color: var(--db-red-dark); }

/* ====== GROUPED BETRIEBSSTELLEN ====== */
.result-group {
    border-bottom: 1px solid var(--border);
}
.result-group-header {
    padding: 12px 16px;
    cursor: pointer;
    transition: background .15s;
    display: flex;
    align-items: center;
    gap: 12px;
}
.result-group-header:hover {
    background: var(--db-cool-gray-100);
}
.result-group-count {
    background: var(--bst-color);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    flex-shrink: 0;
}
.result-group-chevron {
    flex-shrink: 0;
    transition: transform .25s ease;
    color: var(--db-cool-gray-400);
    display: flex;
    align-items: center;
}
.result-group.open .result-group-chevron {
    transform: rotate(180deg);
}
.result-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}
.result-group.open .result-group-items {
    max-height: 500px;
}
.result-group-subitem {
    padding: 10px 16px 10px 62px;
    cursor: pointer;
    transition: background .15s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
    border-top: 1px solid var(--db-cool-gray-100);
}
.result-group-subitem:hover {
    background: var(--db-cool-gray-100);
}
.result-group-subitem.active {
    background: var(--db-info-bg);
    border-left: 4px solid var(--db-red);
    padding-left: 58px;
}
.result-group-subitem-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bst-color);
    flex-shrink: 0;
}
.result-group-subitem-text {
    flex: 1;
    min-width: 0;
}

/* ====== DETAIL SLIDE-IN PANEL ====== */
.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100%;
    background: #fff;
    z-index: 15;
    box-shadow: -4px 0 20px rgba(0,0,0,.12);
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-panel.open {
    transform: translateX(0);
}

.detail-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    color: var(--text-light);
    font-size: 13px;
}

/* Slide Header */
.detail-slide-header {
    padding: 20px 20px 16px;
    background: var(--primary);
    color: #fff;
    position: relative;
    flex-shrink: 0;
    border-bottom: 4px solid var(--db-red);
}

.detail-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

.detail-close-btn:hover {
    background: rgba(255,255,255,.25);
}

.detail-slide-type {
    margin-bottom: 8px;
}

.detail-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-type-badge svg {
    width: 14px;
    height: 14px;
}

.detail-type-badge.bruecke {
    background: rgba(20,85,192,.2);
    color: #B4D5F6;
}

.detail-type-badge.tunnel {
    background: rgba(129,73,151,.2);
    color: #E0CDE4;
}

.detail-type-badge.betriebsstelle {
    background: rgba(243,146,0,.2);
    color: #FCE3B4;
}

.detail-type-badge.bahnuebergang {
    background: rgba(236,0,22,.2);
    color: #FCC8C3;
}

.detail-type-badge.strecke {
    background: rgba(75,85,99,.2);
    color: #9CA3AF;
}

.detail-stats-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-stat-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
}

.detail-stat-chip svg {
    width: 14px;
    height: 14px;
    opacity: .6;
}

.detail-stat-count {
    font-weight: 700;
}

.detail-stat-label {
    opacity: .7;
}

.detail-slide-title {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    padding-right: 40px;
}

.detail-slide-subtitle {
    font-size: 12px;
    opacity: .7;
    margin-top: 4px;
}

/* Slide Body */
.detail-slide-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 24px;
    background: var(--db-cool-gray-100);
}

/* Satellite image + coordinates */
.detail-satellite {
    margin-bottom: 12px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--db-cool-gray-200);
    position: relative;
}
.detail-satellite img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.detail-satellite .detail-coords {
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
}

.detail-mini-map {
    margin-bottom: 12px;
}

.detail-coords {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-light);
}

.detail-coords-icon {
    display: flex;
    color: var(--db-red);
}

.detail-coords-icon svg {
    width: 16px;
    height: 16px;
}

/* Nav chips */
.detail-nav-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.detail-nav-chip {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    border: none;
    color: #fff;
}

.detail-nav-chip svg {
    width: 14px;
    height: 14px;
}

.detail-nav-chip.google { background: #4285f4; }
.detail-nav-chip.google:hover { background: #3367d6; }
.detail-nav-chip.apple { background: var(--db-cool-gray-700); }
.detail-nav-chip.apple:hover { background: var(--db-cool-gray-600); }
.detail-nav-chip.route { background: var(--db-info); }
.detail-nav-chip.route:hover { background: #006A96; }

/* Section card */
.detail-section-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.detail-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-light);
    margin-bottom: 12px;
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* Properties list */
.detail-props {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.detail-prop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--db-cool-gray-100);
}

.detail-prop:last-child { border-bottom: none; }

.detail-prop-label {
    font-size: 12px;
    color: var(--text-light);
    flex-shrink: 0;
}

.detail-prop-value {
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    color: var(--text);
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Nearby list */
.detail-nearby-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-nearby-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: none;
    background: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-align: left;
    width: 100%;
    font-family: var(--font);
    transition: background .15s;
}

.detail-nearby-item:hover {
    background: var(--db-cool-gray-100);
}

.detail-nearby-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.detail-nearby-icon svg {
    width: 16px;
    height: 16px;
}

.detail-nearby-icon.bruecke { background: var(--bridge-color); }
.detail-nearby-icon.tunnel { background: var(--tunnel-color); }
.detail-nearby-icon.betriebsstelle { background: var(--bst-color); }
.detail-nearby-icon.bahnuebergang { background: var(--bue-color); }

.detail-nearby-info {
    flex: 1;
    min-width: 0;
}

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

.detail-nearby-meta {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    margin-top: 1px;
}

.detail-nearby-arrow {
    flex-shrink: 0;
    color: var(--db-cool-gray-300);
}

/* Inspect button */
.detail-inspect-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: var(--db-red);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    margin-top: 8px;
    transition: background .15s;
}

.detail-inspect-btn:hover {
    background: var(--db-red-dark);
}

.detail-inspect-btn svg {
    width: 18px;
    height: 18px;
}

/* Responsive detail */
@media (max-width: 768px) {
    .detail-panel {
        width: 100%;
    }
}

/* ====== MAP CONTROLS ====== */
.map-toggle {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: calc(12px + env(safe-area-inset-left, 0px));
    z-index: 5;
    background: #fff;
    border: 1px solid var(--border);
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    font-size: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.map-toggle svg {
    width: 20px;
    height: 20px;
}

.map-overlay-info {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s;
}

.map-overlay-info.visible {
    opacity: 1;
}

.map-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 6;
    opacity: 0;
    transition: opacity .4s ease;
    pointer-events: none;
    overflow: hidden;
}

.map-loading.visible {
    opacity: 1;
}

.map-loading-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--db-red), #ff4444, var(--db-red));
    border-radius: 0 2px 2px 0;
    animation: mapLoadSlide 1.4s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(236, 0, 22, 0.4);
}

@keyframes mapLoadSlide {
    0%   { width: 0%; margin-left: 0%; }
    50%  { width: 35%; margin-left: 32%; }
    100% { width: 0%; margin-left: 100%; }
}

.map-stats {
    position: absolute;
    bottom: 70px;
    right: 10px;
    background: rgba(255,255,255,.95);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 11px;
    color: var(--text-light);
    z-index: 5;
    box-shadow: var(--shadow);
}

.locate-btn {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: calc(60px + env(safe-area-inset-right, 0px));
    z-index: 5;
    background: #fff;
    border: 1px solid var(--border);
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: background .15s;
}

.locate-btn svg {
    width: 20px;
    height: 20px;
}

.locate-btn:hover { background: var(--db-cool-gray-100); }

.nearby-map-btn {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: calc(110px + env(safe-area-inset-right, 0px));
    z-index: 5;
    background: #fff;
    border: 1px solid var(--border);
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: background .15s;
}
.nearby-map-btn svg { width: 20px; height: 20px; }
.nearby-map-btn:hover { background: var(--db-cool-gray-100); }

.satellite-btn {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: calc(160px + env(safe-area-inset-right, 0px));
    z-index: 5;
    background: #fff;
    border: 1px solid var(--border);
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: background .15s;
}
.satellite-btn svg { width: 20px; height: 20px; }
.satellite-btn:hover { background: var(--db-cool-gray-100); }
.satellite-btn.active {
    background: var(--db-red);
    border-color: var(--db-red);
    color: #fff;
}

.filter-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    background: var(--primary);
    border-top: 1px solid rgba(255,255,255,.08);
}


.filter-chip {
    flex: 1;
    padding: 8px 4px 6px;
    border: none;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    background: transparent;
    color: rgba(255,255,255,.5);
    transition: all .15s;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    position: relative;
}

.filter-chip svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.filter-chip span {
    display: block;
    line-height: 1;
}

.filter-chip.active {
    color: var(--db-red);
}

.filter-chip.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 2px;
    background: var(--db-red);
    border-radius: 0 0 2px 2px;
}

.filter-chip:hover:not(.active) {
    color: rgba(255,255,255,.85);
}

/* ====== LOGIN OVERLAY ====== */
.login-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(19,24,33,.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 16px 0;
}

.login-overlay.active { display: flex; }

.login-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px;
    width: 400px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 22px;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
}
.modal-close:hover {
    background: var(--db-cool-gray-100);
    color: var(--text);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 20px;
    font-family: var(--font-head);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-card h2 svg {
    width: 24px;
    height: 24px;
    color: var(--db-red);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--db-info);
    box-shadow: 0 0 0 2px rgba(0,135,185,.15);
}

/* Buttons (DB Style) */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    font-family: var(--font);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--db-red);
    color: #fff;
    width: 100%;
}

.btn-primary:hover { background: var(--db-red-dark); }

.btn-secondary {
    background: var(--db-cool-gray-200);
    color: var(--db-cool-gray-700);
    width: 100%;
}

.btn-secondary:hover { background: var(--db-cool-gray-300); }

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

/* ====== INSPECTION MODULE ====== */
.inspection-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 900;
    flex-direction: column;
}

.inspection-overlay.active {
    display: flex;
}

.inspection-header {
    padding: 0 16px;
    padding-top: env(safe-area-inset-top, 0px);
    min-height: 56px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    border-bottom: 4px solid var(--db-red);
}

.inspection-header h2 {
    font-size: 16px;
    font-family: var(--font-head);
    flex: 1;
}

.inspection-header button {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.inspection-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--db-cool-gray-100);
}

.inspection-tabs {
    display: flex;
    gap: 0;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-shrink: 0;
}

.inspection-tab {
    padding: 12px 16px;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text-light);
    white-space: nowrap;
    transition: all .15s;
}

.inspection-tab.active {
    color: var(--db-red);
    border-bottom-color: var(--db-red);
}

.inspection-tab:hover:not(.active) {
    color: var(--text);
}

/* Bauteil-Bewertung */
.bauteil-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 12px;
}

.bauteil-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.bauteil-card-header h4 {
    font-size: 14px;
}

.note-select {
    padding: 6px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    min-width: 80px;
    text-align: center;
}

.note-1 { border-color: var(--db-success); color: var(--db-success); }
.note-2 { border-color: #FFD800; color: #C05E00; }
.note-3 { border-color: var(--db-warning); color: var(--db-warning); }
.note-4 { border-color: var(--db-error); color: var(--db-error); }

.mangel-input {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 13px;
    resize: vertical;
}

.speech-btn {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    color: var(--text-light);
}

.speech-btn svg {
    width: 18px;
    height: 18px;
}

.speech-btn.recording {
    border-color: var(--db-red);
    background: var(--db-red-100);
    color: var(--db-red);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(236,0,22,.3); }
    50% { box-shadow: 0 0 0 8px rgba(236,0,22,0); }
}

/* ====== PHOTO MODULE ====== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.photo-thumb {
    aspect-ratio: 4/3;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 1px solid var(--border);
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-thumb .delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--db-red);
    color: #fff;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    display: none;
}

.photo-thumb:hover .delete-btn { display: flex; align-items: center; justify-content: center; }

.add-photo-btn {
    aspect-ratio: 4/3;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    font-size: 12px;
    gap: 4px;
    transition: all .15s;
}

.add-photo-btn:hover {
    border-color: var(--db-info);
    color: var(--db-info);
}

.add-photo-btn svg {
    width: 24px;
    height: 24px;
}

/* ====== SIGNATURE PAD ====== */
.signature-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    position: relative;
}

.signature-wrapper canvas {
    width: 100%;
    height: 150px;
    display: block;
}

.signature-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 4px;
}

.signature-actions button {
    background: var(--db-cool-gray-100);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: var(--radius);
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
}

/* ====== CANVAS EDITOR (Photo Markup) ====== */
.photo-editor-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--db-cool-gray-800);
    z-index: 1100;
    flex-direction: column;
}

.photo-editor-overlay.active { display: flex; }

.editor-toolbar {
    padding: 8px 16px;
    background: var(--db-cool-gray-700);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 3px solid var(--db-red);
}

.editor-tool {
    background: var(--db-cool-gray-600);
    border: 1px solid rgba(255,255,255,.1);
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all .15s;
}

.editor-tool.active {
    border-color: var(--db-red);
    background: rgba(236,0,22,.2);
}

.editor-canvas-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.editor-canvas-wrap canvas {
    max-width: 100%;
    max-height: 100%;
}

/* ====== EXPORT PANEL ====== */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.export-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all .15s;
    background: #fff;
}

.export-card:hover {
    border-color: var(--db-info);
    background: var(--db-info-bg);
}

.export-card .icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--db-cool-gray-100);
    border-radius: var(--radius);
    color: var(--db-cool-gray-500);
}

.export-card .icon svg {
    width: 24px;
    height: 24px;
}

.export-card h4 { font-size: 14px; }
.export-card p { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* ====== TOAST NOTIFICATION ====== */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--db-cool-gray-700);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    z-index: 2000;
    transition: transform .3s ease;
    box-shadow: var(--shadow-lg);
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
}

.toast.success { background: var(--db-success); }
.toast.error { background: var(--db-error); }

/* ====== LOADING ====== */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--db-cool-gray-200);
    border-top-color: var(--db-red);
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }


.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-state .empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: var(--db-cool-gray-300);
}

.empty-state p { font-size: 13px; }

/* ====== MOBILE SIDEBAR BACKDROP ====== */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(19,24,33,.5);
    z-index: 19;
    opacity: 0;
    transition: opacity .3s ease;
    -webkit-tap-highlight-color: transparent;
}
.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}


/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    /* -- Sidebar drawer -- */
    #sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 85%;
        max-width: 360px;
        min-width: 0;
        z-index: 20;
        transform: translateX(-100%);
        transition: transform .3s cubic-bezier(.4,0,.2,1);
        box-shadow: none;
    }
    #sidebar.visible {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,.15);
    }

    .sidebar-header {
        position: sticky;
        top: 0;
        z-index: 2;
        padding: 10px 10px;
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
        gap: 8px;
    }

    .header-actions {
        gap: 4px;
        flex-shrink: 0;
    }

    .header-actions button {
        width: 32px;
        height: 32px;
    }

    .header-actions button svg {
        width: 16px;
        height: 16px;
    }

    /* -- Map controls top bar -- */
    .map-toggle {
        display: flex;
        top: calc(10px + env(safe-area-inset-top, 0px));
        left: calc(10px + env(safe-area-inset-left, 0px));
    }

    .locate-btn {
        top: calc(10px + env(safe-area-inset-top, 0px));
        right: calc(56px + env(safe-area-inset-right, 0px));
    }

    .nearby-map-btn {
        top: calc(10px + env(safe-area-inset-top, 0px));
        right: calc(106px + env(safe-area-inset-right, 0px));
    }

    .satellite-btn {
        top: calc(10px + env(safe-area-inset-top, 0px));
        right: calc(156px + env(safe-area-inset-right, 0px));
    }

    /* -- Filter bar is now a fixed bottom tab bar, no mobile overrides needed -- */

    /* -- Detail panel fullscreen -- */
    .detail-panel {
        position: fixed;
        inset: 0;
        width: 100%;
        z-index: 25;
        background: #fff;
    }

    .detail-slide-header {
        padding-top: calc(20px + env(safe-area-inset-top, 0px));
    }

    .detail-close-btn {
        top: calc(12px + env(safe-area-inset-top, 0px));
    }

    /* -- Map stats above bottom bar -- */
    .map-stats {
        bottom: 70px;
    }

    .map-overlay-info {
        bottom: 70px;
    }
}

/* ====== SCROLLBAR ====== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--db-cool-gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--db-cool-gray-400); }

/* ====== Mapbox overrides ====== */
.mapboxgl-ctrl-top-right {
    top: env(safe-area-inset-top, 0px);
    right: env(safe-area-inset-right, 0px);
}

.mapboxgl-ctrl-bottom-left {
    bottom: 56px;
    left: 0;
}

.mapboxgl-popup-content {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 13px;
    box-shadow: var(--shadow-lg);
}

.mapboxgl-popup-content h3 {
    font-size: 14px;
    margin-bottom: 4px;
}

.mapboxgl-popup-content p {
    color: var(--text-light);
    margin: 2px 0;
}

.popup-nav-link {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: var(--db-red);
    color: #fff;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}

.popup-nav-link:hover { background: var(--db-red-dark); }

/* Navigation buttons (legacy) */
.nav-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.nav-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all .15s;
    text-decoration: none;
    color: #fff;
    min-height: 44px;
}

.nav-btn.google { background: #4285f4; }
.nav-btn.google:hover { background: #3367d6; }
.nav-btn.apple { background: var(--db-cool-gray-700); }
.nav-btn.apple:hover { background: var(--db-cool-gray-600); }
.nav-btn.mapbox { background: var(--db-info); }
.nav-btn.mapbox:hover { background: #006A96; }

.inspect-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--db-red);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 16px;
    transition: background .15s;
    min-height: 44px;
}

.inspect-btn:hover { background: var(--db-red-dark); }

/* ====== ADMIN PANEL ====== */
.admin-panel {
    background: #fff;
    border-radius: var(--radius);
    width: 680px;
    max-width: 95vw;
    max-height: 85vh;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-panel-header {
    padding: 20px 24px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-bottom: 4px solid var(--db-red);
}

.admin-panel-header h2 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-panel-header h2 svg {
    width: 22px;
    height: 22px;
}

.admin-close-btn {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-close-btn:hover { background: rgba(255,255,255,.25); }
.admin-close-btn svg { width: 18px; height: 18px; }

.admin-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px 24px;
    background: var(--db-cool-gray-100);
}

.admin-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* User rows */
.admin-user-row {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: border-color .15s;
}

.admin-user-row.pending {
    border-left: 4px solid var(--db-warning);
    background: var(--db-warning-bg);
}

.admin-user-row.disabled {
    opacity: .6;
}

.admin-user-info { flex: 1; min-width: 0; }

.admin-user-name {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-user-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* Status/Role badges */
.admin-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: var(--radius);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-admin { background: var(--db-info-bg); color: var(--db-info); }
.badge-inspektor { background: var(--db-cool-gray-100); color: var(--db-cool-gray-500); }
.badge-active { background: var(--db-success-bg); color: var(--db-success); }
.badge-pending { background: var(--db-warning-bg); color: var(--db-warning); }
.badge-disabled { background: var(--db-error-bg); color: var(--db-error); }

/* Small action buttons */
.btn-sm {
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: all .15s;
    white-space: nowrap;
}

.btn-approve { background: var(--db-success); color: #fff; }
.btn-approve:hover { background: #3D6E14; }
.btn-disable { background: var(--db-cool-gray-200); color: var(--db-cool-gray-600); }
.btn-disable:hover { background: var(--db-cool-gray-300); }
.btn-delete { background: var(--db-error-bg); color: var(--db-error); border: 1px solid var(--db-red-200); font-size: 16px; padding: 4px 10px; line-height: 1; }
.btn-delete:hover { background: var(--db-red-200); }

@media (max-width: 768px) {
    .admin-panel { width: 100%; max-width: 100%; max-height: 100vh; border-radius: 0; }
    .admin-user-row { flex-direction: column; align-items: flex-start; }
    .admin-user-actions { margin-top: 8px; }
}

/* ====== PWA Install Banner ====== */
.pwa-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    display: flex;
    justify-content: center;
    padding: 12px;
    padding-bottom: 12px;
    animation: pwaSlideUp .4s ease-out;
}
.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e2e4e8);
    border-radius: 14px;
    padding: 12px 16px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 -2px 20px rgba(0,0,0,.15);
}
.pwa-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
}
.pwa-banner-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text, #131821);
}
.pwa-banner-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 2px;
}
.pwa-banner-text em {
    font-style: normal;
    font-weight: 600;
}
.pwa-share-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    vertical-align: -3px;
    color: #007AFF;
}
.pwa-banner-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-muted, #646973);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    flex-shrink: 0;
}
@keyframes pwaSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Pulsierender KM-Marker (Radar-Effekt) */
.pulse-marker {
    position: relative;
    width: 16px;
    height: 16px;
}

.pulse-marker-dot {
    width: 16px;
    height: 16px;
    background: var(--db-red);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.pulse-marker-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border-radius: 50%;
    border: 2px solid var(--db-red);
    animation: pulseRadar 2.5s ease-out infinite;
    will-change: transform, opacity;
    z-index: 1;
}

.pulse-marker-ring:nth-child(3) {
    animation-delay: .8s;
}

@keyframes pulseRadar {
    0%   { transform: scale(1); opacity: .7; }
    100% { transform: scale(4); opacity: 0; }
}

/* Blaue Variante für eigenen Standort */
.pulse-marker-blue .pulse-marker-dot {
    background: #0087B9;
    box-shadow: 0 0 8px rgba(0,135,185,.5);
}

.pulse-marker-blue .pulse-marker-ring {
    border-color: #0087B9;
}
