:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --background: #f1f5f9;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-light: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --success: #22c55e;
    --radius: 20px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    /* Ein leichter blauer Gradient für den App-Look */
    background-image: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

/* Navbar im App-Look (wie ein Header) */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

.navbar .logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 50px; /* Pill shape */
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #cbd5e1;
}

.btn-ghost {
    background-color: transparent;
    color: var(--primary);
}
.btn-ghost:hover {
    background-color: var(--primary-light);
}

/* Glass/App Cards */
.glass-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    margin-bottom: 1.5rem;
}

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

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: #f8fafc;
    color: var(--text-main);
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #fff;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Dashboard Filter Pills */
.filter-pills {
    display: flex;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 50px;
    gap: 0.25rem;
    overflow-x: auto;
}

.filter-pill {
    flex: 1;
    text-align: center;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: transparent;
    white-space: nowrap;
}

.filter-pill.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Chart Container & Overlays */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    margin-top: 1rem;
}

.chart-header {
    text-align: center;
    margin-bottom: 1rem;
}

.chart-header .main-val {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.chart-header .sub-val {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Floating Info Boxes over chart */
.floating-box {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: inline-block;
}

.floating-box.blue {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: white;
    border: none;
}

.floating-box.green {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: white;
    border: none;
}

/* Calendar Grid */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    text-align: center;
}

.calendar-day-header {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.9rem;
    color: var(--text-main);
    background: #f8fafc;
    position: relative;
}

.calendar-day.has-entry {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: bold;
}

.calendar-day.has-entry::after {
    content: '✓';
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--primary);
    color: white;
    font-size: 0.5rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.calendar-day.empty {
    background: transparent;
    color: transparent;
}

/* Toggle Switches */
.toggle-group {
    display: flex;
    background: #f1f5f9;
    border-radius: 50px;
    padding: 0.25rem;
}

.toggle-btn {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
}

.toggle-btn.active {
    background: var(--primary);
    color: white;
}

.toggle-btn.active.female {
    background: #ec4899;
}

/* Alert */
.alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-weight: 500;
}
.alert-success {
    background: #dcfce7;
    color: #166534;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal.active {
    display: flex;
}
.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Responsive Overrides */
@media(min-width: 768px) {
    .glass-card {
        padding: 2rem;
    }
}

/* Print Styles for PDF / Print feature */
@media print {
    /* Hide everything we don't want to print */
    nav.navbar, 
    .btn, 
    .filter-pills,
    .glass-card:not(.print-section),
    .modal,
    .alert,
    .new-message-alert /* Just in case */ {
        display: none !important;
    }

    body {
        background: white !important;
        background-image: none !important;
        margin: 0;
        padding: 0;
        min-height: auto;
    }

    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .print-section {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
    }

    .chart-scroll-wrapper {
        overflow: visible !important;
    }

    /* Keep the floating boxes styled properly */
    .floating-box {
        border: 1px solid #ccc !important;
        color: #000 !important;
        background: #fff !important;
    }
}
