/* --- BASIS-EINSTELLUNGEN --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #fafafa;
    color: #1a1a1a;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- LAYOUT GRID --- */
.app-container {
    display: grid;
    grid-template-columns: 320px 1fr; /* HIER GEÄNDERT: Menü links (320px), Inhalt rechts (Rest) */
    min-height: 100vh;
}

/* --- LINKE SEITENLEISTE --- */
.sidebar {
    background-color: #ffffff;
    border-right: 1px solid #eaeaea; /* HIER GEÄNDERT: Trennlinie nach rechts verschoben */
    padding: 4rem 2rem;
}

/* Hält den Inhalt der Seitenleiste beim Scrollen im Blick */
.sidebar-sticky {
    position: sticky;
    top: 4rem;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 8rem);
}

/* Profilbereich */
.profile-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
} 

.profile-avatar {
    width: 44px;
    height: 44px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.profile-info h3 {
    font-size: 1rem;
    font-weight: 600;
}

.profile-role {
    font-size: 0.8rem;
    color: #888;
    margin: 0;
}

/* Navigation */
.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.6rem 0.8rem;
    color: #666;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.sidebar-nav a:hover {
    background-color: #f5f5f5;
    color: #000;
}

.sidebar-nav a.active {
    background-color: #1a1a1a;
    color: #fff;
    font-weight: 500;
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.75rem;
    color: #aaa;
}

/* --- HAUPTBEREICH (Rechts) --- */
.main-content {
    padding: 4rem 8% 4rem 5%;
    max-width: 1400px; /* HIER ERHÖHT: Gibt der Tabelle deutlich mehr Raum zum Atmen */
}

.content-section {
    margin-bottom: 3.5rem;
}

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}

