/* ===== Page Navigation ===== */
.page-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f1f5f9;
    border-top: 1px solid var(--border);
}

.page-nav-btn {
    background: var(--bg-toolbar);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}

.page-nav-btn:hover {
    background: var(--primary);
}

.page-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-nav-btn.page-delete {
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    padding: 4px 8px;
}

.page-nav-btn.page-delete:hover {
    color: var(--danger);
    background: #fee2e2;
}

#page-indicator {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 100px;
    text-align: center;
}

/* ===== CSS Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary: #3094BA;
    --primary-hover: #277fa1;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --bg-main: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-toolbar: #373F45;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    
    /* Typography */
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    font-family: var(--font-main);
    background: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Toolbar ===== */
.toolbar {
    background: var(--bg-toolbar);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px var(--shadow);
    gap: var(--spacing-md);
    flex-shrink: 0;
}

.toolbar h1 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 2px;
}

.toolbar-center {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    flex: 1;
    justify-content: center;
}

.tool-group {
    display: flex;
    gap: var(--spacing-xs);
    background: rgba(255, 255, 255, 0.1);
    padding: var(--spacing-xs);
    border-radius: 6px;
}

.separator {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
}

.tool-btn {
    background: transparent;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.tool-btn.active {
    background: var(--primary);
}

/* Symbols Toolbar */
.symbols-toolbar {
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
}

.separator-small {
    width: 1px;
    height: 62px;
    background: rgba(255,255,255,0.2);
    margin: 0 6px;
    align-self: center;
}

/* Symbol-Button (einzelnes Symbol mit Label) */
.symbol-btn {
    width: 62px;
    height: 62px;
    padding: 5px;
    border: 2px solid transparent;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.15s;
}

.symbol-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

.symbol-btn.active {
    background: rgba(255,255,255,0.3);
    border-color: #fff;
    box-shadow: 0 0 8px rgba(255,255,255,0.4);
}

.symbol-btn svg {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

/* Button Label */
.btn-label {
    font-size: 9px;
    color: rgba(255,255,255,0.9);
    text-align: center;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tool-Button mit Label */
.tool-btn.with-label {
    width: 62px;
    height: 62px;
    flex-direction: column;
    gap: 2px;
}

.tool-btn.with-label .icon {
    font-size: 24px;
}

/* Alte Preset-Dropdowns ausblenden (nicht mehr benötigt) */
.tool-with-preset,
.preset-dropdown,
.preset-buttons,
.preset-btn {
    display: none !important;
}

/* Slider mit Input kombiniert */
.slider-with-input {
    display: flex;
    align-items: center;
    gap: 6px;
}

.slider-with-input input[type="range"] {
    flex: 1;
    min-width: 0;
}

.slider-with-input .small-input,
.small-input {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    padding: 3px 4px;
    font-size: 12px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 4px;
}

/* Property section titles */
.prop-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 10px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}
.prop-section-title:first-child {
    margin-top: 0;
}
.prop-section .form-group {
    margin-bottom: 8px;
}

/* Sidebar-specific tighter spacing */
.sidebar-right .form-group {
    margin-bottom: 8px;
}
.sidebar-right .form-group label {
    margin-bottom: 2px;
    font-size: 12px;
}

.preset-dropdown:focus {
    outline: 1px solid var(--primary);
}

.preset-dropdown option {
    background: #373F45;
    color: white;
    font-size: 12px;
}

.toolbar-right {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.btn-action {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-primary {
    background: var(--primary);
    border: none;
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* ===== Main Container ===== */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== Sidebars ===== */
.sidebar-left,
.sidebar-right {
    background: var(--bg-sidebar);
    width: 280px;
    min-width: 200px;
    max-width: 500px;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    flex-shrink: 0;
}

.sidebar-right {
    border-right: none;
    border-left: 1px solid var(--border);
}

/* Resize Handle zwischen Sidebar und Canvas */
.resize-handle {
    width: 5px;
    cursor: col-resize;
    background: var(--border);
    flex-shrink: 0;
    transition: background 0.15s;
}

.resize-handle:hover,
.resize-handle.active {
    background: var(--primary);
}

.panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--spacing-md);
}

.panel h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Collapsible Panels */
.panel-toggle {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.panel-toggle:hover {
    color: var(--primary);
}

.toggle-arrow {
    font-size: 12px;
    transition: transform 0.2s;
}

.panel.collapsed .panel-body {
    display: none;
}

.panel.collapsed .panel-toggle {
    margin-bottom: 0;
}

.panel.collapsed .toggle-arrow {
    transform: rotate(-90deg);
}

.panel h4 {
    font-size: 13px;
    font-weight: 600;
    margin: var(--spacing-md) 0 var(--spacing-sm) 0;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select,
.form-control {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    font-family: var(--font-main);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group input[type="range"] {
    width: calc(100% - 50px);
    margin-right: var(--spacing-sm);
}

.form-group input[type="color"] {
    width: 100%;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
}

.btn-block {
    width: 100%;
    padding: var(--spacing-sm);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-block:hover {
    background: var(--primary-hover);
}

.btn-small {
    padding: 3px 8px;
    font-size: 11px;
    background: #64748b;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-small:hover {
    background: #475569;
}

.btn-danger {
    width: 100%;
    padding: var(--spacing-sm);
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    margin-top: var(--spacing-md);
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-success {
    width: 100%;
    padding: var(--spacing-sm);
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-success:hover {
    background: #16a34a;
}

.help-text {
    color: var(--text-secondary);
    font-size: 13px;
    font-style: italic;
    text-align: center;
    padding: var(--spacing-md) 0;
}

/* ===== Canvas Area ===== */
.canvas-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
    position: relative;
    overflow: hidden;
}

.canvas-viewport {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    min-height: 0;
    min-width: 0;
}

.canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    min-width: 0;
}

/* Scrollbalken-Gemeinsam */
.canvas-scrollbar-h,
.canvas-scrollbar-v {
    background: #d1d5db;
    position: relative;
    flex-shrink: 0;
}

.canvas-scrollbar-h {
    height: 10px;
}

.canvas-scrollbar-v {
    width: 10px;
}

.canvas-scrollbar-thumb-h,
.canvas-scrollbar-thumb-v {
    background: #9ca3af;
    border-radius: 5px;
    position: absolute;
    cursor: grab;
    transition: background 0.15s;
}

.canvas-scrollbar-thumb-h {
    height: 100%;
    min-width: 40px;
}

.canvas-scrollbar-thumb-v {
    width: 100%;
    min-height: 40px;
}

.canvas-scrollbar-thumb-h:hover,
.canvas-scrollbar-thumb-h.dragging,
.canvas-scrollbar-thumb-v:hover,
.canvas-scrollbar-thumb-v.dragging {
    background: #6b7280;
}

#main-canvas {
    /* Kein box-shadow/bg nötig — weißes Blatt ist Fabric-Objekt */
}

.canvas-info {
    background: white;
    border-top: 1px solid var(--border);
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    gap: var(--spacing-md);
    font-size: 13px;
    color: var(--text-secondary);
    justify-content: center;
}

.canvas-info .separator {
    height: auto;
}

/* ===== Layer List ===== */
.layer-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.layer-item {
    padding: var(--spacing-sm);
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: all 0.2s;
}

.layer-item:hover {
    background: #e2e8f0;
}

.layer-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.layer-icon {
    font-size: 16px;
}

.layer-name {
    flex: 1;
    font-size: 13px;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .sidebar-left,
    .sidebar-right {
        width: 240px;
    }
}

/* ===== Scrollbar Styling (Chromium only) ===== */
@supports selector(::-webkit-scrollbar) {
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    ::-webkit-scrollbar-track {
        background: var(--bg-main);
    }

    ::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }
}

/* ===== Notification ===== */
.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #373F45;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
}

.notification.fade-out {
    animation: slideOut 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(20px);
        opacity: 0;
    }
}

/* ===== Address Autocomplete ===== */
.address-autocomplete {
    position: relative;
    width: 100%;
}

.address-autocomplete input {
    width: 100%;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.suggestions-dropdown.active {
    display: block;
}

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 12px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.focused {
    background: #f0f9ff;
}

.suggestion-item .main-text {
    font-weight: 500;
    color: #1e293b;
}

.suggestion-item .sub-text {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

.suggestion-item.loading {
    color: #64748b;
    font-style: italic;
    text-align: center;
}

.suggestion-item.no-results {
    color: #94a3b8;
    font-style: italic;
    text-align: center;
}

/* Google Maps Button */
.btn-maps {
    width: 100%;
    margin-top: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #34a853 0%, #1e8e3e 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-maps:hover {
    background: linear-gradient(135deg, #2d9249 0%, #1a7a35 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 168, 83, 0.3);
}

.btn-maps:active {
    transform: translateY(0);
}

/* ===== Export Dialog ===== */
.export-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.export-dialog {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 380px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.export-dialog h3 {
    margin-bottom: 16px;
    font-size: 18px;
    text-transform: none;
    letter-spacing: 0;
}

/* ===== DASHBOARD ===== */
#dashboard-screen {
    display: flex;
    position: fixed;
    inset: 0;
    background: #f1f5f9;
    z-index: 8000;
}
.dashboard-container {
    width: 100%;
    display: flex;
    flex-direction: column;
}
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #373F45;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.dashboard-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.dashboard-header-left h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    margin: 0;
}
.site-logo {
    height: 36px;
    width: auto;
    border-radius: 4px;
}
.dashboard-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.dashboard-header-right .btn-action {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 13px;
    padding: 6px 12px;
}
.dashboard-header-right .btn-action:hover {
    background: rgba(255,255,255,0.2);
}
.dashboard-header-right .user-info {
    color: #94a3b8;
    font-size: 13px;
}
.dashboard-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}
.dashboard-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}
.dashboard-new-btn {
    padding: 12px 24px;
    font-size: 15px;
    white-space: nowrap;
}
.dashboard-search {
    flex: 1;
}
.dashboard-search input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    background: #fff;
}
.dashboard-search input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.dashboard-plans-list {
    display: grid;
    gap: 12px;
}
.dashboard-plan-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.dashboard-plan-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59,130,246,0.12);
}
.dashboard-plan-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    background: #fff;
    transition: background 0.15s;
}
.dashboard-plan-card-header:hover {
    background: #f8fafc;
}
/* Status-Farben */
.dashboard-plan-card.status-geplant      { border-color: #93c5fd; }
.dashboard-plan-card.status-geplant      .dashboard-plan-card-header { background: #dbeafe; }
.dashboard-plan-card.status-geplant      .dashboard-plan-card-header:hover { background: #bfdbfe; }
.dashboard-plan-card.status-aktualisiert { border-color: #86efac; }
.dashboard-plan-card.status-aktualisiert .dashboard-plan-card-header { background: #dcfce7; }
.dashboard-plan-card.status-aktualisiert .dashboard-plan-card-header:hover { background: #bbf7d0; }
.dashboard-plan-card.status-leitstelle   { border-color: #fdba74; }
.dashboard-plan-card.status-leitstelle   .dashboard-plan-card-header { background: #fff7ed; }
.dashboard-plan-card.status-leitstelle   .dashboard-plan-card-header:hover { background: #fed7aa; }
.dashboard-plan-info {
    flex: 1;
}
.dashboard-plan-address {
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
}
.dashboard-plan-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}
.dashboard-plan-actions {
    display: flex;
    gap: 8px;
}

/* ===== SYMBOL PAIRS (Neu/Bestand untereinander) ===== */
.symbol-pairs-container {
    display: inline-flex;
    align-items: flex-start;
    gap: 2px;
}
.symbol-pair {
    display: flex;
    flex-direction: column;
    gap: 1px;
    align-items: center;
}
.symbol-btn-placeholder {
    width: 100%;
    visibility: hidden;
    max-height: 0;
}
.symbol-pair .neu-item,
.symbol-pair .bestand-item {
    transition: max-height 0.2s ease, opacity 0.15s ease, padding 0.2s ease, margin 0.2s ease;
    overflow: hidden;
    max-height: 80px;
}
.symbol-pairs-container.neu-collapsed .neu-item {
    max-height: 0 !important;
    opacity: 0;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    pointer-events: none;
}
.symbol-pairs-container.bestand-collapsed .bestand-item {
    max-height: 0 !important;
    opacity: 0;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    pointer-events: none;
}
.symbol-group-toggle {
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    align-self: stretch;
    display: flex;
    align-items: center;
}
.symbol-group-toggle:hover {
    background: #cbd5e1;
}
.bestand-toggle {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}
.bestand-toggle:hover {
    background: #bbf7d0;
}

/* ===== DETECTION ZONE TOOLBAR ===== */
.detection-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.detection-color-bar {
    display: flex;
    gap: 3px;
    padding: 2px 4px;
    background: rgba(0,0,0,0.15);
    border-radius: 4px;
}
.dz-color-btn {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.4);
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
}
.dz-color-btn:hover {
    transform: scale(1.2);
}
.dz-color-btn.active {
    border-color: #fff;
    box-shadow: 0 0 4px rgba(255,255,255,0.7);
}
.dz-green  { background: #22c55e; }
.dz-red    { background: #ef4444; }
.dz-blue   { background: #3b82f6; }
.dz-yellow { background: #eab308; }

/* ===== FILE BUTTON GROUPS & DROPDOWNS ===== */
.file-btn-group {
    position: relative;
    display: inline-block;
}
.dropdown-group .file-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 100;
    min-width: 180px;
    overflow: hidden;
}
.dropdown-group .file-dropdown.show {
    display: block;
}
.file-dropdown button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.1s;
}
.file-dropdown button:hover {
    background: #f1f5f9;
}

.plan-status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1.6;
}
.plan-status-geplant       { background: #dbeafe; color: #1d4ed8; }
.plan-status-aktualisiert  { background: #dcfce7; color: #15803d; }
.plan-status-leitstelle    { background: #fed7aa; color: #c2410c; }

.dashboard-sort-select {
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    white-space: nowrap;
}
.dashboard-sort-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* ===== EDITOR SITE LOGO ===== */
.editor-site-logo {
    height: 44px;
    width: auto;
    border-radius: 4px;
}

/* ===== TOOLBAR LEFT ===== */
.toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.toolbar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.toolbar-brand h1 {
    font-size: 14px;
    letter-spacing: 1.5px;
    white-space: nowrap;
}

#btn-back-dashboard {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
    align-self: flex-start;
}
#btn-back-dashboard:hover {
    background: rgba(255,255,255,0.2);
}

/* ===== FILE BUTTON STACKS (right side) ===== */
.file-btn-stack {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* ===== COMPACT FILE BUTTONS ===== */
.btn-compact {
    padding: 3px 10px !important;
    font-size: 12px !important;
}

/* ===== LOGIN SCREEN ===== */
#login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #373F45 0%, #4a5568 100%);
    z-index: 10000;
}
.login-container {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 360px;
    max-width: 90vw;
}
.login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.login-logo-img {
    max-width: 220px;
    max-height: 80px;
    object-fit: contain;
}
.login-field {
    margin-bottom: 16px;
}
.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}
.login-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.login-field input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.login-error {
    color: #dc2626;
    font-size: 13px;
    min-height: 20px;
    margin-bottom: 8px;
}
.login-btn {
    width: 100%;
    padding: 12px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.login-btn:hover {
    background: #2563eb;
}

.login-footer-links {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: #94a3b8;
}
.login-footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}
.login-footer-links a:hover {
    color: #3b82f6;
    text-decoration: underline;
}
.login-footer-links span {
    margin: 0 8px;
}

/* ===== MODAL OVERLAY ===== */
.modal-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9000;
}
.modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 500px;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.modal-large {
    width: 1000px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.modal-header h2 {
    margin: 0;
    font-size: 18px;
}
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    padding: 0 4px;
}
.modal-close:hover {
    color: #1e293b;
}
.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* ===== SHORTCUTS TABLE ===== */
.shortcuts-table {
    width: 100%;
    border-collapse: collapse;
}
.shortcuts-table th {
    text-align: left;
    padding: 6px 10px;
    border-bottom: 2px solid #e2e8f0;
    font-size: 13px;
    color: #64748b;
}
.shortcuts-table td {
    padding: 5px 10px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}
.shortcuts-table tr.shortcuts-section td {
    font-weight: 600;
    color: #334155;
    padding-top: 14px;
    border-bottom: 1px solid #cbd5e1;
    background: #f8fafc;
}
.shortcuts-table kbd {
    display: inline-block;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 1px 6px;
    font-family: monospace;
    font-size: 12px;
    box-shadow: 0 1px 0 #94a3b8;
}

/* ===== ADMIN TABLE ===== */
.admin-toolbar {
    margin-bottom: 16px;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.admin-table th, .admin-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.admin-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
}
.admin-table select {
    padding: 4px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 12px;
}
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.status-badge.active {
    background: #dcfce7;
    color: #166534;
}
.status-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}
/* Admin-Table Buttons (spezifischer Selektor) */
.admin-table .btn-small {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #374151;
    cursor: pointer;
}
.admin-table .btn-small:hover {
    background: #f1f5f9;
}
.btn-danger-small {
    border-color: #fca5a5;
    color: #dc2626;
}
.btn-danger-small:hover {
    background: #fef2f2;
}

/* ===== CLOUD TABS ===== */
.cloud-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}
.cloud-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: #64748b;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.cloud-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    font-weight: 600;
}
.cloud-plan-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color 0.15s;
}
.cloud-plan-card:hover {
    border-color: #3b82f6;
}
.cloud-plan-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    background: #fff;
    transition: background 0.15s;
}
.cloud-plan-card-header:hover {
    background: #f8fafc;
}
.plan-card-chevron {
    font-size: 14px;
    color: #64748b;
    flex-shrink: 0;
    margin-left: 8px;
    transition: color 0.15s;
}
.plan-card-versions {
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 10px 14px;
}
.version-list-inline {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}
.version-item-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}
.cloud-plan-address {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}
.cloud-plan-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* ===== VERSION LIST ===== */
.version-list {
    max-height: 300px;
    overflow-y: auto;
}
.version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 6px;
}
.version-item small {
    color: #64748b;
}

