:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --dark: #1e293b;
    --border: #e2e8f0;
    --bg-main: #f8fafc;
    --danger: #ef4444;
}

/* Grund-Setup: Verhindert Scrollen auf der ganzen Seite */
* { box-sizing: border-box; }
html, body { 
    margin: 0; 
    padding: 0; 
    height: 100vh; 
    width: 100vw; 
    font-family: 'Segoe UI', system-ui, sans-serif; 
    overflow: hidden; 
}

#wrapper { 
    display: flex; 
    height: 100vh; 
    width: 100vw; 
}

/* Sidebar */
#sidebar { 
    width: 260px; 
    background: var(--dark); 
    color: white; 
    transition: margin-left 0.3s ease; 
    flex-shrink: 0; 
}
#sidebar.collapsed { margin-left: -260px; }
#toggle-sidebar { 
    position: absolute; right: -30px; top: 20px; width: 30px; height: 50px; 
    background: var(--dark); border: none; color: white; cursor: pointer; border-radius: 0 8px 8px 0; 
}
.sidebar-inner { padding: 30px 20px; }

/* RECHTE SEITE: Layout-Fix */
#main-content { 
    flex: 1; 
    display: flex; 
    flex-direction: column; /* Header oben, Grid unten */
    height: 100vh; 
    overflow: hidden; /* Wichtig: Main selbst darf nicht scrollen */
}

.top-nav { 
    background: white; 
    padding: 15px 30px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid var(--border);
    flex-shrink: 0; /* Header behält seine Höhe */
}

/* DAS SCROLLBARE GRID */
#calendar-grid { 
    flex: 1; /* Nimmt den restlichen Platz ein */
    overflow-y: auto; /* HIER passiert das vertikale Scrollen */
    padding: 20px; 
    display: grid; 
    gap: 12px; 
    grid-template-columns: repeat(7, 1fr); 
    align-content: start; 
    background: var(--bg-main);
}

/* Zellen-Design */
.day-cell { 
    background: white; 
    border-radius: 12px; 
    border: 1px solid var(--border); 
    padding: 10px; 
    height: 200px; /* Feste Höhe, damit Scrollen bei vielen Wochen nötig wird */
    cursor: pointer; 
    display: flex; 
    flex-direction: column; 
    transition: 0.2s;
}
.day-cell:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

.day-cell.today { 
    border-top: 5px solid var(--primary); 
    background: #f0f7ff; 
}

.day-header { font-weight: bold; font-size: 0.85rem; color: #94a3b8; margin-bottom: 5px; flex-shrink: 0; }

/* Scrollbarer Text INNERHALB des Tages */
.content-preview { 
    flex: 1; 
    overflow-y: auto; 
    font-size: 0.85rem; 
    scrollbar-width: thin; 
}
.content-preview img { width: 100%; border-radius: 6px; margin-top: 5px; display: block; }

/* Navigation Buttons */
.navigation-bar { display: flex; align-items: center; gap: 10px; }
.nav-group { display: flex; align-items: center; background: #f1f5f9; padding: 4px; border-radius: 10px; }
.view-btn { border: none; background: transparent; padding: 6px 12px; cursor: pointer; border-radius: 6px; font-weight: 600; color: #64748b; }
.view-btn.active { background: white; color: var(--primary); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.btn-icon { background: transparent; border: none; cursor: pointer; padding: 5px 10px; font-size: 1rem; }
.btn { border: none; padding: 8px 15px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.btn-primary { background: var(--primary); color: white; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: center; z-index: 9999; }
.hidden { display: none !important; }
.modal-content { background: white; padding: 25px; border-radius: 20px; width: 450px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2); }
textarea { width: 100%; height: 120px; border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin: 10px 0; }