/* =========================================
   1. GRUNDEINSTELLUNGEN & VARIABLEN
   ========================================= */
:root {
    /* Farben */
    --primary: #387d80;       /* Türkis */
    --primary-hover: #2c6366; /* Etwas dunkler für Hover */
    --text-main: #111827;     /* Fast Schwarz */
    --text-muted: #6b7280;    /* Grau */
    --bg-body: #f3f4f6;       /* Hellgrauer Hintergrund */
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --danger: #ef4444;        /* Rot für Löschen */
    --warning: #f59e0b;       /* Gelb für Warnungen */
    
    /* Status Farben */
    --success-bg: #dcfce7;
    --success-text: #166534;
    --inactive-bg: #f3f4f6;
    --inactive-text: #374151;
    --danger-bg: #fef2f2;
    --danger-text: #991b1b;
    --info-bg: #eff6ff;
    --info-text: #1e40af;

    /* Layout Maße */
    --sidebar-width: 220px;
    --header-height: 64px;
    --header-height-mobile: 41px;
    --z-modal: 1050;
    --z-dropdown: 1000;
    --z-sticky: 1020;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-body);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-main);
    line-height: 1.5;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =========================================
   2. LAYOUT & NAVIGATION (Neu für SaaS)
   ========================================= */

/* Layout Wrapper für Sidebar + Content */
.app-layout {
    display: flex;
    flex: 1;
    height: 100%;
    overflow: hidden; /* Scrollen passiert im Main-Bereich */
}

/* Sidebar Styles */
.sidebar {
    position: relative;
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    display: flex;
    flex-direction: column;
    position: fixed; /* Fallback für Mobile */
    height: 100%;
    z-index: 50;
    transition: transform 0.3s ease;
}

/* Eine feine Linie rechts, aber mit Abstand oben */
.sidebar::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 64px; 
    height: calc(100vh - 64px);
    width: 1px;
    background-color: var(--border-color);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
    padding: 1.5rem 1rem;
    overflow-y: auto;
    flex: 1;
}

/* =========================================
   NAVIGATION ITEMS
   ========================================= */

ul.nav {
    padding: 0;
}

.sidebar-nav li, 
.nav-item {
    list-style: none;
    margin-bottom: 0.25rem;
    padding: 0;
}

.sidebar-nav a {
    /* WICHTIG: Flexbox direkt auf dem Link */
    display: flex; 
    align-items: center; /* Vertikale Zentrierung von Icon und Text */
    
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

/* 3. Das Icon (Linke Seite) */
.sidebar-nav a .nav-icon {
    display: inline-flex; /* Damit das SVG zentriert ist */
    align-items: center;
    justify-content: center;
    
    width: 24px;  /* Feste Breite */
    height: 24px; /* Feste Höhe */
    margin-right: 12px;
    
    line-height: 0;
    flex-shrink: 0; /* Darf nicht kleiner werden */
}

/* SVG Größe fixieren */
.sidebar-nav a .nav-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* 4. Der Text (Rechte Seite) */
.sidebar-nav a .nav-label {
    line-height: 1.2; 
    /* Falls nötig: padding-top: 1px; um optische Font-Verschiebungen auszugleichen */
}

/* Hover Effekte */
.sidebar-nav a:hover {
    background-color: #f9fafb;
    color: var(--text-main);
}

/* Active State (Klasse muss auf dem <a> oder dem <li> liegen) */
/* Fall 1: Klasse .active ist auf dem <a> */
.sidebar-nav a.active {
    background-color: rgba(56, 125, 128, 0.1); /* Primary transparent */
    color: var(--primary);
}

/* Fall 2: Klasse .active ist auf dem <li> */
.nav-item.active a {
    background-color: rgba(56, 125, 128, 0.1);
    color: var(--primary);
}

/* Main Content Wrapper */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Verhindert Flex-Overflow */
    margin-left: var(--sidebar-width); /* Platz für Sidebar Desktop */
    height: 100vh;
    overflow-y: auto; /* Scrollable Content */
}

