/* =============================================================================
   STYLE MASTER - Vollständige Stylesheet-Datei
   Enthält alle Stile aus style_master.css (Basis) und styles.css (Bootstrap-Overrides)
   Bei Konflikten gilt immer die Definition aus style_master.css.
   
   Konfliktauflösung:
   - .btn-primary background: #3498db (style_master) statt #2c3e50 (styles.css)
   - .btn-outline-primary color: #3498db (style_master-Prinzip) statt #2c3e50
   - .form-control:focus border-color: #3498db (style_master-Prinzip) statt #2c3e50
   - Focus-Farbe: #3498db (style_master) statt #2c3e50 (styles.css)
   - .modal-content border-radius: 12px (style_master) statt 8px (styles.css)
   - .badge.bg-primary: #2c3e50 (nur in styles.css definiert, kein Konflikt)
   ============================================================================= */

/* =============================================================================
   ABSCHNITT 1: CSS-VARIABLEN
   (aus styles.css - ergänzt style_master.css für konsistente Farbverwendung)
   Achtung: style_master.css verwendet --primary-blue hardcoded als #3498db,
   daher wird --primary-blue hier auf #3498db gesetzt (style_master gewinnt)
   ============================================================================= */
:root {
    --primary-dark:        #2c3e50;  /* Navbar-Hintergrund, Überschriften */
    --primary-darker:      #34495e;  /* Table-Header, dunklerer Akzent      */
    --primary-blue:        #3498db;  /* Buttons, Fokus-Farbe (style_master)  */
    --primary-blue-hover:  #2980b9;  /* Button-Hover                         */
    --success-green:       #27ae60;
    --warning-orange:      #f39c12;
    --danger-red:          #e74c3c;
    --danger-red-hover:    #c0392b;
    --bg-light:            #f8f9fa;
    --border-light:        #ecf0f1;
    --border-gray:         #ddd;
    --text-dark:           #2c3e50;
    --text-body:           #333;
}

/* =============================================================================
   ABSCHNITT 2: RESET & BASE (aus style_master.css)
   ============================================================================= */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif; line-height: 1.6; margin: 0; padding: 20px; background-color: #f8f9fa; color: #333; font-size: 16px; }

/* =============================================================================
   ABSCHNITT 3: BARRIEREFREIHEIT (aus style_master.css)
   ============================================================================= */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -40px; left: 6px; background: #000; color: #fff; padding: 8px; text-decoration: none; z-index: 10001; border-radius: 0 0 4px 4px; }
.skip-link:focus { top: 0; }

/* =============================================================================
   ABSCHNITT 4: EIGENSTÄNDIGES MENÜ #mainMenu (aus style_master.css)
   Hinweis: Dieser Block ist für das kundenspezifische Menü-Element.
   Bootstrap-Navbar-Overrides folgen in Abschnitt 7.
   ============================================================================= */
