/* --- Farb-Variablen (Standard: Helles Design) --- */
:root {
    --bg-color: #f4f4f9;
    --container-bg: #ffffff;
    --text-main: #111111;
    --text-muted: #555555;
    --text-body: #333333;
    --border-color: #cccccc;
    --border-light: #eee;
    --th-bg: #f8f9fa;
    --tr-hover: #f1f1f1;
    --info-box-bg: #f8f9fa;
    --input-bg: #ffffff;
    --input-text: #333333;
    --input-border: #cccccc;
    --divider-line: #cccccc;
    --divider-bg: #ffffff;
}

/* --- Manueller Wechsel zum Dunklen Design (Dark Mode) --- */
/* Wenn der Body die Klasse "dark-mode" hat, überschreiben wir die Variablen */
body.dark-mode {
    --bg-color: #121212;          /* Tiefer, dunkler Hintergrund */
    --container-bg: #1e1e1e;      /* Etwas helleres Grau für die Boxen */
    --text-main: #ffffff;          /* Weißer Text für Überschriften */
    --text-muted: #aaaaaa;         /* Hellgrau für sekundäre Texte */
    --text-body: #dddddd;          /* Fast weiß für Fließtext */
    --border-color: #333333;       /* Dunkle Trennlinien */
    --border-light: #2a2a2a;
    --th-bg: #252525;              /* Dunkler Tabellenkopf */
    --tr-hover: #2d2d2d;           /* Leichtes Aufhellen beim Drüberfahren */
    --info-box-bg: #252525;        /* Hintergrund für die Technik-Boxen */
    --input-bg: #2d2d2d;           /* Dunkle Eingabefelder */
    --input-text: #ffffff;         /* Weißer Text in den Feldern */
    --input-border: #444444;       /* Rahmen für dunkle Felder */
    --divider-line: #444444;
    --divider-bg: #1e1e1e;
}

/* --- Globales Setup & Mobile-First Reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-body);
    line-height: 1.5;
    padding: 15px;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--container-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* --- Buttons --- */
.btn-group { display: flex; gap: 10px; width: 100%; flex-wrap: wrap; }
.btn-new, .btn-manage, .btn-submit, .btn-back, .btn-edit-details {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 48px; padding: 10px 16px; text-decoration: none; border-radius: 8px;
    font-weight: bold; font-size: 14px; border: none; cursor: pointer; transition: background 0.2s;
}
.btn-new { background-color: #007BFF; color: white; flex: 1; }
.btn-manage { background-color: #6c757d; color: white; flex: 1; }
.btn-submit { background-color: #28a745; color: white; width: 100%; margin-top: 15px; font-size: 16px; }
.btn-back { color: #007BFF; background: none; margin-top: 15px; }

/* --- Formulare --- */
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; color: var(--text-main); }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
    width: 100%; min-height: 48px; padding: 12px; border: 1px solid var(--input-border);
    border-radius: 8px; font-size: 16px; background-color: var(--input-bg);
    color: var(--input-text); font-family: inherit;
}
select option { background-color: var(--container-bg); color: var(--text-main); }

/* --- Tabellen --- */
table { width: 100%; border-collapse: collapse; margin-top: 15px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border-light); }
th { background-color: var(--th-bg); color: var(--text-main); }
tr:hover { background-color: var(--tr-hover); }

@media screen and (max-width: 768px) {
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    tr { margin-bottom: 15px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--container-bg); padding: 8px 12px; }
    td { text-align: right; padding-left: 45%; position: relative; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: flex-end; }
    td::before { content: attr(data-label); position: absolute; left: 12px; font-weight: bold; color: var(--text-muted); }
}