/* Globale Basis */
body {
    margin: 0; padding: 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    display: flex; min-height: 100vh;
    background: #f0f2f5; color: #333;
}

/* Sidebar Design */
.sidebar {
    width: 260px; background: #1a1d21; color: #ecf0f1;
    flex-shrink: 0; display: flex; flex-direction: column;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 25px 20px; font-weight: 800; font-size: 1.2rem;
    letter-spacing: 1px; color: #2ecc71; border-bottom: 1px solid #2c3e50;
}

.nav-link {
    display: block; padding: 12px 20px; color: #adb5bd;
    text-decoration: none; border-bottom: 1px solid #2c3e50;
    transition: all 0.2s; position: relative; font-size: 14px;
}

.nav-link:hover, .nav-link.active {
    background: #2c3e50; color: #fff; border-left: 4px solid #2ecc71;
}

.nav-parent::after {
    content: '▸'; position: absolute; right: 20px; transition: transform 0.2s;
}
.nav-parent.open::after { transform: rotate(90deg); }

.submenu-container { background: #111; display: none; }

/* Main Content & Formulare */
.main { flex-grow: 1; padding: 40px; overflow-y: auto; }

.card {
    background: #fff; padding: 30px; border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); border: 1px solid #e1e4e8;
    max-width: 1000px; margin: 0 auto;
}

input, select, textarea {
    width: 100%; padding: 12px; margin: 8px 0 20px;
    border: 1px solid #ddd; border-radius: 6px; font-size: 15px;
    box-sizing: border-box;
}

input:focus { border-color: #2ecc71; outline: none; box-shadow: 0 0 0 3px rgba(46,204,113,0.1); }

.btn {
    padding: 12px 25px; border: none; border-radius: 6px;
    font-weight: 600; cursor: pointer; transition: opacity 0.2s;
}
.btn.save { background: #2ecc71; color: white; }
.btn.new { background: #3498db; color: white; margin-bottom: 20px; }
.btn:hover { opacity: 0.9; }

/* Raster für zweispaltige Formulare */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Zwei gleich große Spalten */
    gap: 20px; /* Abstand zwischen den Feldern */
    margin-bottom: 20px;
}

/* Ein Form-Group Wrapper für Label + Input */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 5px;
    color: #555;
}

/* Helper-Klasse für Felder, die über die ganze Breite gehen sollen (z.B. Bemerkungen) */
.full-width {
    grid-column: span 2;
}

/* Buttons in eine eigene Zeile am Ende */
.form-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Mobile Optimierung: Auf kleinen Screens wieder einspaltig */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .full-width {
        grid-column: span 1;
    }
}

/* Container für das horizontale Formular */
.form-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Eine Zeile im Formular */
.form-row {
    display: grid;
    grid-template-columns: 180px 1fr; /* Links 180px für Labels, rechts flexibel */
    align-items: center; /* Zentriert Label und Input vertikal */
    gap: 20px;
    margin-bottom: 5px;
}

/* Styling für die Labels (links) */
.form-row label {
    font-weight: 600;
    font-size: 14px;
    color: #444;
    text-align: right; /* Rechtsbündig für besseren Bezug zum Input */
}

/* Styling für die Inputs (rechts) */
.form-row input, 
.form-row select, 
.form-row textarea {
    margin: 0; /* Entfernt die Standard-Margins aus dem vorherigen Entwurf */
}

/* Mobile Optimierung */
@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr; /* Untereinander auf dem Handy */
        gap: 5px;
    }
    .form-row label {
        text-align: left;
    }
}

/* Styling für die Datentabelle */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.data-table th {
    background: #f8f9fa;
    color: #555;
    text-align: left;
    padding: 12px 15px;
    border-bottom: 2px solid #eee;
    font-size: 13px;
    text-transform: uppercase;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    vertical-align: middle;
}

.data-table tr:hover {
    background: #fcfcfc;
}

/* Status-Pillen oder Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    background: #e9ecef;
}

/* Action-Icons/Buttons in der Tabelle */
.action-link {
    text-decoration: none;
    margin-right: 10px;
    font-size: 18px;
}
.edit-link { color: #3498db; }
.delete-link { color: #e74c3c; }

.action-link {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 4px;
    background: #f8f9fa;
    transition: background 0.2s;
}
.action-link:hover { background: #e9ecef; }