#mainMenu { background-color: #2c3e50 !important; color: white; font-family: inherit; position: sticky; top: 0; z-index: 999; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); margin: -20px -20px 30px -20px; }
#mainMenu .menu-container { max-width: none !important; margin: 0 !important; padding: 0 20px !important; display: flex !important; align-items: center !important; justify-content: flex-end !important; min-height: 60px; }
.menu-toggle { display: none; background: none; border: none; font-size: 28px; cursor: pointer; color: white; user-select: none; padding: 15px 0; line-height: 1; }
.menu-toggle:hover, .menu-toggle:focus { color: #ecf0f1; outline: 2px solid rgba(255, 255, 255, 0.3); outline-offset: 2px; }
.menu-list { list-style: none !important; margin: 0 !important; padding: 0 !important; display: flex !important; gap: 15px !important; margin-left: auto !important; justify-content: flex-end !important; width: auto !important; }
.menu-list li { margin: 0 !important; }
.menu-list li .menu-link, .menu-list li button { color: #ecf0f1 !important; text-decoration: none !important; font-weight: 600 !important; padding: 12px 18px !important; display: inline-flex !important; align-items: center !important; gap: 8px !important; transition: all 0.3s ease !important; border-radius: 6px !important; border: none; background: none; cursor: pointer; font-size: inherit; font-family: inherit; }
.menu-list li .menu-link:hover, .menu-list li button:hover, .menu-list li .menu-link:focus, .menu-list li button:focus { color: #fff !important; background: rgba(255, 255, 255, 0.1) !important; transform: translateY(-1px) !important; outline: 2px solid rgba(255, 255, 255, 0.2); outline-offset: 1px; }
.menu-list li .btn-danger { color: #e74c3c !important; }
.menu-list li .btn-danger:hover, .menu-list li .btn-danger:focus { color: #c0392b !important; background: rgba(231, 76, 60, 0.1) !important; }

/* =============================================================================
   ABSCHNITT 5: FALLBACK TOOLBAR (aus style_master.css)
   ============================================================================= */
.fallback-toolbar { position: sticky; top: 0; z-index: 10; padding: 12px 20px; background: #2c3e50; border-bottom: 1px solid #34495e; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); text-align: right; margin: -20px -20px 30px -20px; }
.toolbar-btn { color: #ecf0f1; text-decoration: none; font-weight: 600; padding: 10px 18px; border-radius: 6px; transition: all 0.3s; display: inline-flex; align-items: center; gap: 8px; margin-right: 15px; border: none; background: none; cursor: pointer; font-size: inherit; font-family: inherit; }
.toolbar-btn:last-child { margin-right: 0; }
.toolbar-btn:hover, .toolbar-btn:focus { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); outline: 2px solid rgba(255, 255, 255, 0.2); outline-offset: 1px; }
.toolbar-btn.btn-danger { color: #e74c3c; }
.toolbar-btn.btn-danger:hover, .toolbar-btn.btn-danger:focus { color: #c0392b; background: rgba(231, 76, 60, 0.1); }

/* =============================================================================
   ABSCHNITT 6: HAUPT-CONTENT & LAYOUT (aus style_master.css)
   ============================================================================= */
main { max-width: 1400px; margin: 0 auto; }
#titel { color: #2c3e50; text-align: center; margin-bottom: 30px; font-size: 2.5rem; font-weight: 300; }

/* Container mit Seitenabstand (aus styles.css â€“ ergänzend) */
.container-fluid {
    padding-left: 2rem;
    padding-right: 2rem;
}

/* =============================================================================
   ABSCHNITT 7: BOOTSTRAP NAVBAR OVERRIDES (aus styles.css)
   Überschreibt Bootstrap-Klassen passend zum #mainMenu-Farbschema
   ============================================================================= */
.navbar {
    background-color: #2c3e50 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    /* body hat padding: 20px - negative margins ziehen die Navbar bündig an alle Kanten */
    margin-top: -20px;
    margin-left: -20px;
    margin-right: -20px;
    margin-bottom: 0;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
    color: #ecf0f1 !important;
}

.nav-link {
    color: #ecf0f1 !important;
    font-weight: 600;
    padding: 12px 18px !important;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.nav-link:hover,
.nav-link:focus {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
}

/* =============================================================================
   ABSCHNITT 8: EXPORT-BUTTON (aus style_master.css)
   ============================================================================= */
.btn-export, #exportPDF { background: #3498db; color: white; border: none; padding: 14px 28px; border-radius: 6px; cursor: pointer; font-size: 15px; font-weight: bold; font-family: inherit; transition: all 0.3s ease; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn-export:hover, #exportPDF:hover, .btn-export:focus, #exportPDF:focus { background: #2980b9; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); outline: 2px solid rgba(52, 152, 219, 0.3); outline-offset: 2px; }
.btn-export:disabled, #exportPDF:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.btn-export.loading { background: #f39c12; }
.btn-export.success { background: #27ae60; }
.btn-export.error { background: #e74c3c; }

/* =============================================================================
   ABSCHNITT 9: BUTTONS
   Basis aus style_master.css (#3498db für primary).
   Bootstrap-Klassen (.btn-primary etc.) ergänzt aus styles.css,
   ABER Farbe #3498db aus style_master.css überschreibt #2c3e50 aus styles.css.
   ============================================================================= */

/* --- Basisklassen aus style_master.css (custom, kein Bootstrap-Prefix) --- */
.btn-primary { background: #3498db; color: white; border: none; padding: 14px 28px; border-radius: 6px; cursor: pointer; font-size: 16px; font-weight: bold; font-family: inherit; transition: all 0.3s ease; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); display: inline-flex; align-items: center; gap: 8px; }
.btn-primary:hover, .btn-primary:focus { background: #2980b9; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); outline: 2px solid rgba(52, 152, 219, 0.3); outline-offset: 2px; }
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.btn-primary.loading { background: #f39c12; cursor: not-allowed; }

.btn-secondary { background: #95a5a6; color: white; border: none; padding: 12px 24px; border-radius: 5px; cursor: pointer; font-size: 14px; font-weight: bold; font-family: inherit; transition: all 0.3s ease; }
.btn-secondary:hover, .btn-secondary:focus { background: #7f8c8d; outline: 2px solid rgba(149, 165, 166, 0.3); outline-offset: 2px; }

.btn-success { background: #27ae60 !important; color: white; }

.btn-danger { background: #e74c3c; color: white; border: none; padding: 12px 24px; border-radius: 5px; cursor: pointer; font-size: 14px; font-weight: bold; font-family: inherit; transition: all 0.3s ease; }
.btn-danger:hover, .btn-danger:focus { background: #c0392b; outline: 2px solid rgba(231, 76, 60, 0.3); outline-offset: 2px; }

/* --- Bootstrap .btn-* Overrides (aus styles.css, Farbe nach style_master.css-Prinzip) --- */
/* Konflikt: styles.css nutzt #2c3e50, style_master.css nutzt #3498db â†’ #3498db gewinnt */

.btn {
    transition: all 0.2s ease-in-out;
}
.btn:hover {
    transform: translateY(-1px);
}
.btn:active {
    transform: translateY(0);
}

/* --- Bootstrap .btn-sm Override ---
   Stellt sicher, dass .btn-sm immer die Bootstrap-Kleingröße erzwingt,
   auch wenn .btn-primary / .btn-danger / .btn-warning eigene paddings definieren.
   Ohne diese Regel wären .btn-sm .btn-primary und .btn-sm .btn-danger zu groß. */
.btn.btn-sm {
    padding: .25rem .5rem !important;
    font-size: .875rem !important;
    line-height: 1.5 !important;
    border-radius: .2rem !important;
}

/* Bootstrap .btn-success Override */
.btn-success {
    background-color: #27ae60;
    border-color: #27ae60;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}
.btn-success:hover,
.btn-success:focus {
    background-color: #229954;
    border-color: #229954;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Bootstrap .btn-warning Override */
.btn-warning {
    background-color: #f39c12;
    border-color: #f39c12;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}
.btn-warning:hover,
.btn-warning:focus {
    background-color: #e67e22;
    border-color: #e67e22;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Bootstrap .btn-danger Override */
.btn-danger {
    background-color: #e74c3c;
    border-color: #e74c3c;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}
.btn-danger:hover,
.btn-danger:focus {
    background-color: #c0392b;
    border-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Bootstrap .btn-outline-primary Override */
/* Konflikt: styles.css nutzt #2c3e50, style_master.css-Prinzip = #3498db â†’ #3498db gewinnt */
.btn-outline-primary {
    color: #3498db;
    border-color: #3498db;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: #3498db;
    border-color: #3498db;
    color: white;
}

/* =============================================================================
   ABSCHNITT 10: TABELLEN
   .energy-table aus style_master.css (spezifisch), .table-* Bootstrap-Overrides
   aus styles.css (ergänzend). Selbe Farben â€“ kein Konflikt.
   ============================================================================= */

/* --- Eigenständige Tabelle (style_master.css) --- */
.table-container { background: white; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); overflow-x: auto; margin-bottom: 30px; }
.energy-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.energy-table thead th { background: #34495e; color: white; padding: 16px 8px; text-align: left; font-weight: 600; border-bottom: 2px solid #2c3e50; position: sticky; top: 0; z-index: 10; }
.energy-table tbody td { padding: 12px 8px; text-align: center; border-bottom: 1px solid #ecf0f1; transition: background-color 0.2s ease; }
.energy-table tbody tr:hover { background-color: #f8f9fa; }
.energy-table tbody tr:nth-child(even) { background-color: #fdfdfd; }
.energy-table tbody tr:nth-child(even):hover { background-color: #f0f0f0; }

/* --- Bootstrap .table-* Overrides (aus styles.css) --- */
.table-responsive {
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table thead th {
    background-color: #34495e;
    color: white;
    font-weight: 600;
    border-bottom: 2px solid #2c3e50;
    padding: 16px 8px;
}

.table tbody tr {
    transition: background-color 0.15s ease-in-out;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}

.table tbody tr:nth-child(even):hover {
    background-color: #f0f0f0;
}

.table tbody td {
    border-bottom: 1px solid #ecf0f1;
}

/* =============================================================================
   ABSCHNITT 11: EINGABEFELDER / FORMULARE
   .form-input, .name-input etc. aus style_master.css (eigene Klassen).
   Bootstrap .form-control:focus etc. aus styles.css (ergänzend),
   Farbe: #3498db aus style_master.css-Prinzip statt #2c3e50 aus styles.css.
   ============================================================================= */

/* --- Eigene Input-Klassen (style_master.css) --- */
.name-input { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-family: inherit; font-size: 14px; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.name-input:focus { outline: none; border-color: #3498db; box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2); }
.name-input:focus::placeholder { opacity: 0.3; }
.name-input::placeholder { color: #999; font-style: italic; opacity: 0.8; transition: opacity 0.2s ease; }
.name-input.error { border-color: #e74c3c; box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2); }
.hauptenergie { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; background: white; font-family: inherit; font-size: 14px; cursor: pointer; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.hauptenergie:focus { outline: none; border-color: #3498db; box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2); }
.hauptenergie:disabled { opacity: 0.6; cursor: not-allowed; }
.value-cell { font-weight: bold; min-height: 20px; position: relative; }
.colored-cell { color: white !important; }

/* --- Formulare (style_master.css) --- */
.modern-form { font-family: inherit; }
.form-header { text-align: center; font-size: 48px; margin-bottom: 15px; }
.form-title { color: #3498db; text-align: center; margin-bottom: 20px; font-size: 1.8rem; font-weight: 600; }
.form-description { text-align: center; margin-bottom: 25px; color: #555; line-height: 1.6; font-size: 16px; }
.input-group { background: #f8f9fa; padding: 20px; border-radius: 8px; margin-bottom: 20px; border: 2px solid #dee2e6; }
.input-row { margin-bottom: 20px; }
.input-row:last-child { margin-bottom: 0; }
.form-label { display: block; font-weight: 600; color: #2c3e50; font-size: 16px; margin-bottom: 8px; }
.form-input { width: 100%; padding: 12px 16px; border: 2px solid #ddd; border-radius: 6px; font-size: 16px; font-family: inherit; transition: all 0.3s ease; box-sizing: border-box; }
.form-input:focus { outline: none; border-color: #3498db; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1); }
.form-input.error { border-color: #e74c3c !important; box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important; }
.form-input.success { border-color: #27ae60 !important; box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1) !important; }
.form-help { margin-top: 10px; font-size: 14px; color: #666; line-height: 1.4; }
.form-help a { color: #3498db; text-decoration: none; font-weight: 600; }
.form-help a:hover, .form-help a:focus { text-decoration: underline; outline: 2px solid rgba(52, 152, 219, 0.3); outline-offset: 1px; }
.date-input-container { position: relative; }
.date-input { cursor: pointer; }
.date-input::-webkit-calendar-picker-indicator { cursor: pointer; padding: 5px; border-radius: 3px; transition: background-color 0.3s; }
.date-input::-webkit-calendar-picker-indicator:hover { background-color: rgba(52, 152, 219, 0.1); }
.date-input-fallback { display: none !important; }
.error-message { color: #e74c3c; font-size: 14px; margin-top: 5px; display: none; font-weight: 500; }
.form-actions { margin-top: 25px; display: flex; gap: 12px; justify-content: center; }

/* --- Bootstrap .form-control / .form-select Overrides (aus styles.css) ---
   Konflikt border-color: styles.css=#2c3e50, style_master.css=#3498db â†’ #3498db gewinnt */
.form-control:focus,
.form-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.15);
}

/* Bootstrap Checkbox Override (aus styles.css) */
.form-check-input:checked {
    background-color: #3498db;
    border-color: #3498db;
}

/* Bootstrap Switch Override (aus styles.css) */
.form-switch .form-check-input {
    width: 3em;
    height: 1.5em;
}
.form-switch .form-check-input:checked {
    background-color: #27ae60;
    border-color: #27ae60;
}

/* Passwort-Toggle (aus styles.css) */
.input-group .btn-outline-secondary {
    border-left: 0;
    border-color: #ddd;
}
.input-group .form-control:focus + .btn-outline-secondary {
    border-color: #3498db;
}

/* ===== Passwortfelder ohne Umrandung ===== */
/* Gilt für alle Seiten: Login, Profil, Passwort-Reset */
.input-group input[type="password"].form-control {
    border: none;
    box-shadow: none;
}
.input-group input[type="password"].form-control:focus {
    border: none;
    box-shadow: none;
    outline: none;
}
/* Auge-Button ebenfalls randlos, damit Feld und Button einheitlich wirken */
.input-group:has(input[type="password"]) .btn-outline-secondary {
    border: none;
    box-shadow: none;
}
.input-group:has(input[type="password"]) .btn-outline-secondary:focus {
    box-shadow: none;
    outline: none;
}

/* =============================================================================
   ABSCHNITT 12: LEGENDE (aus style_master.css)
   ============================================================================= */
.legend-container { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); }
.legend-container h3 { margin: 0 0 15px 0; color: #2c3e50; font-size: 1.5rem; }
.legend-item { display: inline-block; margin: 5px; padding: 8px 12px; border-radius: 5px; color: white; font-weight: bold; font-size: 14px; min-width: 60px; text-align: center; border: 1px solid rgba(0, 0, 0, 0.1); }

/* =============================================================================
   ABSCHNITT 13: BOOTSTRAP CARDS (aus styles.css)
   style_master.css hatte keine Bootstrap .card-Definitionen.
   ============================================================================= */
.card {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: none;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    animation: fadeIn 0.5s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    font-weight: 600;
    border-bottom: 2px solid #ecf0f1;
}

.card-header.bg-primary {
    background-color: #2c3e50 !important;
    border-color: #2980b9;
}

.card-header.bg-danger {
    background-color: #e74c3c !important;
    border-color: #c0392b;
}

.card-header.bg-success {
    background-color: #27ae60 !important;
    border-color: #229954;
}

.card-header.bg-info {
    background-color: #2c3e50 !important;
    border-color: #2980b9;
}

/* Statistik-Karten mit Hintergrundfarbe */
.card.bg-primary {
    background-color: #2c3e50 !important;
    border: none;
}

.card.bg-success {
    background-color: #27ae60 !important;
    border: none;
}

.card.bg-danger {
    background-color: #e74c3c !important;
    border: none;
}

.card.bg-warning {
    background-color: #f39c12 !important;
    border: none;
}

/* =============================================================================
   ABSCHNITT 14: BOOTSTRAP ALERTS (aus styles.css)
   ============================================================================= */
.alert {
    border-left: 4px solid;
    border-radius: 6px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left-color: #27ae60;
    border-color: #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: #e74c3c;
    border-color: #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left-color: #f39c12;
    border-color: #ffeaa7;
}

.alert-info {
    background-color: #e7f3ff;
    color: #004085;
    border-left-color: #2c3e50;
    border-color: #b3d9ff;
}

/* Fehlerlisten in Alerts (aus styles.css) */
.alert ul {
    padding-left: 1.5rem;
    margin-bottom: 0;
}
.alert ul li {
    margin-bottom: 0.25rem;
}

/* =============================================================================
   ABSCHNITT 15: BOOTSTRAP BADGES (aus styles.css)
   ============================================================================= */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Hinweis: .badge.bg-primary nutzt #2c3e50 (Navbar-Farbe) â€“
   styles.css-Definition, kein Konflikt mit style_master.css */
.badge.bg-primary {
    background-color: #2c3e50 !important;
}

.badge.bg-success {
    background-color: #27ae60 !important;
}

.badge.bg-danger {
    background-color: #e74c3c !important;
}

.badge.bg-warning {
    background-color: #f39c12 !important;
}

/* =============================================================================
   ABSCHNITT 16: BOOTSTRAP TABS (aus styles.css)
   ============================================================================= */
.nav-tabs {
    border-bottom: 3px solid #2c3e50;
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    color: white !important;
    background-color: #34495e;
    border: 2px solid #2c3e50;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    margin-right: 0.25rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-tabs .nav-link:hover {
    color: white !important;
    background-color: #2c3e50;
    border-color: #2c3e50;
    transform: translateY(-2px);
}

.nav-tabs .nav-link.active {
    color: #2c3e50 !important;
    background: white;
    border-color: #2c3e50;
    border-bottom: 3px solid white;
    margin-bottom: -3px;
    z-index: 10;
}

.nav-tabs .nav-link i {
    margin-right: 0.5rem;
}

.nav-tabs .nav-link.active i {
    color: #2c3e50 !important;
}

.tab-content {
    border: none;
    padding: 0;
    background: white;
}

.tab-pane {
    padding: 1.5rem 0;
}

/* =============================================================================
   ABSCHNITT 17: MODALS
   Eigene Modals: style_master.css (border-radius: 12px â€“ gewinnt).
   Bootstrap Modal-Overrides: styles.css (border-radius 8px) â†’ 12px aus
   style_master.css übernommen. Bootstrap-spezifische Ergänzungen hinzugefügt.
   ============================================================================= */

/* --- Eigenständige Modal-Implementierung (style_master.css) --- */
.modal { display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); }

/* Konflikt border-radius: styles.css=8px, style_master.css=12px â†’ 12px gewinnt */
.modal-content { background-color: #fefefe; margin: 5% auto; border-radius: 12px; max-width: 600px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); position: relative; animation: modalFadeIn 0.3s ease; max-height: 90vh; overflow-y: auto; border: none; }

.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 25px 25px 15px 25px; border-bottom: 2px solid #ecf0f1; border-top-left-radius: 12px; border-top-right-radius: 12px; }
.modal-header h2 { margin: 0; color: #2c3e50; font-size: 1.8rem; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 28px; font-weight: bold; color: #aaa; cursor: pointer; padding: 0; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all 0.3s ease; }
.modal-close:hover, .modal-close:focus { color: #000; background: rgba(0, 0, 0, 0.1); outline: none; }
.modal-body { padding: 25px; }

/* --- Bootstrap Modal-Header Farbvarianten (aus styles.css) --- */
.modal-header.bg-primary {
    background-color: #2c3e50 !important;
}
.modal-header.bg-danger {
    background-color: #e74c3c !important;
}
.modal-header.bg-success {
    background-color: #27ae60 !important;
}

/* Bootstrap Modal Close Button weiß (aus styles.css) */
.btn-close-white {
    filter: brightness(0) invert(1);
}

/* =============================================================================
   ABSCHNITT 18: BOOTSTRAP TOAST NOTIFICATIONS (aus styles.css)
   ============================================================================= */
.toast-container {
    z-index: 9999;
}

.toast {
    min-width: 300px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.toast-header {
    font-weight: 600;
    border-bottom: 1px solid #ecf0f1;
}

.toast-header.bg-success {
    background-color: #27ae60 !important;
}

.toast-header.bg-danger {
    background-color: #e74c3c !important;
}

.toast-header.bg-warning {
    background-color: #f39c12 !important;
}

.toast-header.bg-info {
    background-color: #2c3e50 !important;
}

/* =============================================================================
   ABSCHNITT 19: BOOTSTRAP ICONS (aus styles.css)
   ============================================================================= */
.bi {
    vertical-align: middle;
}

/* Standard-Icon-Farben */
.bi-check-circle-fill {
    color: #27ae60;
}

.bi-x-circle-fill,
.bi-exclamation-triangle-fill {
    color: #e74c3c;
}

.bi-info-circle-fill {
    color: #2c3e50;
}

/* .text-primary Icons â†’ immer Dunkelblau (#2c3e50) statt Bootstrap-Blau */
.bi.text-primary,
h1 .bi.text-primary, h2 .bi.text-primary, h3 .bi.text-primary,
h4 .bi.text-primary, h5 .bi.text-primary, h6 .bi.text-primary,
.btn .bi.text-primary,
.card .bi.text-primary,
.card-header .bi.text-primary,
.card-body .bi.text-primary,
.badge .bi.text-primary,
.card h1 .bi.text-primary, .card h2 .bi.text-primary,
.card h3 .bi.text-primary, .card h4 .bi.text-primary,
.card h5 .bi.text-primary, .card h6 .bi.text-primary {
    color: #2c3e50 !important;
}

/* Icons in Button-Varianten erben ihre Farbe */
.btn-primary .bi,
.btn-outline-primary .bi {
    color: inherit;
}

/* Icons in Primary-Badges â†’ weiß */
.badge.bg-primary .bi {
    color: white !important;
}

/* =============================================================================
   ABSCHNITT 20: LOADING / SPINNER
   style_master.css eigener Spinner + Bootstrap .spinner-border Override
   ============================================================================= */

/* --- Eigener Spinner (style_master.css) --- */
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; z-index: 10001; }
.loading-content { background: white; padding: 30px; border-radius: 8px; text-align: center; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }
.loading-spinner { display: flex; flex-direction: column; align-items: center; gap: 15px; padding: 20px; color: #666; }
.spinner { width: 40px; height: 40px; border: 4px solid #f3f3f3; border-top: 4px solid #3498db; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- Bootstrap .spinner-border Override (aus styles.css) --- */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}
.spinner-border {
    border-color: #2c3e50;
    border-right-color: transparent;
}

/* =============================================================================
   ABSCHNITT 21: TOAST / BENACHRICHTIGUNGEN (eigenständig, aus style_master.css)
   ============================================================================= */
.error-toast, .success-toast { position: fixed; top: 20px; right: 20px; padding: 15px 20px; border-radius: 6px; color: white; font-weight: 600; z-index: 10002; max-width: 400px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); animation: slideInRight 0.3s ease; }
.error-toast { background: #e74c3c; border-left: 4px solid #c0392b; }
.success-toast { background: #27ae60; border-left: 4px solid #229954; }

/* =============================================================================
   ABSCHNITT 22: RESULT AREAS & SETTINGS (aus style_master.css)
   ============================================================================= */
.result-area { margin-top: 20px; padding: 15px; border-radius: 8px; text-align: center; font-weight: bold; font-size: 16px; min-height: 20px; display: none; }
.result-success { background: #d4edda; color: #155724; border: 2px solid #c3e6cb; }
.result-error { background: #f8d7da; color: #721c24; border: 2px solid #f5c6cb; }

.settings-modal { max-width: 700px; }
.settings-description { text-align: center; margin-bottom: 25px; color: #555; line-height: 1.5; }
.settings-section { background: #f8f9fa; padding: 20px; border-radius: 8px; margin-bottom: 20px; border: 2px solid #dee2e6; }
.setting-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.setting-label { font-weight: bold; color: #2c3e50; font-size: 16px; }
.toggle-container { display: flex; align-items: center; gap: 10px; }
.toggle-label-off, .toggle-label-on { font-weight: 600; }
.toggle-label-off { color: #e74c3c; }
.toggle-label-on { color: #27ae60; }
.switch { position: relative; display: inline-block; width: 60px; height: 34px; }
.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: 0.4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: white; transition: 0.4s; border-radius: 50%; }
input:checked + .slider { background-color: #27ae60; }
input:checked + .slider:before { transform: translateX(26px); }
.color-settings { display: flex; gap: 20px; align-items: center; }
.color-input-group { display: flex; align-items: center; gap: 8px; }
.color-input { width: 50px; height: 35px; border: 2px solid #ddd; border-radius: 6px; cursor: pointer; transition: border-color 0.3s ease; }
.color-input:hover, .color-input:focus { border-color: #3498db; outline: none; }
.setting-help { margin: 10px 0 0 0; font-size: 14px; color: #666; font-style: italic; }
.settings-table-container { max-height: 50vh; overflow: auto; padding: 8px; border: 1px solid #ddd; border-radius: 5px; background: white; }
.settings-table { width: 100%; border-collapse: collapse; }
.settings-table thead tr { background: #f8f9fa; }
.settings-table th { padding: 12px; text-align: left; border-bottom: 2px solid #dee2e6; font-weight: 600; color: #2c3e50; }
.settings-table th:nth-child(2), .settings-table th:nth-child(3) { text-align: center; }
.settings-table td { padding: 10px; border-bottom: 1px solid #eee; text-align: center; }
.token-cell { font-weight: bold; color: white !important; text-align: center; }
.modal-actions { margin-top: 20px; margin-bottom: 20px; display: flex; gap: 12px; justify-content: center; }

/* Delete Modal */
.delete-modal { max-width: 450px; text-align: center; }
.warning-icon { color: #e74c3c; font-size: 48px; margin-bottom: 20px; }
.delete-modal h2 { color: #e74c3c; margin-bottom: 15px; }
.delete-modal p { margin-bottom: 25px; line-height: 1.5; color: #555; }
.warning-text { font-size: 0.9em; color: #777; }

/* =============================================================================
   ABSCHNITT 23: SCHATTEN-UTILITIES (aus styles.css)
   ============================================================================= */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}
.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}
.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

/* =============================================================================
   ABSCHNITT 24: UTILITY-KLASSEN (aus beiden Dateien)
   ============================================================================= */
.min-vh-100 {
    min-height: 100vh;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Benutzerdefinierte Farbklassen (aus styles.css, Farbe nach style_master.css-Prinzip) */
.text-primary-custom {
    color: #3498db !important;
}
.bg-primary-custom {
    background-color: #3498db !important;
}
.border-primary-custom {
    border-color: #3498db !important;
}

/* =============================================================================
   ABSCHNITT 25: MONDTAG MODAL (aus style_master.css)
   ============================================================================= */
#mondtagModal .mondtag-form { padding: 0; font-family: inherit; }
#mondtagModal .form-header { text-align: center; color: #3498db; font-size: 28px; margin-bottom: 15px; }
#mondtagModal .form-description { text-align: center; margin-bottom: 25px; color: #555; line-height: 1.5; }
#mondtagModal .input-group { background: #f8f9fa; padding: 20px; border-radius: 8px; margin-bottom: 20px; border: 2px solid #dee2e6; }
#mondtagModal .input-row { margin-bottom: 20px; }
#mondtagModal .input-row:last-child { margin-bottom: 0; }
#mondtagModal .form-label { display: block; font-weight: bold; color: #2c3e50; font-size: 16px; margin-bottom: 8px; }
#mondtagModal .form-input { width: 100%; padding: 12px 16px; border: 2px solid #ddd; border-radius: 6px; font-size: 16px; transition: all 0.3s ease; box-sizing: border-box; font-family: inherit; }
#mondtagModal .form-input:focus { outline: none; border-color: #3498db; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1); }
#mondtagModal .form-input.error { border-color: #e74c3c !important; box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important; }
#mondtagModal .form-help { margin-top: 10px; font-size: 14px; color: #666; line-height: 1.4; }
#mondtagModal .form-actions { margin-top: 25px; display: flex; gap: 12px; justify-content: center; }
#mondtagModal .btn-primary { background: #3498db; color: white; border: none; padding: 14px 28px; border-radius: 6px; cursor: pointer; font-size: 16px; font-weight: bold; font-family: inherit; transition: all 0.3s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
#mondtagModal .btn-primary:hover, #mondtagModal .btn-primary:focus { background: #2980b9; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.15); outline: 2px solid rgba(52, 152, 219, 0.3); outline-offset: 2px; }
#mondtagModal .btn-primary:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
#mondtagModal .result-area { margin-top: 20px; padding: 15px; border-radius: 8px; text-align: center; font-weight: bold; font-size: 16px; min-height: 20px; }
#mondtagModal .result-success { background: #d4edda; color: #155724; border: 2px solid #c3e6cb; }
#mondtagModal .result-error { background: #f8d7da; color: #721c24; border: 2px solid #f5c6cb; }
#mondtagModal .result-details { margin-top: 15px; background: #e7f3ff; border: 2px solid #b3d9ff; border-radius: 8px; padding: 15px; text-align: left; }
#mondtagModal .detail-item { display: flex; justify-content: space-between; margin-bottom: 8px; padding: 5px 0; border-bottom: 1px solid #ddd; }
#mondtagModal .detail-item:last-child { border-bottom: none; margin-bottom: 0; }
#mondtagModal .detail-label { font-weight: 600; color: #2c3e50; }
#mondtagModal .detail-value { color: #495057; }
.mondtag-modal-close { background: none; border: none; font-size: 28px; font-weight: bold; color: #aaa; cursor: pointer; padding: 0; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all 0.3s ease; }
.mondtag-modal-close:hover, .mondtag-modal-close:focus { color: #000; background: rgba(0, 0, 0, 0.1); outline: none; }

/* Matrix Modal Close Button */
.matrix-modal-close { background: none; border: none; font-size: 28px; font-weight: bold; color: #aaa; cursor: pointer; padding: 0; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all 0.3s ease; }
.matrix-modal-close:hover, .matrix-modal-close:focus { color: #000; background: rgba(0, 0, 0, 0.1); outline: none; }

/* =============================================================================
   ABSCHNITT 26: TRANSFER-BUTTON & PREFILLED FIELDS (aus style_master.css)
   ============================================================================= */
#transferToEnergie {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}
#transferToEnergie:hover, #transferToEnergie:focus {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}
#transferToEnergie::before { content: '\2713'; margin-right: 8px; }

.form-input.prefilled-field {
    border-color: #27ae60 !important;
    background: linear-gradient(to right, #f0fff4, #ffffff) !important;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.12) !important;
}
.form-input.prefilled-field:focus {
    border-color: #1e8449 !important;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.25) !important;
}

.transfer-banner {
    display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; margin-bottom: 18px;
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border: 1px solid #81c784; border-left: 4px solid #27ae60; border-radius: 8px;
    font-size: 14px; color: #2e7d32; line-height: 1.5; animation: slideInBanner 0.3s ease;
}
.transfer-banner-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.transfer-banner-text { flex: 1; }
.transfer-banner-close { background: none; border: none; color: #388e3c; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; flex-shrink: 0; opacity: 0.7; font-family: inherit; transition: opacity 0.2s; }
.transfer-banner-close:hover { opacity: 1; }

/* =============================================================================
   ABSCHNITT 27: BEZIEHUNGSMATRIX (aus style_master.css)
   ============================================================================= */
.checkbox-col { width: 60px; text-align: center; }
.checkbox-cell { text-align: center; vertical-align: middle; padding: 8px 4px !important; }
.matrix-checkbox-label { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s ease; padding: 4px; }
.matrix-checkbox-label.disabled { cursor: not-allowed; opacity: 0.4; }
.matrix-checkbox { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox-custom { width: 22px; height: 22px; border: 2px solid #bdc3c7; border-radius: 4px; background: white; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; font-size: 14px; }
.matrix-checkbox-label:hover .checkbox-custom { border-color: #3498db; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1); }
.matrix-checkbox:checked + .checkbox-custom { background: #3498db; border-color: #3498db; }
.matrix-checkbox:checked + .checkbox-custom::after { content: '\2713'; color: white; font-weight: bold; }
.matrix-checkbox:focus + .checkbox-custom { outline: 2px solid #3498db; outline-offset: 2px; }

.btn-matrix-create { background: #27ae60; color: white; border: none; padding: 14px 28px; font-size: 15px; font-weight: bold; font-family: inherit; border-radius: 6px; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); margin-left: 15px; display: inline-flex; align-items: center; gap: 8px; }
.btn-matrix-create:hover { background: #229954; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); }
.btn-matrix-create:focus { outline: 2px solid rgba(39, 174, 96, 0.3); outline-offset: 2px; }

.selected-for-matrix { background: rgba(52, 152, 219, 0.1) !important; }
.selected-for-matrix:hover { background: rgba(52, 152, 219, 0.15) !important; }

.matrix-modal-content { max-width: 95vw !important; width: 1400px !important; }
.matrix-modal-body { padding: 20px; max-height: 80vh; overflow-y: auto; }

/* =============================================================================
   ABSCHNITT 28: ANIMATIONEN
   style_master.css hat modalFadeIn + spin; styles.css hat fadeIn + slideInRight/slideInBanner.
   Alle hier zusammengeführt.
   ============================================================================= */
@keyframes modalFadeIn  { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn       { from { opacity: 0; transform: translateY(20px); }  to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; }  to { transform: translateX(0); opacity: 1; } }
@keyframes slideInBanner { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInButton { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* =============================================================================
   ABSCHNITT 29: CUSTOM SCROLLBAR (aus styles.css â€“ war nicht in style_master.css)
   ============================================================================= */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #888; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* =============================================================================
   ABSCHNITT 30: EXPORT SECTION (aus style_master.css)
   ============================================================================= */
.export-section { margin-bottom: 25px; text-align: left; }

/* =============================================================================
   ABSCHNITT 31: RESPONSIVE BREAKPOINTS
   Aus beiden Dateien zusammengeführt, style_master.css-Definitionen haben Vorrang.
   ============================================================================= */

@media (max-width: 1200px) {
    .table-container { font-size: 13px; }
    .energy-table thead th, .energy-table tbody td { padding: 10px 6px; }
    .matrix-modal-content { width: 98vw !important; margin: 1% auto !important; }
}

@media (max-width: 992px) {
    body { padding: 15px; }
    #titel { font-size: 2rem; }
    .modal-content { margin: 10px; max-width: none; }
    .settings-modal { max-width: none; }
    .color-settings { flex-direction: column; gap: 10px; align-items: flex-start; }
}

@media (max-width: 768px) {
    /* Layout */
    body { padding: 10px; }
    #titel { font-size: 1.8rem; margin-bottom: 20px; }

    /* Container */
    .container-fluid { padding-left: 1rem; padding-right: 1rem; }

    /* Eigenständige Tabellen */
    .table-container { font-size: 12px; }
    .energy-table thead th, .energy-table tbody td { padding: 8px 4px; }

    /* Bootstrap-Tabellen (Cards-Layout auf Mobilgeräten, aus styles.css) */
    .table-responsive { font-size: 0.875rem; }
    .table thead { display: none; }
    .table tbody tr { display: block; margin-bottom: 1rem; border: 1px solid #ecf0f1; border-radius: 6px; }
    .table tbody td { display: block; text-align: right; border: none; padding: 0.5rem !important; }
    .table tbody td::before { content: attr(data-label); float: left; font-weight: 600; }

    /* Formulare */
    .form-input { padding: 10px 12px; font-size: 16px; }
    .btn-primary, .btn-export { padding: 12px 20px; font-size: 14px; }
    .setting-row { flex-direction: column; align-items: flex-start; gap: 10px; }
    .toggle-container { align-self: flex-end; }
    .modal-actions { flex-direction: column; }

    /* Toast */
    .error-toast, .success-toast { top: 10px; right: 10px; left: 10px; max-width: none; }

    /* Menü */
    .menu-toggle { display: block; }
    .menu-list { display: none !important; flex-direction: column !important; gap: 0 !important; background-color: #2c3e50 !important; width: 100% !important; margin-left: 0 !important; justify-content: flex-start !important; position: absolute; top: 100%; left: 0; right: 0; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }
    .menu-list.show { display: flex !important; }
    .menu-list li .menu-link, .menu-list li button { padding: 15px 20px !important; border-top: 1px solid #34495e !important; border-radius: 0 !important; width: 100%; text-align: left; }
    #mainMenu .menu-container { justify-content: space-between !important; }

    /* Mondtag-Modal */
    #mondtagModal .form-input { font-size: 16px; }
    #mondtagModal .btn-primary { padding: 12px 20px; font-size: 14px; }
    #mondtagModal .detail-item { flex-direction: column; align-items: flex-start; gap: 5px; }
    #mondtagModal .detail-label { margin-bottom: 2px; }

    /* Matrix-Modal */
    .matrix-modal-content { margin: 0 !important; border-radius: 0 !important; max-height: 100vh !important; }
    .matrix-modal-body { max-height: calc(100vh - 60px); }

    /* Matrix-Button */
    .btn-matrix-create { margin-left: 0; margin-top: 10px; width: 100%; justify-content: center; }

    /* Checkbox */
    .checkbox-col { width: 50px; }
    .checkbox-custom { width: 20px; height: 20px; font-size: 12px; }
}

@media (max-width: 480px) {
    .energy-table { font-size: 11px; }
    .energy-table thead th, .energy-table tbody td { padding: 6px 2px; }
    .legend-item { margin: 3px; padding: 6px 10px; font-size: 12px; }
    .modal-header, .modal-body { padding: 15px; }
    .form-title { font-size: 1.5rem; }
    #mondtagModal .form-actions { flex-direction: column; }
    #mondtagModal .input-group { padding: 15px; }
}

/* =============================================================================
   ABSCHNITT 32: FOKUS & BARRIEREFREIHEIT
   Farbe: #3498db aus style_master.css-Prinzip (statt #2c3e50 aus styles.css)
   ============================================================================= */
*:focus { outline: 2px solid #3498db; outline-offset: 2px; }
*:focus-visible { outline: 2px solid #3498db; outline-offset: 2px; }
button:focus, input:focus, select:focus, textarea:focus, a:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* =============================================================================
   ABSCHNITT 33: DRUCK-STYLES (aus beiden Dateien zusammengeführt)
   ============================================================================= */
@media print {
    /* Bootstrap-Elemente (aus styles.css) */
    .navbar, .btn, .toast-container, .modal { display: none !important; }

    /* Eigenständige Elemente (aus style_master.css) */
    .loading-overlay, .error-toast, .success-toast,
    #mainMenu, .fallback-toolbar, .export-section { display: none !important; }

    body { background: white; padding: 0; }
    .table-container, .legend-container { box-shadow: none; border: 1px solid #ddd; }
    .energy-table { font-size: 10px; }
    .energy-table thead th { background: #f8f9fa !important; color: black !important; }

    /* Bootstrap Cards im Druck */
    .card { border: 1px solid #000; box-shadow: none; }
}

/* =============================================================================
   ABSCHNITT 34: HIGH CONTRAST MODE (aus beiden Dateien zusammengeführt)
   ============================================================================= */
@media (prefers-contrast: high) {
    .energy-table tbody tr:nth-child(even) { background-color: #f0f0f0; }
    .table tbody tr:nth-child(even) { background-color: #f0f0f0; }
    .form-control, .form-select { border-width: 2px; }
    .form-input, .hauptenergie, .name-input { border-width: 2px; }
    .btn { border: 2px solid currentColor; }
    .btn-primary, .btn-secondary, .btn-danger, .btn-export { border: 2px solid currentColor; }
}

/* =============================================================================
   ABSCHNITT 35: REDUCED MOTION (aus beiden Dateien zusammengeführt)
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .modal-content { animation: none; }
    .spinner { animation: none; border-top-color: #3498db; }
}

/* =============================================================================
   ENERGIETABELLE: DYNAMISCHE ZEILEN (Zeile hinzufügen)
   ============================================================================= */
.table-actions { display: flex; align-items: center; gap: 15px; margin: 15px 0 25px; flex-wrap: wrap; }
.btn-add-row { background: #27ae60; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: bold; font-family: inherit; transition: all 0.3s ease; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); display: inline-flex; align-items: center; gap: 8px; }
.btn-add-row:hover, .btn-add-row:focus { background: #229954; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); outline: 2px solid rgba(39, 174, 96, 0.3); outline-offset: 2px; }
.btn-add-row:disabled { opacity: 0.5; cursor: not-allowed; transform: none; background: #95a5a6; }
.row-counter { font-size: 14px; color: #7f8c8d; }
@media (max-width: 768px) { .btn-add-row { width: 100%; justify-content: center; } }
