/* --- 3. TABELLEN --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    margin-bottom: 20px;
}
th, td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}
th {
    background-color: #f2f2f2;
    font-weight: bold;
}
/* Jede zweite Zeile etwas dunkler (Zebra-Look) */
tr:nth-child(even) {
    background-color: #f9f9f9;
}
tr:hover {
    background-color: #e9ecef; /* Highlight beim Drüberfahren */
}

/* ---------------------------------------------------
   PIVOT TABELLE (Dividenden Matrix)
   --------------------------------------------------- */
.pivot-table { 
    table-layout: fixed; 
    width: 100%; 
}

.pivot-table th, .pivot-table td { 
    padding: 8px 6px; 
    font-size: 0.9em; 
    white-space: nowrap; 
}

/* 1. Spalte (Namen) auf 20% Breite */
.pivot-table th:first-child, .pivot-table td:first-child { 
    width: 20%; 
    max-width: 250px; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

/* Spaltenköpfe (Jahre oben) zwingend fett! */
.pivot-table thead th {
    font-weight: bold !important;
    color: #333;
}

/* Fußzeile (Grauer Balken unten) zwingend fett! */
.pivot-table tfoot th { 
    background-color: #e9ecef; 
    font-weight: bold !important; 
    color: #333; 
    border-top: 2px solid #ccc; 
}

/* Das Wort "Gesamt" unten nach rechts an die Zahlen schieben */
.pivot-table tfoot th:first-child { 
    text-align: right !important; 
    padding-right: 15px; 
}

/* Alle Zellen mit Werten zwingend rechtsbündig */
.pivot-table th.pivot-val, 
.pivot-table td.pivot-val { 
    text-align: right !important; 
}

/* Leere Jahre (-) rechtsbündig & unauffällig */
.pivot-null { 
    text-align: right !important; 
    color: #ccc; 
}


/* --- 4. FORMULARE --- */
input[type="text"], 
input[type="password"], 
input[type="number"], 
input[type="date"], 
select, 
textarea {
    padding: 10px;
    margin: 5px 0 15px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Padding zählt zur Breite dazu */
    width: 100%; /* Standardmäßig volle Breite, kann überschrieben werden */
}
/* Ausnahme für nebeneinanderliegende Felder */
form select, form input {
    width: auto; 
    min-width: 200px;
}

input[type="submit"] {
    background-color: #28a745; /* Grün */
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}
input[type="submit"]:hover {
    background-color: #218838;
}

.form-box { background-color: #f8f9fa; padding: 20px; border: 1px solid #ddd; border-radius: 5px; margin-bottom: 20px; }

/* Kacheln und Grids */
.stats-grid { display: flex; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.stat-box { flex: 1; min-width: 200px; background: #28a745; color: white; padding: 20px; border-radius: 8px; text-align: center; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.stat-box.highlight { background: #6f42c1; } 
.stat-box h3 { margin: 0 0 10px 0; font-size: 1em; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-box .value { font-size: 2em; font-weight: bold; }
.chart-container { background: #fff; padding: 20px; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 30px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); overflow-x: auto; }


/*Utilities und kleine Helferklassen */
.error { color: #dc3545; font-weight: bold; }   /* Rot */
.success { color: #28a745; font-weight: bold; } /* Grün */

.typ-kauf { color: green; font-weight: bold; }
.typ-verkauf { color: red; font-weight: bold; }
.typ-dividende { color: blue; font-weight: bold; }

.text-right { text-align: right; }


/* ---------------------------------------------------
   ZARTE & MODERNE DATENTABELLE (Universal)
   --------------------------------------------------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.9em; /* Etwas kleinere, elegantere Schrift */
    color: #444;      /* Weiches Dunkelgrau statt hartem Schwarz */
    box-shadow: 0 1px 4px rgba(0,0,0,0.05); /* Sehr sanfter Schatten */
    border-radius: 6px;
    overflow: hidden; /* Damit die runden Ecken wirken */
}

.data-table th {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
    color: #666;
    font-weight: 600;
    background-color: #fdfdfd; /* Fast weiß, nur ein Hauch von Grau */
    white-space: nowrap;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f2f2f2; /* Extrem zarte, kaum sichtbare Linie */
    vertical-align: middle;
}

/* Letzte Linie entfernen, sieht sauberer aus */
.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Leichter Hover-Effekt für die Zeilen */
.data-table tbody tr:hover {
    background-color: #fafafa;
}

/* Container für Formulare */
.form-box {
    background-color: #f8f9fa;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* --- PORTAL & LOGIN KOMPONENTEN --- */
.private-beta-banner { background-color: var(--warning-bg); color: var(--warning-text); text-align: center; padding: 12px 20px; font-size: 0.9em; font-weight: 600; border-bottom: 1px solid #ffeeba; position: relative; z-index: 100; line-height: 1.4; }
.badge { display: inline-block; background: rgba(40, 167, 69, 0.1); color: var(--success); padding: 5px 15px; border-radius: 20px; font-weight: 800; font-size: 0.85em; margin-bottom: 15px; letter-spacing: 1px; text-transform: uppercase; }
.error-msg { background: var(--error-bg); color: var(--error-text); padding: 12px; border-radius: 6px; margin-bottom: 20px; font-size: 0.9em; font-weight: 600; line-height: 1.4; }

/* Login Formular Felder */
.input-group { margin-bottom: 15px; text-align: left; }
.input-group label { display: block; font-size: 0.85em; font-weight: 600; margin-bottom: 5px; color: var(--dark); }
.input-group input { width: 100%; padding: 12px 15px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 1em; transition: 0.2s; }
.input-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2); }

/* Login Button */
.btn-login { width: 100%; padding: 14px; background: var(--primary); color: white; border: none; border-radius: 6px; font-size: 1.1em; font-weight: 600; cursor: pointer; transition: 0.2s; margin-top: 10px; display: inline-block; box-sizing: border-box; }
.btn-login:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ==========================================================================
   5. SPEZIELLE UI-KOMPONENTEN (Badges, Progress, Tabs)
   ========================================================================== */

/* --- Logos --- */
.logo-img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid #eee; background: #fff; vertical-align: middle; }
.logo-placeholder { width: 30px; height: 30px; border-radius: 50%; background: #007bff; color: white; display: inline-flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; vertical-align: middle; }

/* --- Progress Bars --- */
.progress-container { width: 100%; background-color: #e9ecef; border-radius: 5px; height: 25px; margin-top: 15px; overflow: hidden; display: flex; }
.progress-bar { height: 100%; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 0.8em; transition: width 0.3s; }
.bg-invest { background-color: #007bff; }
.bg-cash { background-color: #28a745; }
.bg-error { background-color: #dc3545; }

/* --- Badges (Kaufen/Verkaufen) --- */
.badge { padding: 5px 10px; border-radius: 4px; font-weight: bold; font-size: 0.85em; display: inline-block; min-width: 120px; text-align: center; }
.badge-kauf { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.badge-verkauf { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.badge-ok { background: #e2e3e5; color: #383d41; border: 1px solid #d6d8db; }
.badge-stueck { display: block; font-size: 0.85em; font-weight: normal; opacity: 0.8; margin-top: 2px; }

/* --- Tabellen für Rebalancing --- */
.table-reb th, .table-reb td { padding: 12px; border-bottom: 1px solid #eee; }
.table-reb th { background: #f8f9fa; font-size: 0.9em; text-transform: uppercase; color: #666; }

/* --- Navigation Tabs --- */
.view-tabs { display: flex; gap: 10px; margin-bottom: 25px; border-bottom: 2px solid #eee; padding-bottom: 15px; }
.view-tab { text-decoration: none; padding: 8px 20px; border-radius: 20px; font-weight: bold; color: #555; background: #f8f9fa; border: 1px solid #ddd; transition: 0.2s; }
.view-tab:hover { background: #e9ecef; }
.view-tab.active { background: #007bff; color: white; border-color: #007bff; box-shadow: 0 2px 5px rgba(0,123,255,0.3); }

/* --- Eingabefelder Extras --- */
.input-prozent { width: 80px; padding: 6px; border: 1px solid #ccc; border-radius: 4px; text-align: right; font-weight: bold; }

/* ==========================================================================
   6. DIVIDENDEN & CHARTS (Filter, Slider, Heatmap, FIRE)
   ========================================================================== */

/* --- Filter Buttons für Chart --- */
.filter-bar { margin-bottom: 15px; display: flex; gap: 10px; }
.filter-btn { background: #f1f1f1; border: 1px solid #ccc; padding: 6px 15px; border-radius: 20px; cursor: pointer; font-weight: bold; color: #555; transition: 0.2s; }
.filter-btn:hover { background: #e2e2e2; }
.filter-btn.active { background: #007bff; color: white; border-color: #007bff; }

/* --- Slider & Datumseingabe --- */
.noUi-connect { background: #28a745; }
.noUi-handle { border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.2); cursor: grab; }
.noUi-handle:active { cursor: grabbing; }
.date-input { padding: 5px 10px; border: 1px solid #ced4da; border-radius: 4px; font-size: 0.9em; color: #495057; font-weight: bold; font-family: inherit; cursor: pointer; background: #f8f9fa; }

/* --- Heatmap Styles --- */
.pivot-table td, .pivot-table th { padding: 6px 10px; border-bottom: 1px solid #eee; text-align: right; font-size: 0.85em; }
.pivot-table th:first-child, .pivot-table td:first-child { text-align: left; font-size: 0.9em; }
.heatmap-cell { font-weight: bold; color: #333; transition: background 0.3s; border-radius: 4px; }
.heatmap-cell:hover { filter: brightness(0.95); cursor: default; }

/* --- FIRE Rechner Styles --- */
.fire-container { display: flex; flex-wrap: wrap; gap: 30px; }
.fire-form { flex: 1; min-width: 300px; background: #f8f9fa; padding: 20px; border-radius: 8px; border: 1px solid #e9ecef; }
.fire-result { flex: 1.5; min-width: 350px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; background: linear-gradient(135deg, #2b5876 0%, #4e4376 100%); color: white; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.fire-input-group { margin-bottom: 15px; }
.fire-input-group label { display: block; font-size: 0.9em; font-weight: bold; color: #555; margin-bottom: 5px; }
.fire-input-group input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 1em; box-sizing: border-box; }
.fire-big-text { font-size: 3em; font-weight: bold; margin: 10px 0; text-shadow: 1px 1px 2px rgba(0,0,0,0.2); }
.fire-small-text { font-size: 1.1em; opacity: 0.9; }


/* --- Spezifische Helfer für Strategie & Dividenden --- */
.border-top-primary { border-top: 4px solid #007bff !important; }
.border-top-success { border-top: 4px solid #28a745 !important; }
.flex-15 { flex: 1.5 !important; }
.badge-gray { background: #e9ecef; padding: 5px 10px; border-radius: 15px; color: #555; }
.alert-success { color: #155724; font-weight: bold; background: #d4edda; padding: 10px; border-radius: 5px; border: 1px solid #c3e6cb; }
.btn-primary { background: #007bff; color: white; border: none; border-radius: 4px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.btn-primary:hover { background: #0056b3; }

/* Gradients für Dividenden-Boxen */
.bg-gradient-orange { background: linear-gradient(135deg, #f39c12, #e67e22) !important; }
.bg-gradient-cyan { background: linear-gradient(135deg, #17a2b8, #138496) !important; }
.bg-gradient-green { background: linear-gradient(135deg, #28a745, #218838) !important; }
.bg-gradient-blue { background: linear-gradient(135deg, #007bff, #0056b3) !important; }

/* Chart Wrapper */
.chart-wrapper { position: relative; height: 350px; width: 100%; }
.slider-wrapper { padding: 20px 15px 10px 15px; margin-top: 10px; }


/* ==========================================================================
   7. BUCHUNGS-KOMPONENTEN (Filter, Formulare, Modals, Pagination)
   ========================================================================== */

/* --- Filter Bar --- */
.filter-box { background: #f8f9fa; padding: 15px; border-radius: 8px; border: 1px solid #ddd; margin: 20px 0; display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.filter-select { padding: 8px; font-size: 16px; border-radius: 4px; border: 1px solid #ccc; min-width: 150px; }

/* --- Action Buttons (Kleine Buttons in der Tabelle) --- */
.action-btn { text-decoration: none; padding: 4px 8px; border-radius: 4px; font-weight: bold; display: inline-block; border: none; cursor: pointer; }
.btn-edit { background: #ffc107; color: #333; }
.btn-delete { background: #dc3545; color: white; }

/* --- Standard Buttons (Grün, Rot, Gelb) --- */
.btn-success { padding: 12px 25px; background: #28a745; color: white; font-weight:bold; font-size: 1em; border: none; cursor: pointer; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: 0.2s; }
.btn-success:hover { background: #218838; }
.btn-danger { background: #dc3545; color: white; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; transition: 0.2s; }
.btn-danger:hover { background: #c82333; }
.btn-warning { padding: 12px 25px; background: #ffc107; color: #333; font-weight:bold; font-size: 1em; border: none; cursor: pointer; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: 0.2s; }
.btn-warning:hover { background: #e0a800; }

/* --- Details Box (Akkordeon) --- */
details summary::-webkit-details-marker { display: none; }
details > summary { list-style: none; }
.details-summary { cursor:pointer; background:#fff; padding:15px; border-radius:5px; font-weight:bold; border: 1px solid #ddd; font-size: 1.1em; color: #007bff; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.details-content { margin-top: 15px; padding: 20px; border: 1px solid #ddd; border-radius: 5px; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }

/* --- Grid Formulare --- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; font-size: 0.85em; color: #555; text-transform: uppercase; }
.form-group input, .form-group select { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-family: inherit; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #007bff; box-shadow: 0 0 0 2px rgba(0,123,255,0.25); }

/* --- Zusammenfassung (KPIs) --- */
.summary-box { background: #fff; padding: 20px; border-radius: 8px; margin-bottom: 20px; border: 1px solid #ddd; box-shadow: 0 2px 4px rgba(0,0,0,0.02); display: flex; gap: 40px; }
.summary-title { color: #666; font-size: 0.85em; text-transform: uppercase; font-weight: bold; letter-spacing: 0.5px; }
.summary-value { font-size: 1.6em; font-weight: bold; color: #333; margin-top: 5px; }

/* --- Pagination --- */
.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 20px; padding: 10px 0; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid #ddd; border-radius: 4px; text-decoration: none; color: #007bff; font-weight: bold; }
.pagination a:hover { background-color: #f1f1f1; }
.pagination .active { background-color: #007bff; color: white; border-color: #007bff; }
.pagination .dots { border: none; padding: 8px 5px; color: #888; }
.pagination-info { text-align: center; color: #666; font-size: 0.9em; margin-bottom: 10px; }

/* --- Tabellen Container & Modal --- */
.table-container { overflow-x: auto; background: white; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); padding: 15px; }
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); backdrop-filter: blur(3px); }
.modal-content { background-color: #fefefe; margin: 5% auto; padding: 25px; border: 1px solid #888; width: 90%; max-width: 650px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); position: relative; animation: slideDown 0.3s ease-out; }
.close { color: #aaa; position: absolute; right: 20px; top: 15px; font-size: 28px; font-weight: bold; cursor: pointer; line-height: 1; }
.close:hover { color: #dc3545; }
@keyframes slideDown { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }


/* ==========================================================================
   8. IMPORT-KOMPONENTEN
   ========================================================================== */

/* --- Import Card --- */
.import-card { border-left: 5px solid #007bff; margin-bottom: 30px; padding: 15px; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.1); border-radius: 5px; }

/* --- KI Info Box --- */
.ai-notice-box { background-color: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; padding: 15px; border-radius: 8px; margin: 20px 0; font-size: 0.9em; line-height: 1.5; display: flex; align-items: flex-start; gap: 15px; }
.ai-notice-icon { font-size: 1.5em; }

/* --- Großer Speicher-Button --- */
.btn-large { display: block; width: 100%; background-color: #28a745; color: white; padding: 15px; font-size: 1.2em; border: none; border-radius: 5px; cursor: pointer; text-align: center; font-weight: bold; margin: 20px 0; transition: 0.2s; }
.btn-large:hover { background-color: #218838; }

/* --- Zusätzliche Komponenten für Konten --- */
.btn-locked { background: #e9ecef; color: #aaa; cursor: not-allowed; }
.alert-danger { color: #721c24; font-weight: bold; background: #f8d7da; padding: 10px; border-radius: 5px; border: 1px solid #f5c6cb; }

/* --- Spezifische Badges für Währungen --- */
.badge-basis { background: #28a745; color: white; padding: 3px 8px; border-radius: 12px; font-size: 0.8em; font-weight: bold; }
.badge-fremd { background: #6c757d; color: white; padding: 3px 8px; border-radius: 12px; font-size: 0.8em; font-weight: bold; }

/* --- Filter Toggle (Wertpapiere) --- */
.filter-toggle { display: inline-flex; background: #f8f9fa; border: 1px solid #ccc; border-radius: 20px; overflow: hidden; }
.filter-toggle a { padding: 8px 15px; text-decoration: none; color: #555; font-size: 0.9em; font-weight: bold; transition: 0.2s; }
.filter-toggle a.active { background: #007bff; color: white; }
.filter-toggle a:not(.active):hover { background: #e9ecef; }


/* ==========================================================================
   9. KURS-MENU KOMPONENTEN
   ========================================================================== */

/* --- Dashboard Grid & Cards --- */
.dashboard-grid { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 20px; }
.dashboard-card { flex: 1; min-width: 400px; background: #fff; padding: 20px; border-radius: 8px; border: 1px solid #ddd; }

/* --- Breite Update-Buttons --- */
.update-btn { display: inline-block; width: 100%; text-align: center; padding: 10px 0; margin-bottom: 15px; border-radius: 5px; text-decoration: none; font-weight: bold; color: white; border: none; cursor: pointer; transition: 0.2s; box-sizing: border-box; }
.btn-blue { background-color: #007bff; }
.btn-blue:hover { background-color: #0056b3; }
.btn-green-dark { background-color: #28a745; }
.btn-green-dark:hover { background-color: #1e7e34; }
.btn-purple { background-color: #6f42c1; box-shadow: 0 4px 6px rgba(111, 66, 193, 0.3); }
.btn-purple:hover { background-color: #59339d; transform: translateY(-2px); }
.btn-light { background-color: #e9ecef; color: #333; border: 1px solid #ccc; font-size: 0.9em; padding: 6px 12px; }
.btn-light:hover { background-color: #d3d9df; }

/* --- Badges & Container --- */
.badge-warn { background: #ffc107; color: #000; padding: 2px 5px; border-radius: 4px; font-size: 0.8em; }
.badge-new { background: #dc3545; color: white; padding: 3px 8px; border-radius: 12px; font-size: 0.8em; margin-left: 10px; }
.table-scroll-container { max-height: 400px; overflow-y: auto; border: 1px solid #eee; border-radius: 4px; margin-top: 10px; }

/* ==========================================================================
   10. SPLIT KOMPONENTEN
   ========================================================================== */
.ratio-input { width: 80px; text-align: center; font-size: 1.2em; font-weight: bold; padding: 10px; border: 1px solid #ccc; border-radius: 4px; }

/* ==========================================================================
   11. ADMIN & EINLADUNGEN
   ========================================================================== */
.code-text { font-family: monospace; font-size: 1.1em; background: #f8f9fa; padding: 4px 8px; border-radius: 4px; border: 1px dashed #ccc; letter-spacing: 1px; color: #333; }
.badge-green { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; padding: 4px 8px; border-radius: 12px; font-size: 0.8em; font-weight: bold; }
.badge-gray { background: #e2e3e5; color: #383d41; border: 1px solid #d6d8db; padding: 4px 8px; border-radius: 12px; font-size: 0.8em; font-weight: bold; }

/* ==========================================================================
   12. ACCOUNT / EINSTELLUNGEN
   ========================================================================== */
.settings-box { background: white; padding: 30px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid #e2e8f0; }
.settings-box h3 { margin-top: 0; color: #0f172a; border-bottom: 2px solid #007bff; padding-bottom: 10px; margin-bottom: 25px; font-size: 1.3em; }
.settings-box.danger-box { background-color: #fffafb; }
.settings-box.danger-box h3 { border-bottom-color: #dc3545; }

/* ==========================================================================
   13. RECHTLICHES (Impressum, Datenschutz)
   ========================================================================== */
.legal-wrapper { background: #ffffff; padding: 40px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); color: #0f172a; line-height: 1.7; }
.legal-wrapper h1 { font-size: 2.2em; margin-top: 0; margin-bottom: 30px; color: #0f172a; }
.legal-wrapper h2 { font-size: 1.4em; margin-top: 30px; margin-bottom: 15px; color: #007bff; }
.legal-wrapper h3 { font-size: 1.1em; margin-top: 20px; margin-bottom: 10px; color: #0f172a; }
.legal-wrapper p { margin-top: 0; margin-bottom: 15px; color: #475569; }
.legal-wrapper ul { margin-left: 20px; margin-bottom: 15px; }
.legal-wrapper a { color: #007bff; text-decoration: none; transition: 0.2s; }
.legal-wrapper a:hover { text-decoration: underline; color: #0056b3; }

/* ==========================================================================
   14. DASHBOARD & KI-CHAT
   ========================================================================== */
.big-number { font-size: 1.6em; font-weight: bold; color: #333; margin: 10px 0; }
.sub-number { font-size: 0.9em; color: #666; }
.pos { color: #28a745 !important; } 
.neg { color: #dc3545 !important; } 
.neutral { color: #666 !important; }
.warnung { color: #fd7e14; font-weight: bold; }

/* --- KI Sidebar & Chat --- */
.ki-sidebar { flex: 1; min-width: 450px; max-width: 650px; background: #fff; padding: 25px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border-top: 5px solid #6f42c1; position: sticky; top: 20px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.chat-container { flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 10px; background: #f9f9f9; border-radius: 5px; margin-bottom: 15px; }
.chat-bubble { padding: 10px 14px; border-radius: 15px; max-width: 85%; font-size: 0.9em; line-height: 1.4; }
.bubble-ki { align-self: flex-start; background: #e9ecef; color: #333; border-bottom-left-radius: 2px; }
.bubble-user { align-self: flex-end; background: #6f42c1; color: white; border-bottom-right-radius: 2px; }
.chat-input-area { display: flex; gap: 5px; }
.chat-input-area input { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 4px; }

.spinner { border: 4px solid rgba(0,0,0,0.1); width: 24px; height: 24px; border-radius: 50%; border-left-color: #6f42c1; animation: spin 1s linear infinite; margin: 0 auto 10px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- Dashboard Kacheln --- */
.top-cards-container { display: flex; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.top-card-small { flex: 1; min-width: 250px; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border-top: 4px solid #6610f2; }
.top-card-large { flex: 2; min-width: 400px; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border-top: 4px solid #007bff; }
.kpi-row { display: flex; justify-content: space-between; margin-bottom: 5px; border-bottom: 1px dashed #eee; padding-bottom: 5px; }
.kpi-row:last-child { border-bottom: none; }
.banner-chart { background: #fff; padding: 25px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin-bottom: 30px; }

/* --- Filter --- */
.filter-section { background: #f8f9fa; padding: 15px 20px; border-radius: 8px; border: 1px solid #e9ecef; margin-bottom: 25px; }
.filter-group { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.filter-label { font-weight: bold; color: #555; font-size: 0.9em; text-transform: uppercase; margin-right: 5px; }
.filter-pill, .toggle-pill { padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 0.9em; font-weight: bold; transition: 0.2s; display: inline-flex; align-items: center; gap: 5px; user-select: none; }
.filter-pill { background: #fff; border: 1px solid #ced4da; color: #666; }
.filter-pill:hover { background: #e9ecef; }
.filter-pill.active { background: #007bff; color: white; border-color: #007bff; }
.filter-pill-konto.active { background: #28a745; border-color: #28a745; }
.toggle-pill { background: transparent; border: 1px dashed #adb5bd; color: #6c757d; }
.toggle-pill:hover { background: #e9ecef; color: #333; border-color: #6c757d; }

.filter-bar-chart { display: flex; gap: 10px; }
.filter-btn { background: #f1f1f1; border: 1px solid #ccc; padding: 6px 15px; border-radius: 20px; cursor: pointer; font-weight: bold; color: #555; transition: 0.2s; }
.filter-btn:hover { background: #e2e2e2; }
.filter-btn.active { background: #007bff; color: white; border-color: #007bff; }

/* --- Slider & Date --- */
.noUi-connect { background: #007bff; }
.noUi-handle { border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.2); cursor: grab; }
.noUi-handle:active { cursor: grabbing; }
.date-input { padding: 5px 10px; border: 1px solid #ced4da; border-radius: 4px; font-size: 0.9em; color: #495057; font-weight: bold; font-family: inherit; cursor: pointer; background: #f8f9fa; }
.date-input:focus { outline: none; border-color: #80bdff; background: #fff; }

/* --- Modals --- */
.modal-overlay { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(3px); }
.modal-content { background-color: #f4f7f6; margin: 3% auto; padding: 0; border-radius: 8px; width: 90%; max-width: 1000px; height: 85vh; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: slideDown 0.3s ease-out; overflow: hidden; }
.modal-header { padding: 15px 20px; background: #fff; border-bottom: 1px solid #ddd; display: flex; justify-content: space-between; align-items: center; }
.close-btn { color: #888; font-size: 28px; font-weight: bold; cursor: pointer; border: none; background: none; line-height: 1; }
.close-btn:hover { color: #dc3545; }
.modal-body { flex: 1; width: 100%; height: 100%; padding: 0; }
@keyframes slideDown { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 0; }
        .card { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border-top: 4px solid #ccc; }
        .big-number { font-size: 1.6em; font-weight: bold; color: #333; margin: 10px 0; }
        .sub-number { font-size: 0.9em; color: #666; }
        .pos { color: #28a745; } .neg { color: #dc3545; } .neutral { color: #666; }
        .logo-img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid #eee; background: #fff; }
        .logo-placeholder { width: 30px; height: 30px; border-radius: 50%; background: #007bff; color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; }
        .flex-cell { display: flex; align-items: center; gap: 12px; }
        .spinner { border: 4px solid rgba(0,0,0,0.1); width: 24px; height: 24px; border-radius: 50%; border-left-color: #6f42c1; animation: spin 1s linear infinite; margin: 0 auto 10px auto; }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
        
        .ki-sidebar { flex: 1; min-width: 450px; max-width: 650px; background: #fff; padding: 25px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border-top: 5px solid #6f42c1; position: sticky; top: 20px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
        .chat-container { flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 10px; background: #f9f9f9; border-radius: 5px; margin-bottom: 15px; }
        .chat-bubble { padding: 10px 14px; border-radius: 15px; max-width: 85%; font-size: 0.9em; line-height: 1.4; }
        .bubble-ki { align-self: flex-start; background: #e9ecef; color: #333; border-bottom-left-radius: 2px; }
        .bubble-user { align-self: flex-end; background: #6f42c1; color: white; border-bottom-right-radius: 2px; }
        .chat-input-area { display: flex; gap: 5px; }
        .chat-input-area input { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 4px; }
        .modal-overlay { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(3px); }
        .modal-content { background-color: #f4f7f6; margin: 3% auto; padding: 0; border-radius: 8px; width: 90%; max-width: 1000px; height: 85vh; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: slideDown 0.3s ease-out; overflow: hidden; }
        .modal-header { padding: 15px 20px; background: #fff; border-bottom: 1px solid #ddd; display: flex; justify-content: space-between; align-items: center; }
        .close-btn { color: #888; font-size: 28px; font-weight: bold; cursor: pointer; border: none; background: none; line-height: 1; }
        .close-btn:hover { color: #dc3545; }
        .modal-body { flex: 1; width: 100%; height: 100%; padding: 0; }
        @keyframes slideDown { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        
        .kpi-row { display: flex; justify-content: space-between; margin-bottom: 5px; border-bottom: 1px dashed #eee; padding-bottom: 5px; }
        .kpi-row:last-child { border-bottom: none; }
        .banner-chart { background: #fff; padding: 25px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin-bottom: 30px; }
        
        .filter-section { background: #f8f9fa; padding: 15px 20px; border-radius: 8px; border: 1px solid #e9ecef; margin-bottom: 25px; }
        .filter-group { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
        .filter-label { font-weight: bold; color: #555; font-size: 0.9em; text-transform: uppercase; margin-right: 5px; }
        .filter-pill { background: #fff; border: 1px solid #ced4da; padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 0.9em; font-weight: bold; color: #666; transition: 0.2s; display: inline-flex; align-items: center; gap: 5px; user-select: none; }
        .filter-pill:hover { background: #e9ecef; }
        .filter-pill.active { background: #007bff; color: white; border-color: #007bff; }
        .filter-pill-konto.active { background: #28a745; border-color: #28a745; }
        .toggle-pill { background: transparent; border: 1px dashed #adb5bd; padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 0.9em; font-weight: bold; color: #6c757d; transition: 0.2s; display: inline-flex; align-items: center; gap: 5px; user-select: none; }
        .toggle-pill:hover { background: #e9ecef; color: #333; border-color: #6c757d; }

        .header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
        .action-btn { padding: 10px 15px; border-radius: 5px; text-decoration: none; font-size: 0.9em; font-weight: bold; border: none; cursor: pointer; transition: background 0.2s; display: inline-block; }
        .btn-light { background: #e9ecef; color: #495057; border: 1px solid #ced4da; }
        .btn-light:hover { background: #dde2e6; }
        .btn-primary { background: #007bff; color: white; box-shadow: 0 2px 5px rgba(0,123,255,0.3); }
        .btn-primary:hover { background: #0069d9; }
        .btn-info { background: #17a2b8; color: white; box-shadow: 0 2px 5px rgba(23,162,184,0.3); }
        .btn-info:hover { background: #138496; }

        .filter-bar-chart { margin-bottom: 15px; display: flex; gap: 10px; }
        .filter-btn { background: #f1f1f1; border: 1px solid #ccc; padding: 6px 15px; border-radius: 20px; cursor: pointer; font-weight: bold; color: #555; transition: 0.2s; }
        .filter-btn:hover { background: #e2e2e2; }
        .filter-btn.active { background: #007bff; color: white; border-color: #007bff; }
        
        .noUi-connect { background: #007bff; }
        .noUi-handle { border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.2); cursor: grab; }
        .noUi-handle:active { cursor: grabbing; }

        .date-input { padding: 5px 10px; border: 1px solid #ced4da; border-radius: 4px; font-size: 0.9em; color: #495057; font-weight: bold; font-family: inherit; cursor: pointer; background: #f8f9fa; }
        .date-input:focus { outline: none; border-color: #80bdff; background: #fff; }

        .top-cards-container { display: flex; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
        .top-card-small { flex: 1; min-width: 250px; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border-top: 4px solid #6610f2; }
        .top-card-large { flex: 2; min-width: 400px; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border-top: 4px solid #007bff; }


/* --- Spezifische Index-Layouts --- */
.table-footer-sum { background-color: #e9ecef !important; font-weight: bold; border-top: 2px solid #ccc !important; }
.table-header-light { background-color: #f8f9fa !important; }
.izf-cell { background: #fafafa !important; border-radius: 4px; padding: 10px; }
.portfolio-section { margin-top: 40px; border-top: 1px solid #eee; padding: 20px; }
.table-container-shadow { overflow-x: auto; background: #fff; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); padding: 15px; }