p {
    color: #555;
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.lead-text {
    font-size: 1.2rem;
    color: #333;
}

hr {
    border: 0;
    height: 1px;
    background: #eaeaea;
    margin: 3.5rem 0;
}

/* --- ELEMENT-STYLING (Bilder, Tabellen, Formulare) --- */

/* Bildplatzhalter */
.placeholder-image {
    width: 100%;
    height: 250px;
    background-color: #eaeaea;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.9rem;
}

/* Tabellen */
.table-container {
    width: 100%;
    overflow-x: auto; /* Erlaubt horizontales Scrollen nur für die Tabelle, falls nötig */
    margin-top: 1rem;
    -webkit-overflow-scrolling: touch; /* Macht das Scrollen auf iPhones/iPads flüssiger */
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

th, td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #eaeaea;
}

th {
    font-weight: 600;
    color: #000;
    background-color: #f7f7f7;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: #e6f4ea; color: #137333; }
.badge-warning { background: #fef7e0; color: #b06000; }

/* Formulare */
.standard-form {
    margin-top: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.25rem;
    flex: 1;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #333;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: #fff;
    color: #1a1a1a;
    transition: border-color 0.2s;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: #1a1a1a;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background-color: #1a1a1a;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #333;
}

/* --- DESKTOP MENÜ EINKLAPPEN (COLLAPSE) --- */
.app-container {
    transition: grid-template-columns 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.sidebar {
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), padding 0.4s ease;
    overflow-x: hidden; /* Verhindert Umbrüche beim Zusammenschieben */
}

/* Der eingeklappte Zustand */
.app-container.sidebar-collapsed {
    grid-template-columns: 0px 1fr;
}

.app-container.sidebar-collapsed .sidebar {
    padding-left: 0;
    padding-right: 0;
    transform: translateX(-100%);
    border-right: none;
}

/* Button innerhalb der Leiste (zum Einklappen) */
.sidebar-close-btn {
    background: transparent;
    border: 1px solid #eaeaea;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}

.sidebar-close-btn:hover {
    background-color: #f5f5f5;
    color: #1a1a1a;
}

/* Schwebender Button auf der Hauptseite (zum Ausklappen) */
.desktop-toggle-btn {
    display: none; /* Standardmäßig versteckt */
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 999;
    background: #1a1a1a;
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: background 0.2s, transform 0.2s;
}

.desktop-toggle-btn:hover {
    background: #333;
    transform: scale(1.05);
}

/* Nur auf großen Bildschirmen und nur wenn eingeklappt anzeigen */
@media (min-width: 769px) {
    .app-container.sidebar-collapsed .desktop-toggle-btn {
        display: flex;
    }
}

/* Standard-Einstellung für Desktop: Mobile-Header ausblenden */
.sidebar-mobile-header {
    display: none;
}

/* --- RESPONSIVENESS (Mobile Geräte) --- */
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    
    /* Die Sidebar wird zum festen Header-Balken */
    .sidebar {
        border-right: none;
        border-bottom: 1px solid #eaeaea;
        order: -1; 
        padding: 0; 
        position: sticky;
        top: 0;
        z-index: 1000;
        background-color: #ffffff;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }

    .desktop-toggle-btn {
        display: none !important;
    }

    .sidebar-close-btn {
        display: none;
    }

    /* Der feste, immer sichtbare Header */
    .sidebar-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.5rem;
        width: 100%;
        background-color: #ffffff;
        /* Wir setzen einen eigenen Z-Index, damit er über dem aufgeklappten Menü bleibt */
        position: relative; 
        z-index: 1002; 
    }
    
    .mobile-logo-text {
        font-weight: 700;
        font-size: 1.1rem;
        letter-spacing: -0.01em;
        color: #1a1a1a;
    }

    /* Hamburger-Button */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1003;
    }

    .menu-toggle .hamburger-bar {
        width: 100%;
        height: 2px;
        background-color: #1a1a1a;
        border-radius: 2px;
        transition: all 0.25s ease-in-out;
    }
    
    /* --- DAS AUFKLAPPBARE MENÜ --- */
    .sidebar .sidebar-sticky {
        display: flex;
        flex-direction: column;
        /* Position Fix für Overlay */
        position: fixed;
        top: 0; /* Beginnt ganz oben, hinter dem Header */
        left: 0;
        right: 0;
        bottom: 0; /* Nimmt die ganze Bildschirmhöhe ein */
        background-color: #ffffff;
        z-index: 1001; /* Unterhalb des Headers (1002), aber über allem anderen */
        
        /* Startzustand: Versteckt, nach oben verschoben */
        transform: translateY(-100%);
        visibility: hidden;
        opacity: 0;
        
        /* Padding für den Inhalt (Abstand oben, damit es nicht unter dem Header verschwindet) */
        padding: 5rem 1.5rem 2rem 1.5rem; 
        
        /* Wichtig: Erlaubt das Scrollen *innerhalb* des Menüs, falls es sehr lang ist */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        
        transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease, visibility 0.4s;
    }
    
    /* Endzustand: Ausgeklappt */
    .sidebar.open .sidebar-sticky {
        transform: translateY(0);
        visibility: visible;
        opacity: 1;
    }

    /* --- ANIMATION: Hamburger transformiert sich zum "X" --- */
    .sidebar.open .menu-toggle .hamburger-bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .sidebar.open .menu-toggle .hamburger-bar:nth-child(2) {
        opacity: 0;
        transform: translateX(-10px);
    }
    
    .sidebar.open .menu-toggle .hamburger-bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .main-content {
        padding: 2rem 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .profile-area {
        margin-bottom: 1.5rem;
    }
}

/* --- LOGIN SEKTION ERWEITERUNG --- */

/* Begrenzt das Login-Formular auf eine angenehme Breite innerhalb des Main-Contents */
.custom-login-form {
    max-width: 450px;
}

/* Macht den Container zur Basis für die absolute Positionierung des Auges */
.password-group-container {
    position: relative;
}

/* Verhindert, dass der Text hinter das Auge rutscht */
.password-group-container input {
    padding-right: 2.8rem; 
}

/* Positioniert das Auge exakt rechts im Input-Feld */
.toggle-password-btn {
    position: absolute;
    right: 12px;
    bottom: 9px; /* Richtet das Auge vertikal im Input aus */
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: #888;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password-btn:hover {
    color: #1a1a1a;
}

.toggle-password-btn:focus {
    outline: none;
}

/* --- FORMULAR ERWEITERUNGEN --- */

/* 3-Spalten Layout auf großen Bildschirmen */
@media (min-width: 769px) {
    .flex-3-columns {
        display: flex;
        gap: 1.5rem;
    }
    .flex-3-columns .form-group {
        flex: 1;
    }
}

/* Kleine Boxen begrenzen (z.B. Kürzel) */
.max-width-small {
    max-width: 150px;
}

/* Info-Anzeige für die Kurzbeschreibung */
.info-output-box {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 6px;
    border-left: 3px solid #1a1a1a;
}
.dynamic-description {
    margin: 0;
    color: #333;
    font-size: 0.95rem;
    
    /* NEU: Zwingt HTML dazu, die echten Zeilenumbrüche aus der DB anzuzeigen */
    white-space: pre-line; 
}

/* Fehlermeldungen unter Selects/Inputs */
.error-message {
    color: #d93025;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    font-weight: 500;
    display: none; /* Wird via JS eingeblendet, wenn benötigt */
}

/* --- CHECKLISTE (SCHRITTE) --- */
.checklist-section {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.checklist-header {
    margin-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.5rem;
}
.checklist-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}
.checklist-header span {
    font-size: 0.8rem;
    color: #888;
}
.steps-list {
    list-style: none;
}
.step-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #fafafa;
}
.step-item:last-child {
    border-bottom: none;
}
.step-item label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: normal;
    margin: 0;
}
.step-item input[type="checkbox"] {
    width: auto;
    margin-top: 0.25rem;
    cursor: pointer;
}

/* --- RADIO BUTTONS (ERGEBNIS) --- */
.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}
.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}
.radio-label input[type="radio"] {
    width: auto;
    cursor: pointer;
}
.custom-radio-text {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}
.state-success { background-color: #e6f4ea; color: #137333; }
.state-fail { background-color: #fce8e6; color: #c5221f; }

/* --- FILE UPLOAD ZONE --- */
.file-upload-zone {
    border: 2px dashed #dcdcdc;
    padding: 1.5rem;
    border-radius: 6px;
    text-align: center;
    background: #fff;
    transition: background 0.2s;
}
.file-upload-zone:hover {
    background: #fdfdfd;
    border-color: #1a1a1a;
}
.upload-hint {
    margin: 0.5rem 0 0 0;
    font-size: 0.8rem;
    color: #666;
}

/* --- ACTION BUTTONS & FEEDBACK --- */
.form-actions-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2.5rem;
    border-top: 1px solid #eaeaea;
    padding-top: 1.5rem;
}
.button-group {
    display: flex;
    gap: 1rem;
}
.btn-secondary {
    background: transparent;
    color: #666;
    border: 1px solid #dcdcdc;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover {
    border-color: #1a1a1a;
    color: #000;
}
.btn-secondary-search {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.btn-secondary-search:hover {
    background: #e5e5e5;
}

/* --- UNTERE HELP-BOX --- */
.help-box {
    display: flex;
    gap: 1rem;
    background-color: #f1f5f9;
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 2rem;
    align-items: flex-start;
}
.help-box p {
    font-size: 0.9rem;
    color: #334155;
    margin: 0;
}

/* --- FORMATIERUNG DYNAMISCHE ERGEBNISTABELLE --- */

/* Text linksbündig ausrichten und Monospace für IDs */
.text-mono {
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85rem;
    color: #666;
}

.text-muted {
    font-size: 0.85rem;
    color: #888;
}

/* Formatierung für die verschachtelten Anmerkungen & Schritte */
.table-note-block {
    margin-bottom: 0.6rem;
    color: #1a1a1a;
}

.table-steps-block {
    font-size: 0.9rem;
    color: #555;
    background-color: #fafafa;
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 2px solid #eaeaea;
}

/* Schicke, dezente Download-Links für Dateianhänge */
.table-file-link {
    display: inline-block;
    background: #f0f4f8;
    color: #1e3a8a;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    text-decoration: none;
    margin-bottom: 0.25rem;
    font-weight: 500;
    transition: background 0.2s;
}

.table-file-link:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Suchfeld-Layout */
.table-actions {
    margin-bottom: 1.25rem;
}
.max-width-medium {
    max-width: 350px;
    width: 100%;
}
.table-no-results {
    padding: 2.5rem;
    text-align: center;
    color: #888;
    background: #fff;
    border: 1px dashed #eaeaea;
    border-top: none;
}

/* Verhindert, dass die Tabelle über den Rand gedrückt wird */
#ergebnisTabelle {
    width: 100%;
    table-layout: auto; /* Ermöglicht dynamische Breitenberechnung */
    border-collapse: collapse;
}

/* Den Spalten sinnvolle Breiten-Vorgaben geben */
#ergebnisTabelle th:nth-child(1), #ergebnisTabelle td:nth-child(1) { width: 5%; }  /* Lfd */
#ergebnisTabelle th:nth-child(2), #ergebnisTabelle td:nth-child(2) { width: 15%; } /* ID */
#ergebnisTabelle th:nth-child(3), #ergebnisTabelle td:nth-child(3) { width: 5%; }  /* Nr. */
#ergebnisTabelle th:nth-child(4), #ergebnisTabelle td:nth-child(4) { width: 8%; }  /* Tester */
#ergebnisTabelle th:nth-child(5), #ergebnisTabelle td:nth-child(5) { width: 12%; } /* Ergebnis */
#ergebnisTabelle th:nth-child(7), #ergebnisTabelle td:nth-child(7) { width: 12%; } /* Zeitstempel */
#ergebnisTabelle th:nth-child(8), #ergebnisTabelle td:nth-child(8) { width: 10%; } /* Dateien */

/* Die kritische Text-Spalte für Anmerkungen & Schritte optimieren */
#ergebnisTabelle th:nth-child(6), #ergebnisTabelle td:nth-child(6) {
    width: 33%;
    white-space: normal;       /* Erlaubt normalen Zeilenumbruch */
    word-break: break-word;    /* Bricht extrem lange Wörter (z.B. Log-Outputs) radikal um */
    min-width: 280px;          /* Verhindert, dass die wichtigste Spalte zu stark gequetscht wird */
}

