/* TTiles Routes Manager - Design synchronisiert mit index.html */

/* Basis-Variablen (identisch mit index.html/styles.css) */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-hover: #818cf8;
    --secondary: #64748b;
    --secondary-hover: #475569;
    --success: #10b981;
    --success-hover: #059669;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --info: #06b6d4;
    --info-hover: #0891b2;
    --light: #f8fafc;
    --dark: #1e293b;
    
    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-sidebar: #1e293b;
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #f8fafc;
    
    /* Borders & Effects */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Entity-spezifische Farben (von index.html) */
    --basis-route-bg: #f0fdf4;
    --basis-route-border: #22c55e;
    --basis-route-text: #15803d;
    --basis-route-hover: #dcfce7;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout Container */
.routes-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar (gleich wie index.html) */
.routes-sidebar {
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
}

.sidebar-header h3 {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Tabs (wie index.html Filter-Tabs) */
.route-tabs {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding: 0 2px;
}

.route-tab {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    color: var(--text-secondary);
}

.route-tab:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    color: var(--primary);
}

.route-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Route Liste */
.routes-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* Route List Items (Kachel-Style wie index.html) */
.route-list-item {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.route-list-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.route-list-item.active {
    background: var(--basis-route-bg);
    border-color: var(--basis-route-border);
}

.route-list-item h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.route-icon {
    font-size: 1.25rem;
}

.route-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
}

.route-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.route-meta-item i {
    font-size: 0.875rem;
    color: var(--secondary);
}

/* Main Content Area */
.main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-secondary);
}

/* Header (wie index.html) */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.header-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

/* Content Area */
.content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

/* Stats Grid (wie index.html) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Entity Cards Grid (WICHTIG: Identisch mit index.html) */
.entities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
}

/* Entity Card (Tile-Style von index.html) */
.entity-card {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 160px;
}

.entity-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Route-spezifische Kachel */
.entity-card.entity-basis-route {
    background: var(--basis-route-bg);
    border-color: var(--basis-route-border);
}

.entity-card.entity-basis-route:hover {
    background: var(--basis-route-hover);
}

.entity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.entity-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.entity-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.entity-icon {
    font-size: 1.5rem;
    opacity: 0.8;
}

/* Attributes Grid (wie index.html) */
.attributes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.attribute-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attribute-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.attribute-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Tags (wie index.html) */
.entity-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

.tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Action Buttons Container */
.entity-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* Buttons (exakt wie index.html) */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    line-height: 1;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--border);
    color: var(--text-primary);
}

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

.btn-success:hover {
    background: var(--success-hover);
    box-shadow: var(--shadow-md);
}

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

