body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f9;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
}

header p {
    margin: 5px 0 0;
    font-size: 1.1rem;
    opacity: 0.8;
}

main {
    display: flex;
    flex: 1;
    padding: 20px;
    gap: 20px;
}

.sidebar {
    flex: 0 0 250px;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.sidebar h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.tool-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tool-button {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-decoration: none;
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.tool-button:hover:not(.disabled) {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tool-button i {
    font-size: 1.5rem;
    color: #007bff;
    width: 30px;
    text-align: center;
}

.tool-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.main-content {
    flex: 1;
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.main-content h3 {
    color: #2c3e50;
    font-size: 1.8rem;
}

.main-content p {
    line-height: 1.6;
    color: #555;
}

footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 10px;
    margin-top: auto;
}

#progressOverlay, #popupOverlay, #mapOverlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    color: white;
}
#progressOverlay { flex-direction: column; font-size: 1.2rem; }
#progressBarContainer { width: 300px; background-color: #555; border-radius: 5px; overflow: hidden; margin-top: 15px; }
#progressBar { height: 25px; width: 0%; background-color: #28a745; text-align: center; line-height: 25px; color: white; transition: width 0.3s ease-in-out; }
#progressText { margin-top: 10px; }
#analysePopup {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    width: 75vw;
    height: 75vh;
    max-width: 1800px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.popup-column {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.column-subtitle {
    margin-top: 0; margin-bottom: 10px; color: #495057; font-size: 1rem;
    border-bottom: 1px solid #e9ecef; padding-bottom: 8px;
}
#popupMap {
    width: 100%; height: 100%; min-height: 300px; border-radius: 6px;
}
#popupButtons {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}
#popupFormContainer { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
#popupMapContainer { flex: 1; display: flex; }
#mapPopup { max-width: 1200px; height: 90vh; width: 100%; position: relative; display: flex; flex-direction: column; background:white; padding:20px; border-radius:8px; }
#feldContainer { margin-bottom: 15px; }
.flex-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; min-height: 32px; }
.flex-row select, .flex-row input { flex: 1 1 auto; width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
.flex-row select:first-child,
.flex-row > label {
  flex: 0 0 180px;
  width: 180px;
}

.main-layout-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.layout-column-main, .layout-column-sidebar {
    flex: 1;
    display: flex;
}
.control-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100%;
    display: flex;
    flex-direction: column;
}

.input-container { width: 100%; }
.file-input-wrapper { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; }
#fileNameDisplay { font-style: italic; color: #6c757d; }
textarea#textfeld {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    resize: vertical;
}
#analyseBtn { display: block; }