/* --- COMPACT WORKSPACE BADGE --- */
.profile-workspace {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
    background-color: #f5f5f5;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    width: fit-content;
}

.workspace-dot {
    width: 8px;
    height: 8px;
    background-color: #137333; /* Gleiches Grün wie unsere "Aktiv" Badges */
    border-radius: 50%;
    display: inline-block;
}

.workspace-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #444;
}

/* --- AUTOCOMPLETE SUCHFELD --- */
#schnellsuche_bereich {
    position: relative; /* Wichtig, damit die Liste direkt unter dem Input schwebt */
}

.autocomplete-items {
    position: absolute;
    border: 1px solid #dcdcdc;
    border-bottom: none;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #fff;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none; /* Standardmäßig versteckt */
    max-height: 250px;
    overflow-y: auto;
}

.autocomplete-items li {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eaeaea;
    font-size: 0.9rem;
    color: #1a1a1a;
}

.autocomplete-items li:hover {
    background-color: #f5f5f5;
}

.search-desc {
    color: #666;
    font-size: 0.85rem;
}

/* --- RADIO BUTTON STATUS FARBEN --- */

/* Versteckt den Standard-Radio-Button (optional, falls du nur die farbigen Boxen klickbar machen willst) */
/* .radio-label input[type="radio"] { display: none; } */