/* ===== SHARE ===== */
.share-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

/* ===== USER INFO IN TOOLBAR ===== */
.user-info {
    font-size: 11px;
    color: #94a3b8;
    padding: 0 4px;
    white-space: nowrap;
}
.btn-toolbar-sm {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    transition: all 0.2s;
}
.btn-toolbar-sm:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}
.header-subtitle {
    font-weight: 400;
    font-size: 0.65em;
    opacity: 0.7;
    letter-spacing: 0;
}
.toolbar-separator {
    width: 1px;
    height: 24px;
    background: #475569;
    margin: 0 4px;
}

/* ===== FORM GROUP IN MODALS ===== */
.modal-body .form-group {
    margin-bottom: 12px;
}
.modal-body .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #475569;
}
.modal-body .form-group input,
.modal-body .form-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
}

#create-user-form input, #create-user-form select {
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
}

/* ===== MOBILE LAYOUT ===== */

/* Mobile-only Elemente standardmäßig ausgeblendet */
.mobile-backdrop,
.mobile-bottom-bar,
.mobile-tools-sheet,
.mob-bar-handle {
    display: none;
}

/*
 * Touch-Geräte (Smartphones, Tablets) ODER kleine Fenster (<= 768px).
 * pointer: coarse = primärer Eingabe ist Touch → zuverlässig für Samsung Browser,
 * Firefox für Android, Chrome Android, iOS Safari.
 * max-width: 768px = Fallback für kleine Fenster.
 */