/* Top Navigation Bar */
.top-nav {
    height: var(--header-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* =========================================
   3. MAIN (UNVERÄNDERT)
   ========================================= */
main {
    max-width: 1200px; /* REPARATUR: Wieder breiter für die Tabelle */
    margin: 0 auto;
    padding: 0 1rem 4rem 1rem;
    width: 100%; /* Sicherstellen, dass es den Platz füllt */
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }

/* =========================================
   4. HEADER & TYPO
   ========================================= */
h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    overflow: hidden;
}

h2, h3 { color: var(--text-main); font-weight: 600; margin-top: 0; }
h2 { font-size: 1.25rem; margin-bottom: 1rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.75rem; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0 1.5rem 0;
}

/* =========================================
   5. ALERTS & NOTIFICATIONS (Neu)
   ========================================= */
.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    font-size: 0.875rem;
}

.alert-success { background-color: var(--success-bg); color: var(--success-text); border-color: #bbf7d0; }
.alert-danger { background-color: var(--danger-bg); color: var(--danger-text); border-color: #fecaca; }
.alert-info { background-color: var(--info-bg); color: var(--info-text); border-color: #bfdbfe; }

/* =========================================
   6. BUTTONS
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    line-height: 1.2;
    text-decoration: none;
}

/* Primary */
.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }

/* Secondary (Zurück) */
.btn-secondary {
    background-color: white;
    border-color: var(--border-color);
    color: var(--text-main);
    margin-right: 8px;
}
.btn-secondary:hover { background-color: #f9fafb; border-color: #d1d5db; }

/* Danger Outline (Löschen) */
.btn-outline-danger {
    background-color: transparent;
    border-color: #fca5a5;
    color: var(--danger);
}
.btn-outline-danger:hover {
    background-color: #fef2f2;
    border-color: var(--danger);
}

/* Link Button (Abbrechen) */
.btn-link {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0 1rem;
    cursor: pointer;
}
.btn-link:hover { color: var(--text-main)}

/* Small Button */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn-sm:hover { background-color: #f9fafb; }

/* Add Button (Plus Icon) */
.btn-add::before {
    content: ''; display: block; width: 16px; height: 16px; margin-right: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'%3E%3C/line%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
    background-size: contain; background-repeat: no-repeat;
}

/* Icon Fix für <i> Tags */
.btn i { font-style: normal; margin-right: 6px; }

/* =========================================
   7. DASHBOARD WIDGETS (Neu)
   ========================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.stat-label { font-size: 0.875rem; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 1.875rem; font-weight: 700; color: var(--text-main); margin-top: 0.5rem; }
.stat-trend { font-size: 0.875rem; margin-top: 0.5rem; display: flex; align-items: center; gap: 4px; }
.trend-up { color: var(--success-text); }
.trend-down { color: var(--danger); }

/* =========================================
   8. CARDS & LAYOUT
   ========================================= */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 2rem;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
}
.card-header h3 { margin: 0; font-size: 1rem; }

/* WICHTIG: Padding 0 für Tabellen, aber Inhalte müssen sich selbst Padding geben */
.card-body { padding: 0; }

/* Helpers */
.d-none { display: none !important; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: end; }
.align-items-center { align-items: center; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.text-end { text-align: right; }
.text-muted { color: var(--text-muted); }
.small { font-size: 0.75rem; }
.fw-bold { font-weight: 600; }

/* =========================================
   9. SUCHE (Übersicht)
   ========================================= */
.search-form {
    padding: 1.5rem; /* REPARATUR: Padding hinzugefügt */
    border-bottom: 1px solid var(--border-color);
    margin: 0;
}

.input-group {
    display: flex;
    gap: 10px;
    max-width: 500px;
}

/* =========================================
   10. FORMULARE & INPUTS
   ========================================= */
.form-builder {
    padding: 2rem; /* REPARATUR: Padding für das Bearbeiten-Formular */
}

.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block; font-size: 0.875rem; font-weight: 500;
    color: var(--text-main); margin-bottom: 0.5rem;
}

/* Modern Input Reset */
.form-control {
    width: 100%; padding: 0.625rem 0.875rem; font-size: 0.875rem;
    border: 1px solid #d1d5db; border-radius: 6px;
    background-color: #fff; transition: all 0.2s; outline: none; font-family: inherit;
    /* iOS Input Fix */
    -webkit-appearance: none; appearance: none;
}
.form-control:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(56, 125, 128, 0.15);
}

/* Custom Select Arrow Styling */
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

textarea.form-control { min-height: 100px; resize: vertical; line-height: 1.6; }
.w-25 { width: 100px !important; }

/* Checkboxes & Radios */
input[type="checkbox"], input[type="radio"] {
    accent-color: var(--primary);
    width: 1rem; height: 1rem; margin-right: 0.5rem; cursor: pointer;
}

/* Form Actions */
.form-actions {
    padding-top: 1.5rem; border-top: 1px solid var(--border-color); margin-top: 2rem;
    display: flex; align-items: center; gap: 1rem; justify-content: flex-start;
}
.form-actions .btn-outline-danger { margin-left: auto; }

/* STATUS HEADER AREA */
.form-header-area {
    border-radius: 8px !important;
    padding: 0.75rem 1.25rem !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02); 
    background-color: #f9fafb;
    border: 1px solid var(--border-color);
}

.form-header-area label.fw-bold {
    font-weight: 600 !important; 
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0;
    margin-right: 12px;
    cursor: pointer;
}

.form-header-area .d-flex { align-items: center; }

/* TOGGLE SWITCH */
.switch {
    position: relative; display: inline-block; width: 44px; height: 24px;
    margin-bottom: 0; vertical-align: middle;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #e5e7eb; transition: .4s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
    background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
input:checked + .slider { background-color: #10b981; }
input:checked + .slider:before { transform: translateX(20px); }
.switch + span, label.mr-2 { margin-right: 10px; vertical-align: middle; }

/* =========================================
   11. DETAIL ANSICHT (Intelligent Grid)
   ========================================= */
.details-grid {
    display: grid;
    grid-template-columns: 100%;
    gap: 1.5rem;
    padding: 1.5rem;
}

.details-grid .field-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.details-grid .field-item:last-child { border-bottom: none; }

.details-grid label {
    display: block; font-size: 0.7rem; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted);
    font-weight: 700; margin-bottom: 4px;
}

.details-grid .value { font-size: 1rem; color: var(--text-main); }

@media (min-width: 768px) {
    .details-grid {
        grid-template-columns: 2fr 1fr; 
        column-gap: 3rem; 
        row-gap: 1.5rem;
        grid-auto-flow: row dense; 
        align-items: start;
    }
    .details-grid .field-item { grid-column: 1; }
    .details-grid .field-item.is-meta { grid-column: 2; }
}

/* =========================================
   12. TABELLE & BADGES
   ========================================= */
.table-container { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.875rem; }
.table th {
    background-color: #f9fafb; color: var(--text-muted); font-weight: 600;
    text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em;
    padding: 12px 24px; border-bottom: 1px solid var(--border-color);
}
.table td {
    padding: 16px 24px; border-bottom: 1px solid var(--border-color);
    vertical-align: middle; color: var(--text-main);
}
.table tbody tr:hover { background-color: #f9fafb; }
.table tbody tr:last-child td { border-bottom: none; }

.table-footer {
    padding: 1rem 1.5rem;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px; 
}

.table-empty { padding: 1.5rem; text-align: center; color: var(--text-muted); }

/* Klickbare Tabellenzeilen */
.table tr { position: relative; }
.table tbody tr:hover { background-color: #f8f9fa; }
.row-link::after {
    content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
}

/* Icons */
.kunden-typ-privat::before { content: '👤'; margin-right: 8px; filter: grayscale(100%); opacity: 0.7; font-size: 1.1em; }
.kunden-typ-firma::before { content: '🏢'; margin-right: 8px; filter: grayscale(100%); opacity: 0.7; font-size: 1.1em; }
.table-link { font-weight: 500; position: relative; z-index: 2; } /* z-index > row-link */
.table-link:hover { color: var(--primary)}

/* Status Badges */
.badge, .status-active, .status-inactive {
    padding: 2px 10px; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; display: inline-block;
}
.status-active, .badge-success { background-color: var(--success-bg); color: var(--success-text); }
.status-inactive, .badge-secondary { background-color: var(--inactive-bg); color: var(--inactive-text); }
.badge-danger { background-color: var(--danger-bg); color: var(--danger-text); }
.badge-warning { background-color: #fffbeb; color: #b45309; }

/* Dropdown (Actions) in Tables */
.dropdown { position: relative; display: inline-block; z-index: 5; }
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    z-index: var(--z-dropdown);
}
.dropdown:hover .dropdown-content { display: block; }
.dropdown-item {
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    color: var(--text-main);
    font-size: 0.875rem;
}
.dropdown-item:hover { background-color: #f3f4f6; }
.dropdown-item.text-danger { color: var(--danger); }

/* Pagination */
.pagination-container {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.5rem; background: #f9fafb; border-top: 1px solid var(--border-color);
}
.pagination { display: flex; list-style: none; padding: 0; margin: 0; gap: 4px; }
.page-link {
    display: flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; padding: 0 6px;
    border-radius: 6px; background: white; border: 1px solid var(--border-color);
    color: var(--text-main); font-size: 0.875rem; text-decoration: none;
}
.page-link:hover { background-color: #f3f4f6; }
.page-item.active .page-link { background-color: var(--primary); color: white; border-color: var(--primary); }
.page-item.disabled .page-link { color: #d1d5db; pointer-events: none; background-color: #f9fafb; }

/* =========================================
   13. MODALS (Overlay)
   ========================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: var(--z-modal);
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
    background: white; width: 90%; max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    transform: translateY(20px); transition: transform 0.2s;
    overflow: hidden;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
    padding: 1.25rem; border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { margin: 0; font-size: 1.1rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }

.modal-body { padding: 1.25rem; }
.modal-footer {
    padding: 1rem 1.25rem; background-color: #f9fafb; border-top: 1px solid var(--border-color);
    display: flex; justify-content: flex-end; gap: 10px;
}

/* =========================================
   14. RESPONSIVE MEDIA QUERIES
   ========================================= */
@media (min-width: 768px) {
    .details-grid {
        grid-template-columns: 2fr 1fr; /* 2/3 zu 1/3 Spalten */
        align-items: start;
    }
    .form-builder { padding: 2.5rem; }
    
    /* Desktop Sidebar Logic */
    .sidebar { transform: translateX(0); }
    .mobile-menu-toggle { display: none; }
}

@media (max-width: 768px) {
    .app-layout { flex-direction: column; }
    
    /* Mobile Sidebar: Hidden by default */
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { 
        transform: translateX(0); 
        margin-top: var(--header-height-mobile); 
        border-right: 1px solid var(--border-color); 
        box-shadow: 4px 0 10px rgba(0,0,0,0.1); 
    }
    .main-content { margin-left: 0; width: 100%; }
    
    .page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .page-header .header-buttons { width: 100%; }
    .page-header .btn { margin-top: 1rem; width: 100%; }
    .pagination-container { flex-direction: column; gap: 1rem; text-align: center; }
    
    /* Mobile Table Card View (Preserved logic) */
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; margin-bottom: 1rem; }
    .table td { 
        display: flex; justify-content: space-between; text-align: right; 
        padding: 10px 15px; border-bottom: 1px solid #f3f4f6;
    }
    
    /* Labels via CSS content */
    .table td:nth-child(1)::before { content: "Name"; font-weight: bold; color: var(--text-muted); font-size: 0.75rem; }
    .table td:nth-child(2)::before { content: "Adresse"; font-weight: bold; color: var(--text-muted); font-size: 0.75rem; }
    .table td:nth-child(3)::before { content: "E-Mail"; font-weight: bold; color: var(--text-muted); font-size: 0.75rem; }
    .table td:nth-child(4)::before { content: "Telefon"; font-weight: bold; color: var(--text-muted); font-size: 0.75rem; }
    .table td:nth-child(5)::before { content: "Status"; font-weight: bold; color: var(--text-muted); font-size: 0.75rem; }
    
    .search-form { border-radius: 8px; }
    .table-footer { border-top-left-radius: 8px; border-top-right-radius: 8px; }
    
    .details-grid { grid-template-columns: 100%; }
}

/* =========================================
   15. MOBILE NAVIGATION ERGÄNZUNGEN
   ========================================= */

/* Der Hamburger-Button (Desktop standardmäßig ausgeblendet) */
/* Mobile Toggle Button */
.mobile-menu-toggle {
    display: none; /* Standard: Auf Desktop ausgeblendet */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 0.75rem; /* Abstand zum Inhalt rechts */
    color: var(--text-muted);
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 0; /* Verhindert seltsame Abstände bei SVGs */
}

.mobile-menu-toggle:hover {
    color: var(--primary);
    background-color: #f3f4f6;
}

/* WICHTIG: Auf mobilen Geräten einblenden */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: inline-flex; /* Hier wird er sichtbar gemacht! */
        align-items: center;
        justify-content: center;
    }
}

/* Das Overlay (Hintergrund abdunkeln) */
.sidebar-overlay {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40; /* Unter der Sidebar (50), aber über dem Content */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
    backdrop-filter: blur(2px); /* Moderner Glas-Effekt */
}

/* Zustand: Wenn Sidebar offen ist */
.sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* User Menü nach rechts schieben */
.user-menu {
    margin-left: auto; 
}

/* --- Mobile Anpassungen (Media Query Update) --- */
@media (max-width: 768px) {
    /* Button sichtbar machen */
    .mobile-menu-toggle {
        display: block;
    }

    /* Top Nav Anpassung für Mobile */
    .top-nav {
        padding: 0 1rem; /* Weniger Padding mobil */
        height: var(--header-height-mobile);
        justify-content: flex-start; /* Links ausrichten */
    }
}

/* =========================================
   LOGIN / AUTH PAGE
   ========================================= */

.login-box {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 400px; /* Optimale Breite für Login */
    padding: 2.5rem;  /* Viel Weißraum wirkt edel */
    border-radius: 12px;
    
    /* Sanfter Schatten für Tiefe */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                0 2px 4px -1px rgba(0, 0, 0, 0.06);
    
    /* Feiner Rand, passend zum restlichen Design */
    border: 1px solid var(--border-color);
    
    /* Sicherstellen, dass es zentriert bleibt (falls Parent nicht flex ist) */
    margin: 0 auto; 
}

/* Überschrift */
.login-box h1 {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-main);
    margin-top: 0;
    margin-bottom: 2rem;
}

/* Labels */
.login-box label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    margin-top: 1.25rem; /* Abstand zum vorherigen Feld */
}

/* Das erste Label braucht keinen Abstand nach oben */
.login-box label:first-of-type {
    margin-top: 0;
}

/* Inputs (Design wie .form-control) */
.login-box input[type="email"],
.login-box input[type="password"] {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem; /* Etwas größer für Login-Fokus */
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-main);
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    outline: none;
    font-family: inherit;
    /* iOS Input Reset */
    -webkit-appearance: none; appearance: none;
}

.login-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(56, 125, 128, 0.15); /* Dein Primary Color transparent */
}

/* Submit Button (Design wie .btn-primary) */
.login-box button[type="submit"] {
    display: inline-block;
    width: 100%; /* Volle Breite */
    margin-top: 2rem;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    color: #fff;
    background-color: var(--primary);
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-box button[type="submit"]:hover {
    background-color: var(--primary-hover);
}