/* --- 1. MODERN FONTS & VARIABLES --- */
:root {
    /* Deine Brand-Farbe als Basis */
    --brand-dark: #083474;
    --brand-light: #1059b0;
    --brand-accent: #00d4ff; /* Ein moderner Cyan-Akzent */
    
    /* Hintergrund & Flächen */
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    
    /* Text */
    --text-main: #2d3748;
    --text-muted: #718096;
    
    /* UI Elemente */
    --radius-small: 8px;
    --radius-large: 16px;
    --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    background-color: var(--bg-body);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    /* Ein feines Muster im Hintergrund für mehr Textur */
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 24px 24px;
}

/* --- 2. LAYOUT CONTAINER (Glassmorphism Header) --- */
div.header, div.content {
    width: 94%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px;
    box-sizing: border-box;
}

div.header {
    /* Cooler Gradient statt flacher Farbe */
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-light) 100%);
    color: white;
    border-radius: 0 0 var(--radius-large) var(--radius-large);
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    position: relative; 
    display: flex;
    justify-content: center; /* Zentriert den Text */
    align-items: center;     /* Zentriert vertikal */
    min-height: 160px;       /* Genug Platz für das Logo reservieren */
}

/* Dekorativer Glanz-Effekt im Header */
div.header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    filter: blur(40px);
}

/* Das Logo Styling */
.header-logo {
    position: absolute;      /* Löst das Logo aus dem Fluss */
    right: 30px;              /* Abstand von links */
    top: 50%;                /* Vertikale Mitte */
    transform: translateY(-50%); /* Exakte Zentrierung */
    max-height: 140px;        /* Maximale Höhe (anpassen nach Geschmack) */
    width: auto;             /* Seitenverhältnis beibehalten */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); /* Leichter Schatten für Tiefe */
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: translateY(-50%) scale(1.05); /* Leichter Zoom beim Drüberfahren */
}

/* Der Text Container */
.header-text {
    text-align: center;
    z-index: 1; /* Damit der Text über eventuellen Dekorationen liegt */
}

.header h1 {
    text-align: center;
    margin: 0 0 15px 0;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Moderne Navigation als "Pills" */
.header a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    margin: 0 5px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.1); /* Leicht transparent */
    display: inline-block;
}

.header a:hover {
    background: white;
    color: var(--brand-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

div.content {
    background-color: var(--bg-card);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-soft);
    min-height: 60vh;
    border: 1px solid rgba(255,255,255,0.8);
}

/* --- 3. FORMULARE & INPUTS (Modern & Clean) --- */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--brand-dark);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Inputs mit weichem Fokus */
input[type=text], 
input[type=password], 
input[type=email], 
input[type=date],
input[type=number],
select,
textarea {
    width: 100%;
    max-width: 450px;
    padding: 12px 16px;
    margin-bottom: 20px;
    box-sizing: border-box;
    
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-small);
    background-color: #f8fafc;
    
    font-family: inherit;
    font-size: 15px;
    color: var(--text-main);
    
    transition: all 0.3s ease;
    display: block;
}

input:focus, textarea:focus, select:focus {
    background-color: #fff;
    border-color: var(--brand-light);
    box-shadow: 0 0 0 4px rgba(16, 89, 176, 0.15); /* Blauer Glow */
    outline: none;
}

/* Button Styling: Gradient & Lift Effect */
input[type=submit], button {
    background: linear-gradient(to right, var(--brand-dark), var(--brand-light));
    border: none;
    color: white;
    padding: 14px 32px;
    text-decoration: none;
    margin: 15px 0;
    cursor: pointer;
    border-radius: 50px; /* Pill Shape */
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(8, 52, 116, 0.2);
    display: inline-block;
}

input[type=submit]:hover, button:hover {
    transform: translateY(-2px); /* Hebt sich an */
    box-shadow: 0 10px 15px rgba(8, 52, 116, 0.3);
    filter: brightness(1.1);
}

