:root { 
    --bg: #f6f2ff; 
    --accent: #dcc9ff; 
    --dark: #5a4a75; 
    --white: #ffffff; 
    --danger: #e74c3c;
    --login-purple: var(--dark); 
}

/* Grund-Setup */
* { box-sizing: border-box; } 

body { 
    font-family: 'Segoe UI', sans-serif; 
    background: var(--bg); 
    color: var(--dark); 
    margin: 0; 
    padding: 20px; 
}

/* Navigation */
nav { 
    background: var(--white); 
    padding: 10px 20px; 
    border-radius: 12px; 
    margin-bottom: 20px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
}
.nav-links { display: flex; gap: 10px; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--dark); font-weight: bold; padding: 8px 12px; border-radius: 6px; font-size: 0.9rem; }
nav a:hover { background: var(--accent); }

/* Karten */
.card { 
    background: var(--white); 
    padding: 25px; 
    border-radius: 15px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    max-width: 900px; 
    margin: 20px auto; 
    width: 100%; 
}
h2 { border-left: 5px solid var(--accent); padding-left: 10px; margin-bottom: 20px; }

/* Formulare */
label { display: block; margin-top: 12px; font-weight: 600; font-size: 0.85rem; }
input, select, textarea { 
    width: 100%; 
    padding: 12px; 
    margin-top: 5px; 
    border: 1px solid #ddd; 
    border-radius: 8px; 
    box-sizing: border-box; 
    background: #fafafa; 
    font-size: 16px; 
}
button { background: var(--dark); color: white; border: none; padding: 14px; border-radius: 8px; cursor: pointer; margin-top: 15px; width: 100%; font-weight: bold; transition: opacity 0.2s; }
button:hover { opacity: 0.9; }
button.secondary { background: #eee; color: #333; width: auto; padding: 5px 10px; font-size: 0.8rem; }

/* Statistik Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; margin-top: 20px; }
.stat-card { background: #fafafa; border: 1px solid #eee; padding: 15px; border-radius: 12px; text-align: center; }
.stat-card h4 { margin: 0; color: #888; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .val { font-size: 1.6rem; font-weight: bold; color: var(--dark); margin: 5px 0; }
.stat-card .unit { font-size: 0.8rem; color: #aaa; }

/* Benachrichtigungs-System */
.notification-container { position: relative; cursor: pointer; padding: 5px; }
.badge { position: absolute; top: -2px; right: -2px; background: var(--danger); color: white; border-radius: 50%; padding: 2px 6px; font-size: 0.7rem; font-weight: bold; border: 2px solid white; }
.notif-dropdown { position: absolute; top: 45px; right: 0; width: 280px; background: white; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); display: none; z-index: 1000; border: 1px solid #eee; }
.notif-dropdown.show { display: block; }
.notif-header { padding: 12px; border-bottom: 1px solid #eee; font-weight: bold; display: flex; justify-content: space-between; font-size: 0.85rem; }
.notif-list { max-height: 350px; overflow-y: auto; text-align: left; }
.notif-item { padding: 12px; border-bottom: 1px solid #f9f9f9; font-size: 0.85rem; }
.notif-item.unread { background: #fdfaff; border-left: 4px solid var(--dark); }

/* Tabellen & Listen */
.table-wrapper { overflow-x: auto; } 
table { width: 100%; border-collapse: collapse; margin-top: 15px; font-size: 0.9rem; min-width: 400px; }
th, td { padding: 10px; border-bottom: 1px solid #eee; text-align: left; }
th { background: #f9f9f9; color: #777; }
.abs-list-item { background: #fafafa; padding: 12px; border-radius: 8px; margin-bottom: 8px; border-left: 4px solid var(--accent); }

/* Hilfsklassen */
.hidden { display: none !important; }
footer { text-align: center; margin-top: 40px; padding: 20px; font-size: 0.8rem; color: #999; }

/* Login Design */
.login-screen { display: flex; align-items: center; justify-content: center; min-height: 85vh; }
.login-card { background: var(--white) !important; max-width: 340px !important; width: 90%; padding: 50px 40px !important; text-align: center; border-radius: 35px !important; box-shadow: 0 12px 35px rgba(0,0,0,0.07) !important; }
.login-card h1 { color: var(--login-purple) !important; font-size: 1.9rem; font-weight: bold; margin-top: 0; margin-bottom: 10px; }
.login-card p { color: #a0a0a0; font-size: 0.9rem; margin-bottom: 35px; }
.login-card input { background: #fdfbff !important; border: 1px solid #efefef !important; padding: 15px; margin-bottom: 18px; border-radius: 15px !important; }
.login-btn { background: var(--login-purple) !important; color: white !important; padding: 16px !important; font-size: 1rem !important; border-radius: 16px !important; margin-top: 10px !important; box-shadow: 0 8px 20px rgba(90, 74, 117, 0.2) !important; }

/* =========================================
   NEU: MOBILE ANPASSUNGEN (RESPONSIVE)
   ========================================= */
@media (max-width: 600px) {
    body { padding: 10px; }
    
    nav { 
        flex-direction: column; 
        gap: 10px; 
        padding: 15px; 
        text-align: center; 
    }
    
    .nav-links { justify-content: center; }
    
    .card { 
        padding: 15px; 
        margin: 10px auto; 
    }

    /* FIX: Verhindert das Quetschen von Elementen in Karten */
    .card div[style*="display: flex"] {
        flex-direction: column !important;
    }
    
    .card div[style*="flex: 1"], 
    .card div[style*="flex: 0"] {
        width: 100% !important;
        flex: none !important;
    }

    .login-card { 
        padding: 30px 20px !important; 
    }

    table { font-size: 0.8rem; }
    
    #signature-pad { height: 180px !important; }
}