.sidebar-heading, .dashboard-title, .dashboard-subtitle {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1rem;
    color: #495057;
    font-weight: 600;
    border-bottom: 2px solid #f0f4f8;
    padding-bottom: 10px;
}
.accordion-container { margin-top: 15px; }
.accordion-button {
    background-color: #f1f3f5; color: #495057; cursor: pointer; padding: 12px 18px; width: 100%;
    border: none; border-bottom: 1px solid #dee2e6; text-align: left; outline: none;
    font-size: 1rem; font-weight: 600; transition: background-color 0.2s;
}
.accordion-button:hover, .accordion-button.active { background-color: #e9ecef; }
.accordion-button::after { content: '▼'; font-size: 0.8em; float: right; transition: transform 0.2s ease-in-out; }
.accordion-button.active::after { transform: rotate(180deg); }
.accordion-panel { padding: 15px; background-color: white; display: none; overflow: hidden; border-bottom: 1px solid #dee2e6; display: flex; flex-wrap: wrap; gap: 12px; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.stat-item { background-color: #f8f9fa; padding: 15px; border-radius: 6px; text-align: center; }
.stat-label { display: block; font-size: 0.85em; color: #6c757d; margin-bottom: 8px; }
.stat-value { display: block; font-size: 1.6em; font-weight: 600; color: #343a40; }
.top-list-container { margin-top: 20px; border-top: 2px solid #f0f4f8; padding-top: 15px; }
.top-list { list-style: none; padding-left: 0; margin: 0; }
.top-list li { display: flex; justify-content: space-between; padding: 8px 5px; border-bottom: 1px solid #f1f3f5; font-size: 0.9em; }
.top-list li:last-child { border-bottom: none; }
.list-item-count { font-weight: bold; background-color: #e9ecef; padding: 2px 6px; border-radius: 4px; color: #495057; }

.table-wrapper { margin-top: 20px; }
.table-header-controls { display: flex; gap: 20px; padding: 15px; background-color: #ffffff; border-radius: 8px 8px 0 0; border: 1px solid #dee2e6; border-bottom: none; }
.filter-controls,.search-control, .column-selector-control { flex: 1 ; position: relative; }
#tabellenSuchfeld { width: 100%; padding: 12px 18px 12px 35px; border: 1px solid #dee2e6; font-size: 0.95rem; color: #495057; box-sizing: border-box; }
#tabellenSuchfeld:focus { outline: none; border-color: #007bff; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #868e96; }
.table-container { 
    overflow-y: auto;
    max-height: 660px; 
    border-radius: 0 0 8px 8px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
    border: 1px solid #dee2e6; 
    border-top: none;
    min-height: 660px;
}
table { 
    border-collapse: collapse;
    width: 100%; 
    font-size: 0.9rem; 
}
thead {
    position: sticky;
    top: 0;
    z-index: 10;
    overflow: visible;
}
thead th { 
    background-color: #f8f9fa;
    font-weight: 600; 
    border-bottom: 2px solid #dee2e6;
}
th, td { 
    padding: 12px 15px; 
    text-align: left; 
    vertical-align: middle; 
    border: none; 
    border-bottom: 1px solid #e9ecef; 
    white-space: nowrap; 
}
tbody tr:nth-child(even) { background-color: #f8f9fa; }
tbody tr:hover { background-color: #e9ecef; }
td.actions { display: flex; align-items: center; }
td.actions i { margin: 0 6px; cursor: pointer; color: #6c757d; transition: color 0.2s, transform 0.2s; }
td.actions i:hover { color: #343a40; transform: scale(1.1); }
th.sortable { cursor: pointer; position: relative; padding-right: 45px; }
th.sortable::after { content: ''; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 0.8em; }
th.sortable.asc::after { content: '▲'; }
th.sortable.desc::after { content: '▼'; }
i.geprueft-status-icon.is-geprueft { color: #28a745 !important; }
tr.is-duplicate { background-color: #fff3cd !important; }

.icon-button { 
    display: inline-flex; align-items: center; gap: 8px; background-color: #f1f3f5; color: #495057; 
    border: 1px solid #dee2e6; cursor: pointer; padding: 8px 16px; border-radius: 6px; 
    font-size: 0.95rem; transition: all 0.2s ease-in-out; 
}
.icon-button:hover { 
    background-color: #e9ecef; border-color: #adb5bd; transform: translateY(-2px); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
}
.action-button {
    display: inline-flex; align-items: center; gap: 8px; background-color: #007bff; color: white;
    border: 1px solid #007bff; cursor: pointer; padding: 8px 16px; border-radius: 6px;
    font-size: 0.95rem; transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
    min-height: 44px; box-sizing: border-box;
}
.action-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
#popupTitle { color: #2c3e50; }

.column-selector-dropdown {
    display: none;
    position: absolute; top: 110%; right: 0; width: 280px;
    background-color: white; border: 1px solid #ccc; box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1000; padding: 15px; max-height: 400px; overflow-y: auto;
    flex-direction: column;
}
.column-selector-dropdown.is-open {
    display: flex;
}

.choice-card.is-selected { border: 2px solid #007bff; background-color: #e9f5ff !important; }
.google-choice-container.is-disabled .choice-card:not(.is-selected) { opacity: 0.5; background-color: #f8f9fa !important; cursor: not-allowed; }
.suggestion-container { position: relative; display: inline-flex; margin-left: 8px; vertical-align: middle; }
.suggestion-inline-dialog {
    display: flex; align-items: center; gap: 8px; font-size: 0.85em;
    background-color: #fffbe6; border: 1px solid #ffeeba; padding: 4px 8px; border-radius: 15px;
}
.suggestion-inline-dialog i { color: #f0ad4e; }
.suggestion-inline-dialog span strong { color: #856404; font-weight: 600; }
.suggestion-inline-dialog .apply-btn, .suggestion-inline-dialog .cancel-btn {
    padding: 2px 8px; border-radius: 10px; cursor: pointer;
    border: 1px solid #ccc; background-color: white; font-size: 0.9em;
}
.suggestion-inline-dialog .apply-btn { background-color: #28a745; color: white; border-color: #28a745; }

#logoContainer { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; }
#logoPreview {
    display: block; max-width: 100%; max-height: 250px; aspect-ratio: 1 / 1; object-fit: cover;
    background-color: #e9ecef; border: 2px dashed #ccc; border-radius: 8px; box-sizing: border-box;
}
#logoPreview:not([src]), #logoPreview[src=""] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23868e96'%3e%3cpath d='M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: center; background-size: 40%;
}
#deleteLogoBtn { margin-top: 10px; }

.th-filterable { position: relative; overflow: visible; }
.th-filterable .filter-icon {
    position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
    color: #adb5bd; cursor: pointer; transition: color 0.2s;
}
.th-filterable:hover .filter-icon { color: #343a40; }
.th-filterable.active .filter-icon { color: #007bff !important; }
.filter-dropdown {
    display: none; position: absolute; top: 100%; left: 0; min-width: 250px;
    background-color: white; border: 1px solid #ccc; box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1100;
    padding: 10px; max-height: 300px; overflow-y: auto; text-align: left;
}
.filter-dropdown-content { display: flex; flex-direction: column; }
.filter-dropdown-content label { display: block; margin-bottom: 5px; font-weight: normal; cursor: pointer; white-space: nowrap; }
.filter-dropdown-actions { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid #eee; }

#toast-container {
    position: fixed; bottom: 20px; right: 20px; z-index: 10001;
    display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.toast {
    padding: 15px 20px; border-radius: 6px; color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); opacity: 0; transform: translateX(100%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.success { background-color: #28a745; }
.toast.error { background-color: #dc3545; }
.toast.info { background-color: #17a2b8; }

.map-toggle-container {
    position: absolute;
    bottom: 15px;
    left: 15px;
    z-index: 9999;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    font-weight: 600;
    color: #333;
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}
input:checked + .slider {
    background-color: #007bff;
}
input:checked + .slider:before {
    transform: translateX(22px);
}
.slider.round {
    border-radius: 28px;
}
.slider.round:before {
    border-radius: 50%;
}
.is-confident-match {
    background-color: #e6ffed !important;
    border-color: #28a745 !important;
}

.suggestion-banner {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background-color: #fffbe6;
    border: 1px solid #ffeeba;
    border-radius: 6px;
    margin-bottom: 15px;
}
.suggestion-banner .action-button {
    flex-shrink: 0;
}
td {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}