.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.radio-label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Grundstyling für den Text/Badge */
.custom-radio-text {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

/* 0 = Nicht bestanden (Rot) */
.state-fail {
    color: #c5221f;
    background-color: #fce8e6;
    border-color: #fad2cf;
}

/* 1 = Bestanden (Grün) */
.state-success {
    color: #137333;
    background-color: #e6f4ea;
    border-color: #ceead6;
}

/* 2 = OK mit Hinweis (Blau) */
.state-info {
    color: #1d4ed8;
    background-color: #dbeafe;
    border-color: #bfdbfe;
}

/* Fallback-Farbe (Grau) */
.state-default {
    color: #5f6368;
    background-color: #f1f3f4;
    border-color: #dadce0;
}

/* Hervorhebung, wenn der Radio-Button aktiv ausgewählt ist */
.radio-label input[type="radio"]:checked + .custom-radio-text {
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
    filter: brightness(0.95);
    font-weight: 600;
}

/* --- FEEDBACK / SUCCESS MESSAGE --- */

.feedback-section {
    animation: slideDownFade 0.4s ease-out forwards;
    padding-bottom: 0 !important; /* Verhindert riesige Lücken zum Formular */
}

.alert {
    display: flex;
    align-items: flex-start;
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    border: 1px solid transparent;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.alert-success {
    background-color: #e6f4ea; 
    border-color: #ceead6;
    color: #137333;
}

.alert-icon {
    flex-shrink: 0;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-content {
    flex-grow: 1;
}

.alert-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #0d5323;
}

.alert-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #137333;
}

.alert-close {
    background: none;
    border: none;
    color: #137333;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-left: 1rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.alert-close:hover {
    opacity: 1;
}

/* Kurze Animation beim Einblenden */
@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- ZUSÄTZLICHE STYLES FÜR FILTER & ERGEBNISSE --- */

.filter-panel {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.01);
}