.btn-danger:hover {
    background: var(--danger-hover);
    box-shadow: var(--shadow-md);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Filter Bar (wie index.html) */
.filter-bar {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ... Fortsetzung ab Zeile 550 ... */

.filter-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Search Input (wie index.html) */
.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: var(--bg-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Modals (wie index.html) */
.modal-overlay-routes {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-routes {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
}

.modal-title-routes {
    font-size: 1.125rem;
    color: var(--text-primary);
    font-weight: 600;
}

.modal-body {
    padding: 24px;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-secondary);
}

/* Form Elements (wie index.html) */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control,
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: var(--bg-primary);
}

.form-control:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Header & Navigation */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

/* Navigation Items (Sidebar) */
.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin: 4px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-icon {
    font-size: 1.125rem;
    margin-right: 12px;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
}

/* Entity Cards (Routes) */
.entity-card {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 180px;
}

.entity-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.entity-card.selected {
    border-color: var(--primary);
    background: var(--bg-tertiary);
}

.entity-card.entity-basis-route {
    /*border-left: 4px solid var(--basis-route-border);*/
}

.entity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.entity-icon {
    font-size: 1.5rem;
    margin-right: 8px;
}

.entity-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.entity-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.entity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 12px 0;
}

.entity-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.entity-meta-item i {
    font-size: 0.875rem;
}

/* Stats */
.stats-mini {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.stat i {
    color: var(--text-secondary);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.confidence-badge {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.confidence-badge.high {
    background: var(--success);
    color: white;
}

.confidence-badge.medium {
    background: var(--warning);
    color: white;
}

.confidence-badge.low {
    background: var(--danger);
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 1rem;
    margin-bottom: 24px;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Sidebar (spezifisch) */
.sidebar {
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s ease;
    width: 320px;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed h2,
.sidebar.collapsed .stat span,
.sidebar.collapsed .nav-item span {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-secondary);
    /*padding: 24px;*/
}

/* Additional Utilities */
.text-lg { font-size: 1.125rem; }
.font-bold { font-weight: 600; }
.mb-4 { margin-bottom: 16px; }

/* Responsive */
@media (max-width: 1024px) {
    .routes-container {
        grid-template-columns: 280px 1fr;
    }
    
    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 768px) {
    .routes-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
}


.nav-badge {
    display: inline-block;
    padding: 2px 6px;
    margin-left: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.nav-badge.warning {
    background-color: var(--warning);
    color: white;
}
.nav-badge.success {
    background-color: var(--success);
    color: white;
}

/* Enhanced Route Manager Styles */

/* Tab Navigation */
.nav-tabs {
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    display: flex;
    gap: 0;
}

.nav-item {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    background: none;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
}

/* Form Enhancements */
.form-range {
    width: 100%;
    height: 6px;
    padding: 0;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-range::-webkit-slider-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

/* JSON Array Editor */
.json-array-editor {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.json-array-editor input {
    flex: 1;
}

/* Validation Messages */
.validation-status {
    width: 100%;
    margin-bottom: 16px;
}

.validation-status .alert {
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.validation-status .alert ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

/* Enhanced Form Groups */
.form-group {
    margin-bottom: 16px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    user-select: none;
}

/* Section Headers */
h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 16px 0;
}

h5 {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    margin: 16px 0 8px 0;
}

/* Grid Layouts */
.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Modal Improvements */
.modal-routes {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-body-routes {
    flex: 1;
    overflow-y: auto;
    padding: 50px;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 16px 20px;
    background: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Completeness Indicator */
.completeness-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.completeness-badge.low {
    background: var(--danger-hover);
    color: white;
}

.completeness-badge.medium {
    background: var(--warning);
    color: var(--text-primary);
}

.completeness-badge.high {
    background: var(--success);
    color: white;
}

/* Loading States */
.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg-tertiary);
}

/* ... Fortsetzung von routes-manager.css ... */

/* Attributes Grid (wie index.html) */
.attributes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.attribute-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attribute-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.attribute-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 1rem;
    margin-bottom: 24px;
}

/* Loading States */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
    transition: opacity 0.3s ease;
}

.toast-success {
    border-color: var(--success);
    color: var(--success);
}

.toast-error {
    border-color: var(--danger);
    color: var(--danger);
}

.toast-warning {
    border-color: var(--warning);
    color: var(--warning);
}

.toast-info {
    border-color: var(--info);
    color: var(--info);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .routes-container {
        grid-template-columns: 280px 1fr;
    }
    
    .entities-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 768px) {
    .routes-container {
        grid-template-columns: 1fr;
    }
    
    .routes-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .routes-sidebar.mobile-open {
        left: 0;
    }
    
    .entities-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-wrap: wrap;
    }
}

/* Utility Classes */
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }

.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-tertiary { background-color: var(--bg-tertiary); }

.border { border: 1px solid var(--border); }
.border-primary { border-color: var(--primary); }
.border-success { border-color: var(--success); }
.border-danger { border-color: var(--danger); }

.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Flexbox Utilities */
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* Spacing Utilities */
.m-0 { margin: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.font-weight-bold { font-weight: 600; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }

/* Visibility */
.d-none { display: none; }
.invisible { visibility: hidden; }
.opacity-50 { opacity: 0.5; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* Transitions */
.transition-all { transition: all 0.3s ease; }
.transition-colors { transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease; }

/* Z-Index */
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Sidebar Collapsed State */
.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .filter-label,
.sidebar.collapsed .form-input {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
}

/* Additional Route-specific Styles */
.route-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.route-badge.type-wanderung {
    background: #dbeafe;
    color: #1e40af;
}

.route-badge.type-fahrrad {
    background: #fef3c7;
    color: #92400e;
}

.route-badge.type-auto {
    background: #e0e7ff;
    color: #3730a3;
}

/* Import Progress Modal */
.import-progress {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.import-progress-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bulk-actions-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--primary);
}

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

/* Auswahl-Indikator */
.entity-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.selection-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    color: var(--primary);
    font-size: 24px;
    z-index: 10;
}

/* Attribute Anzeige */
.entity-attributes {
    margin-top: 8px;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

.attribute-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    color: var(--success);
}

/* Hat Attribute */
.entity-card.has-attributes {
    border-left: 4px solid var(--success);
}

/* Standard: Graue Kacheln (keine/wenige Attribute) */
.entity-card {
    background: white;
    border: 2px solid #22c55e;
    transition: all 0.3s ease;
}

/* Kacheln mit Attributen: Grün */
.entity-card.has-attributes {
    background: #f0fdf4; /* Sehr helles Grün */
    border: 2px solid #16a34a; /* Dunkleres Grün */
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.1);
}

/* Verschiedene Stufen basierend auf Attribut-Anzahl */
.entity-card.attributes-partial {
    background: #fffbeb;
    border: 2px solid #f59e0b;
}

.entity-card.attributes-complete {
    background: #f0fdf4;
    border: 2px solid #16a34a;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15);
}

/* Hover-Effekte */
.entity-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}

.entity-card.has-attributes:hover {
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

/* Fortschritts-Indikator */
.attribute-progress {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: conic-gradient(#22c55e var(--progress), #e0e0e0 0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.attribute-progress::before {
    content: '';
    position: absolute;
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    z-index: 0;
}

.attribute-progress span {
    position: relative;
    z-index: 1;
}

.entity-card {
    background: var(--bg-primary);
    border: 2px solid var(--border);
}

/* NACHHER */
/* Standard: Grüner Rahmen, weißer Hintergrund */
.entity-card {
    background: white;
    border: 2px solid #22c55e;
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 180px;
}

/* Mit Attributen: Grüner Rahmen + grüne Tönung */
.entity-card.has-attributes {
    background: #f0fdf4; /* Helles Grün */
    border: 2px solid #16a34a; /* Dunkleres Grün */
}
/* Ende der CSS-Datei */