@media (pointer: coarse), (max-width: 768px) {

    /* ── Mobile Elemente einblenden ── */
    .mobile-bottom-bar {
        display: flex !important;
    }
    .mobile-backdrop {
        display: block;
    }
    .mobile-tools-sheet {
        display: flex !important;
    }

    /* ── Desktop-exklusive Elemente verstecken ── */
    .toolbar-center       { display: none !important; }
    .resize-handle        { display: none !important; }
    .canvas-scrollbar-h,
    .canvas-scrollbar-v   { display: none; }

    /* ── Toolbar kompakter ── */
    .toolbar {
        padding: 5px 8px;
        gap: 6px;
    }
    .toolbar h1 {
        font-size: 13px;
        letter-spacing: 0.8px;
        white-space: nowrap;
    }
    .toolbar-left { gap: 6px; }
    .editor-site-logo { height: 28px; }
    #btn-back-dashboard { font-size: 10px; padding: 2px 6px; }
    .header-subtitle { display: none; }
    .toolbar-right { gap: 4px; }
    .toolbar-right .btn-action,
    .toolbar-right .btn-primary {
        padding: 4px 8px;
        font-size: 11px;
    }
    #btn-open, #btn-save { font-size: 11px; }

    /* ── Haupt-Container ── */
    .main-container { padding-bottom: 38px; /* Platz für Pull-Handle */ }
    .canvas-area    { width: 100%; flex: 1; }

    /* ── Status-Leiste ── */
    .canvas-info {
        font-size: 11px;
        gap: 6px;
        padding: 3px 8px;
        flex-wrap: wrap;
        justify-content: center;
    }
    #camera-count, #speaker-count { display: none; }

    /* ── Sidebars → Slide-in Drawer ── */
    .sidebar-left,
    .sidebar-right {
        position: fixed;
        top: 0;
        bottom: 60px;
        width: min(88vw, 300px);
        z-index: 450;
        transform: translateX(-110%);
        transition: transform 0.28s cubic-bezier(.4,0,.2,1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 56px 10px 16px;
        border-right: 1px solid var(--border);
        box-shadow: 4px 0 16px rgba(0,0,0,0.22);
    }
    .sidebar-right {
        right: 0;
        left: auto;
        transform: translateX(110%);
        border-right: none;
        border-left: 1px solid var(--border);
        box-shadow: -4px 0 16px rgba(0,0,0,0.22);
    }
    .sidebar-left.open  { transform: translateX(0); }
    .sidebar-right.open { transform: translateX(0); }

    /* ── Sidebar-Inhalt kleiner ── */
    .panel {
        padding: 9px 10px;
        border-radius: 6px;
        margin-bottom: 6px;
    }
    .panel h3 {
        font-size: 12px;
        margin-bottom: 7px;
        letter-spacing: 0.3px;
    }
    .form-group { margin-bottom: 7px; }
    .form-group label {
        font-size: 11px;
        margin-bottom: 2px;
    }
    .form-group input[type="text"],
    .form-group input[type="number"],
    .form-group textarea,
    .form-group select {
        font-size: 13px;
        padding: 5px 7px;
    }
    .property-row {
        font-size: 12px;
        margin-bottom: 5px;
    }
    .property-row label { font-size: 11px; }
    .property-row input,
    .property-row select { font-size: 12px; padding: 4px 6px; }

    /* ── Backdrop ── */
    .mobile-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0);
        pointer-events: none;
        z-index: 400;
        transition: background 0.25s;
    }
    .mobile-backdrop.active {
        background: rgba(0,0,0,0.45);
        pointer-events: auto;
    }

    /* ── Pull-Handle: immer sichtbar am unteren Rand ── */
    .mob-bar-handle {
        display: flex;
        position: fixed;
        bottom: 24px; /* weg von Browserleiste */
        left: 0;
        right: 0;
        height: 36px;
        background: #1a1f24;
        border-top: 2px solid #3d7de8;
        z-index: 310;
        align-items: center;
        justify-content: center;
        gap: 8px;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.15s;
    }
    .mob-bar-handle:active { background: #2d3a48; }
    .mob-handle-arrow {
        font-size: 13px;
        color: #60a5fa;
        transition: transform 0.25s;
        line-height: 1;
    }
    .mob-handle-label {
        font-size: 12px;
        font-weight: 700;
        color: rgba(255,255,255,0.85);
        letter-spacing: 1px;
        text-transform: uppercase;
    }
    /* Wenn Bar offen: Pfeil dreht sich */
    .mob-bar-handle.bar-open .mob-handle-arrow { transform: rotate(180deg); }

    /* ── Bottom Bar: startet versteckt, schiebt sich hoch ── */
    .mobile-bottom-bar {
        position: fixed;
        bottom: 60px; /* direkt über dem Handle (24px offset + 36px height) */
        left: 0;
        right: 0;
        height: 54px;
        background: #23292e;
        border-top: 1px solid rgba(255,255,255,0.13);
        z-index: 300;
        align-items: stretch;
        /* Standard: ausgeblendet (unter dem Handle versteckt) */
        transform: translateY(100%);
        transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    }
    .mobile-bottom-bar.bar-open {
        transform: translateY(0);
    }
    /* Wenn Bar offen: Canvas hat mehr Padding */
    body.bar-open-state .main-container {
        padding-bottom: calc(24px + 36px + 54px); /* handle-offset + handle-height + bar-height */
    }
    .mob-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        background: transparent;
        border: none;
        color: rgba(255,255,255,0.75);
        cursor: pointer;
        padding: 5px 2px 4px;
        transition: background 0.1s, color 0.1s;
        min-width: 0;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    .mob-btn:active  { background: rgba(255,255,255,0.13); color: #fff; }
    .mob-btn.active  { color: #60a5fa; }
    .mob-btn.active .mob-icon { text-shadow: 0 0 8px rgba(96,165,250,0.5); }
    .mob-label {
        font-size: 8px;
        font-weight: 600;
        white-space: nowrap;
        letter-spacing: 0.2px;
        line-height: 1;
    }
    .mob-icon {
        font-size: 17px;
        line-height: 1;
    }

    /* ── Tools Sheet ── */
    .mobile-tools-sheet {
        flex-direction: column;
        position: fixed;
        bottom: 60px; /* über dem Handle wenn Bar offen */
        left: 0;
        right: 0;
        background: #373F45;
        z-index: 410;
        transform: translateY(105%);
        transition: transform 0.28s cubic-bezier(.4,0,.2,1);
        max-height: 65vh;
        border-radius: 14px 14px 0 0;
        border-top: 2px solid rgba(255,255,255,0.14);
        overflow: hidden;
    }
    .mobile-tools-sheet.open { transform: translateY(0); }
    .mobile-sheet-handle {
        width: 38px;
        height: 4px;
        background: rgba(255,255,255,0.28);
        border-radius: 2px;
        margin: 9px auto 3px;
        flex-shrink: 0;
    }
    #mobile-tools-content {
        overflow-y: auto;
        padding: 6px 10px 14px;
        -webkit-overflow-scrolling: touch;
    }
    #mobile-tools-content .symbols-toolbar {
        flex-wrap: wrap;
        justify-content: center;
        background: transparent;
        padding: 4px;
        gap: 6px;
        width: 100%;
    }
    #mobile-tools-content .tool-group       { flex-wrap: wrap; justify-content: center; }
    #mobile-tools-content .symbol-pairs-container { flex-wrap: wrap; justify-content: center; }
    #mobile-tools-content #btn-select       { display: none !important; }
    #mobile-tools-content .separator-small  {
        width: 100%;
        height: 1px;
        background: rgba(255,255,255,0.14);
        margin: 5px 0;
    }

    /* ── Dashboard mobile ── */
    .dashboard-header {
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .dashboard-header-left h1 { font-size: 15px; }
    .dashboard-header-right   { gap: 5px; flex-wrap: wrap; }
    .dashboard-header-right .btn-action { padding: 4px 9px; font-size: 12px; }
    .dashboard-body           { padding: 12px; }
    .dashboard-actions        { flex-direction: column; gap: 8px; }
    .dashboard-new-btn        { width: 100%; text-align: center; }
    .dashboard-plan-card      { flex-direction: column; align-items: flex-start; gap: 8px; }
    .dashboard-plan-actions   { width: 100%; justify-content: flex-end; }

    /* ── Modals ── */
    .modal-content { max-width: 96vw; max-height: 90vh; }
    .modal-body    { padding: 12px; }

    /* ── Seiten-Navigation ── */
    .page-navigation { gap: 4px; padding: 4px 7px; }
    .page-nav-btn    { padding: 4px 9px; font-size: 12px; }
    #page-indicator  { font-size: 12px; min-width: 66px; }
}

    /* ── FOV-Edit Floating Toolbar ── */
    .mob-fov-toolbar {
        display: none; /* standardmäßig unsichtbar */
        position: fixed;
        top: 56px; /* direkt unter der Toolbar */
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        gap: 8px;
        z-index: 500;
        background: rgba(20, 25, 30, 0.92);
        border: 1px solid rgba(96, 165, 250, 0.5);
        border-radius: 24px;
        padding: 6px 10px;
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    }
    .mob-fov-toolbar.active { display: flex; }
    .mob-fov-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        background: transparent;
        border: none;
        color: rgba(255,255,255,0.85);
        cursor: pointer;
        padding: 4px 10px;
        border-radius: 16px;
        font-size: 16px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.12s;
        min-width: 60px;
    }
    .mob-fov-btn:active { background: rgba(255,255,255,0.15); }
    .mob-fov-btn.help-on {
        background: rgba(96, 165, 250, 0.25);
        color: #60a5fa;
    }
    .mob-fov-done {
        border-left: 1px solid rgba(255,255,255,0.15);
        color: #4ade80;
    }
    .mob-fov-label {
        font-size: 9px;
        font-weight: 600;
        letter-spacing: 0.3px;
        line-height: 1;
        white-space: nowrap;
    }


@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar-left,
    .sidebar-right {
        width: 220px;
    }
}