.filter-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.filter-row .form-group {
    min-width: 200px;
    margin-bottom: 0.75rem;
    flex: 1;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f5f5f5;
}

/* Klickbare Tabellen-Header für JS Sortierung */
th.sortable {
    cursor: pointer;
    user-select: none; /* Verhindert das versehentliche Markieren von Text beim schnellen Klicken */
    transition: background-color 0.2s, color 0.2s;
    position: relative;
}

th.sortable:hover {
    background-color: #eaeaea;
    color: #000;
}

.sort-icon {
    font-size: 0.75rem;
    margin-left: 0.4rem;
    color: #888;
    display: inline-block;
    width: 12px; /* Fixe Breite, damit der Text beim Sortieren nicht springt */
}

th.current-sort {
    background-color: #e5e5e5;
    color: #000;
}

th.current-sort .sort-icon {
    color: #000;
}

/* Sanfter Zeilen-Hover */
#ergebnisTabelle tbody tr:hover {
    background-color: #fcfcfc;
}

/* Verstecke Label bei Radio/Badges innerhalb der Tabelle nicht, falls andere Regeln interferieren */
#ergebnisTabelle .custom-radio-text {
    display: inline-block;
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        gap: 0;
    }
}

/* --- EXTRA DESIGN FÜR SPALTENSORTIERUNG IM EXPORT --- */

.column-order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    transition: background-color 0.2s ease;
}

.column-order-item:hover {
    background-color: #fafafa;
}

.column-main-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.column-main-info input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.column-order-actions {
    display: flex;
    gap: 0.25rem;
}

/* Minimalistische Sortierbuttons */
.btn-sort-move {
    background-color: #f0f0f0;
    color: #444;
    border: 1px solid #dcdcdc;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn-sort-move:hover {
    background-color: #1a1a1a;
    color: #ffffff;
    border-color: #1a1a1a;
}

.btn-sort-move:focus {
    outline: none;
}

/* --- BENUTZERVERWALTUNG RECHTE GRID --- */

.workspace-role-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.workspace-role-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #fcfcfc;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.workspace-role-row:hover {
    background-color: #f5f5f5;
}

.ws-grid-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
}