/* Fieldset als "Card" im Content */
fieldset {
    border: 1px solid #edf2f7;
    border-radius: var(--radius-large);
    padding: 30px;
    margin-bottom: 30px;
    background-color: #ffffff;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);
    
    /* FIX für Tabelle */
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

legend {
    font-weight: 700;
    color: var(--brand-dark);
    padding: 5px 15px;
    background: #e2e8f0;
    border-radius: 20px;
    font-size: 0.9em;
}

/* Custom Checkbox/Radio (einfacher Hack für bessere Optik) */
input[type=radio], input[type=checkbox] {
    accent-color: var(--brand-dark); /* Modern browsers only */
    width: 18px;
    height: 18px;
    margin-right: 10px;
    vertical-align: middle;
    display: inline-block;
}

/* --- 4. TABELLEN (Fancy Data Grid) --- */
.table-wrapper {
    display: block;
    width: 100%;
    /* Scrollbalken anzeigen, wenn Inhalt breiter ist als der Bildschirm */
    overflow-x: auto; 
    
    margin-bottom: 20px;
    border: 1px solid #eee;
    background-color: #fff;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
}

.table-wrapper table {
    /* WICHTIG: width: auto verhindert, dass die Tabelle künstlich 
       auf 100% aufgeblasen wird. Sie ist jetzt nur so breit wie der Inhalt. */
    width: auto; 
    
    /* Falls die Tabelle sehr klein ist, soll sie trotzdem nicht gequetscht wirken */
    min-width: 50%; 
    
    margin-bottom: 0;
    border: none;
    box-shadow: none;
}

/* Header */
.table-wrapper th, 
.table-wrapper td {
    white-space: nowrap; 
    padding: 8px 12px; /* Etwas mehr Platz horizontal */
    font-size: 0.9em; 
    vertical-align: middle;
}

/* Zellen */
.table-wrapper td {
    padding: 12px 15px;
    border-bottom: 1px solid #edf2f7;
    color: var(--text-main);
    font-size: 0.9em;
    vertical-align: middle;
    white-space: nowrap;
}

/* Hover Effekt für Zeilen */
.table-wrapper tr:hover td {
    background-color: #f1f7ff; /* Ganz helles Blau beim Drüberfahren */
    transition: background-color 0.2s;
}

/* Zahlen rechtsbündig und monospaced für bessere Lesbarkeit */
.table-wrapper td:nth-child(n+3):nth-child(-n+12) {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* KORREKTUR: Die letzte Spalte ("Montage" oder "AI") */
/* Wir entfernen die erzwungene Breite von vorher, damit Zahlenspalten klein bleiben */
.table-wrapper td:last-child, 
.table-wrapper th:last-child {
    white-space: nowrap; /* Zahlen sollen nicht umbrechen */
    width: auto;         /* Automatische Breite */
    min-width: auto;     /* Keine Mindestbreite mehr erzwingen */
    max-width: none;
}

/* --- 5. FOOTER --- */
.footer {
    width: 94%;
    max-width: 1600px;
    margin: 40px auto 20px auto;
    text-align: center;
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 1.0em;
    border-top: 1px solid #e2e8f0;
}

.footer a {
    color: var(--brand-light);
    text-decoration: none;
    font-weight: 600;
    margin: 0 10px;
}

.footer a:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}

/* --- 6. DRAG & DROP & HELPERS --- */
#drop_file_zone {
    background-color: #f8fafc;
    border: 2px dashed #cbd5e0;
    border-radius: var(--radius-large);
    width: 100%;
    max-width: 500px;
    height: 180px;
    padding: 20px;
    font-size: 16px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    transition: all 0.3s;
}

#drop_file_zone:hover {
    border-color: var(--brand-light);
    background-color: #ebf8ff;
    transform: scale(1.01);
}

/* --- RESPONSIVE (Handy) --- */
@media (max-width: 768px) {
    div.header {
        flex-direction: column; /* Untereinander statt nebeneinander */
        padding-top: 20px;
        padding-bottom: 20px;
        height: auto;
    }

    .header-logo {
        position: static; /* Auf Handy nicht absolut, sondern normal im Fluss */
        transform: none;
        margin-bottom: 15px;
        max-height: 70px;
    }
}

/* --- FIX FÜR LOGO TRANSPARENZ --- */

/* Wir entfernen den "Button-Look" vom Link, der das Logo umschließt */
.header a.logo-link {
    background: transparent !important; /* Hintergrund entfernen */
    box-shadow: none !important;        /* Schatten entfernen */
    padding: 0 !important;              /* Innenabstand entfernen */
    transform: none !important;         /* Bewegungseffekt entfernen */
    border: none !important;
}

/* Wir stellen sicher, dass das Bild selbst keinen Hintergrund hat */
.header-logo {
    background-color: transparent;
    border: none;
    box-shadow: none;
    /* Optional: Ein schöner Schatten, der NUR die Kontur des Logos betont (nicht den Kasten) */
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3)); 
}

/* --- SPEZIAL: VOLLE BILDSCHIRMBREITE (Korrigiert) --- */
div.content.full-width {
    /* Wir setzen die Breite auf die gleichen Werte wie den Header */
    width: 94%;           
    max-width: 1600px;    
    
    margin: 0 auto;       /* Zentriert den Block */
    padding-left: 20px;
    padding-right: 20px;
}