/* --- GRUNDLEGENDE STILE --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
}

/* --- HAUPT-LAYOUT MIT FLEXBOX --- */
.page-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- LINKE SEITENLEISTE (SIDEBAR) --- */
.sidebar {
    width: 240px;
    background-color: #2c3e50; /* Dunkelblau/Grau */
    color: #ecf0f1; /* Helle Textfarbe */
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0; /* Verhindert, dass die Sidebar schrumpft */
}

.sidebar-header h1 {
    margin: 0 0 30px 0;
    text-align: center;
}

.sidebar-header h1 a {
    color: #fff;
    text-decoration: none;
    font-size: 1.5em;
}

/* --- NAVIGATION IN DER SIDEBAR --- */
.sidebar nav a {
    display: block;
    color: #ecf0f1 !important; /* !important, um andere Link-Farben zu überschreiben */
    text-decoration: none;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.sidebar nav a:hover, .sidebar nav a.active {
    background-color: #34495e; /* Etwas helleres Dunkelblau */
}

.sidebar .welcome-user {
    display: block;
    padding: 15px;
    margin-bottom: 20px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 5px;
    text-align: center;
    font-size: 0.9em;
}

/* --- HAUPTINHALTSBEREICH --- */
.main-content {
    flex: 1; /* Nimmt den gesamten restlichen Platz ein */
    padding: 40px;
    overflow-y: auto; /* Erlaubt Scrollen, falls der Inhalt zu lang ist */
}

main > h2, main > h3 {
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
}

main > h3 {
    margin-top: 30px;
}

footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    text-align: center;
    color: #7f8c8d;
}

/* --- TABELLEN-STILE --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden; /* Sorgt dafür, dass border-radius auch bei den Ecken der Tabelle greift */
}
table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
table th {
    background-color: #f2f2f2;
    font-weight: 600;
}
table tr:last-child td {
    border-bottom: none;
}
table tr:hover {
    background-color: #f9f9f9;
}
table a {
    color: #3498db;
    text-decoration: none;
    margin-right: 10px;
    font-weight: 500;
}
table a.delete {
    color: #e74c3c;
}


/* --- FORMULAR-STILE --- */
.form-container, form {
    max-width: 500px;
    margin: 20px 0;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

form {
    padding: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

form input, form button {
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 1em;
}
form button {
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}
form button:hover {
    background-color: #2980b9;
}
.error {
    color: #e74c3c;
    background-color: #fbe2e2;
    border: 1px solid #e74c3c;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}


/* --- SPEZIFISCHE STILE FÜR KUNDEN/ANSPRECHPARTNER --- */
.customer-details {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.customer-details p {
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

/* Generische Buttons für "Hinzufügen" oder "Bearbeiten" */
.button-add, .button-edit {
    display: inline-block;
    padding: 10px 15px;
    background-color: #2ecc71; /* Grün */
    color: white !important; /* Wichtig, um Link-Stile zu überschreiben */
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 500;
}

.button-edit {
    background-color: #f39c12; /* Orange */
}

.button-group a {
    display: inline-block;
    padding: 10px 15px;
    background-color: #2ecc71;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 20px;
}