.ws-grid-select {
    max-width: 280px;
    width: 100%;
    padding: 0.4rem 0.6rem !important;
    font-size: 0.9rem !important;
    border-color: #dcdcdc !important;
    cursor: pointer;
    background-color: #fff;
    border-radius: 4px;
}

.ws-grid-select:focus {
    border-color: #1a1a1a !important;
    outline: none;
}

@media (max-width: 600px) {
    .workspace-role-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .ws-grid-select {
        max-width: 100%;
    }
}

/* --- DATEI UPLOAD TAG-WOLKE --- */
.file-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.file-tag {
    background-color: #f8f9fa;
    color: #202124;
    padding: 0.35rem 0.5rem 0.35rem 0.75rem;
    border-radius: 6px; /* Etwas eckiger für besseren Lesefluss */
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid #dadce0;
    max-width: 100%; /* Erlaubt dem Tag, den ganzen Platz zu nutzen, falls der Name lang ist */
    word-break: break-all; /* Verhindert, dass ultralange Dateinamen das Layout sprengen */
}

.file-tag:hover {
    background-color: #f1f3f4;
    border-color: #cecece;
}

/* Das benutzerfreundliche rote Kreuz */
.file-tag-remove {
    cursor: pointer;
    color: #d93025; /* Rotes Kreuz standardmäßig */
    background-color: #fce8e6; /* Leichter roter Hintergrund zur Hervorhebung */
    border-radius: 50%; /* Macht es zu einem schönen runden Button */
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: auto; /* Drückt das Kreuz immer ganz nach rechts */
    transition: all 0.2s ease;
}

.file-tag-remove:hover {
    background-color: #d93025; /* Kräftiges Rot beim Hover */
    color: #ffffff; /* Weißes Kreuz beim Hover */
    transform: scale(1.05); /* Leichte Vergrößerung beim Drüberfahren */
}

/* --- STATISTIK BADGES --- */
.stat-box {
    display: inline-block;
    min-width: 32px;
    text-align: center;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
}
.stat-total { background-color: #f0f0f0; color: #333; }
.stat-ok    { background-color: #e6f4ea; color: #137333; }
.stat-nok   { background-color: #fce8e6; color: #c5221f; }
.stat-info  { background-color: #dbeafe; color: #1d4ed8; }

.expert-badge {
    background-color: #4f46e5;
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* --- PAGINATION (SEITENMECHANISMUS) --- */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.page-btn {
    background-color: #ffffff;
    border: 1px solid #dcdcdc;
    color: #1a1a1a;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background-color: #f5f5f5;
    border-color: #1a1a1a;
}

.page-btn:disabled {
    background-color: #fcfcfc;
    color: #aaa;
    border-color: #eaeaea;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.9rem;
    color: #555;
    margin: 0 1rem;
    font-weight: 500;
}
/* --- DYNAMIC ACTION ROWS (TESTFALL EDITIEREN) --- */
.action-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    background-color: #fcfcfc;
    border: 1px solid #eaeaea;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: background-color 0.2s, border-color 0.2s;
}

.action-row:hover {
    background-color: #ffffff;
    border-color: #dcdcdc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.action-drag-handle {
    cursor: grab;
    color: #aaa;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.action-input {
    flex-grow: 1;
    border: 1px solid transparent !important;
    background: transparent !important;
    padding: 0.5rem !important;
    font-size: 0.95rem !important;
}

.action-input:focus {
    background: #ffffff !important;
    border-color: #1a1a1a !important;
    outline: none;
}

.btn-remove-action {
    background: #fce8e6;
    color: #c5221f;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-remove-action:hover {
    background: #c5221f;
    color: #ffffff;
}

@media (max-width: 600px) {
    .action-row {
        flex-wrap: wrap;
    }
    .action-input {
        width: 100%;
        order: 3;
        border: 1px solid #eaeaea !important;
        background: #fff !important;
    }
    .action-drag-handle { order: 1; }
    .btn-remove-action { order: 2; margin-left: auto; }
}