/* --- WICHTIG: GLOBALE RESET-REGEL --- */
*, *::before, *::after {
    box-sizing: border-box;
}
        /* --- DESIGN VARIABLES (AMBER THEME) --- */
        :root { 
            --user-accent: #f0932b; /* Das Orange/Gold */
            --bg-dark: #050505;
            --bg-glass: rgba(15, 10, 5, 0.96); 
            --bg-card: rgba(35, 25, 20, 0.7); 
            --border-light: rgba(240, 147, 43, 0.3); 
            --danger: #ff4d4d;
            --success: #00e676;
        }
        
        body { 
            margin: 0; padding: 0; color: white; font-family: 'Inter', sans-serif; 
            -webkit-tap-highlight-color: transparent; 
            background-image: url('../assets/ruesten.png');
            background-size: cover; background-position: center; background-attachment: fixed; 
            min-height: 100vh;
        }
        @media (max-width: 500px) {

    #ruestListContainer.card-grid-container {
    display: grid !important;
    /* Erzwingt exakt 3 gleich große Spalten */
    grid-template-columns: repeat(3, 1fr) !important; 
    gap: 12px !important;
    width: 100% !important;
    padding: 10px 5px !important;
}
#ruestListContainer .data-card {
    width: 100% !important;
    min-height: 140px !important; /* Kompakte Admin-Höhe */
    margin: 0 !important;
}
}
        body::before { content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(5, 3, 0, 0.9); backdrop-filter: blur(5px); z-index: -1; }

        .dashboard-container { max-width: 800px; margin: 0 auto; padding: 20px; position: relative; z-index: 1; }

        /* HEADER */
        .status-bar { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; margin-bottom: 30px; border-bottom: 1px solid var(--border-light); }
        .user-info { font-size: 0.8rem; color: #aaa; letter-spacing: 2px; font-weight: 600; }
        .user-highlight { color: var(--user-accent); font-weight: bold; text-transform: uppercase; margin-left: 5px; text-shadow: 0 0 10px rgba(240, 147, 43, 0.4); }
        .btn-logout-compact { background: transparent; border: 1px solid #444; color: #888; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 0.65rem; transition: 0.3s; text-transform: uppercase; letter-spacing: 1px; }
        .btn-logout-compact:hover { border-color: var(--user-accent); color: var(--user-accent); box-shadow: 0 0 10px rgba(240, 147, 43, 0.2); }

        .system-banner { border: 1px solid var(--border-light); background: radial-gradient(circle, rgba(240, 147, 43, 0.1) 0%, rgba(0,0,0,0) 100%); padding: 25px; text-align: center; border-radius: 12px; margin-bottom: 30px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
        .system-banner h1 { margin: 0; font-size: 1.5rem; color: var(--user-accent); letter-spacing: 3px; font-weight: 200; }
        .system-banner p { margin: 5px 0 0 0; font-size: 0.7rem; color: #888; letter-spacing: 2px; }

         /* NAV GRID */
        #navGrid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 15px !important;
    max-width: 800px;
    margin: 0 auto;
}
        .span-full { grid-column: span 2 !important; }
        
        .premium-card { 
    border: 1px solid var(--border-light); 
    border-radius: 12px; 
    padding: 25px 15px; 
    text-align: center; 
    cursor: pointer; 
    transition: 0.3s; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); 
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
    /* Damit Text auf Bildern lesbar ist: */
    color: white !important;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.9) !important;
    /* Standard-Hintergrund falls Internet weg ist: */
    background-color: #1a1a1a !important; 
}
        .premium-card:active { transform: scale(0.98); }
        .nav-button:hover .premium-card { border-color: var(--user-accent); background: rgba(60, 40, 20, 0.8); box-shadow: 0 0 15px rgba(240, 147, 43, 0.2); transform: translateY(-2px); }
        .premium-card h2 { 
    font-size: 1.4rem !important; /* Deutlich größer (war ca. 0.9rem) */
    margin: 5px 0 !important; 
    color: #fff !important; 
    letter-spacing: 2px !important;
    font-weight: 800 !important; /* Extra fett für maximale Präsenz */
    text-transform: uppercase !important;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8) !important;
}
        .nav-button:hover .premium-card h2 { color: var(--user-accent); }
        .premium-card p { 
    font-size: 0.75rem !important; /* Etwas größer für bessere Lesbarkeit */
    color: #bbb !important; /* Helleres Grau/Silber für mehr Kontrast (war #888) */
    text-transform: uppercase !important; 
    margin: 0 !important; 
    letter-spacing: 1.5px !important;
    font-weight: 500 !important;
}
        .big-icon { font-size: 2rem; display: block; margin-bottom: 10px; filter: grayscale(100%); opacity: 0.7; transition: 0.3s; }
        .nav-button:hover .big-icon { filter: grayscale(0%); opacity: 1; transform: scale(1.1); filter: drop-shadow(0 0 5px rgba(240, 147, 43, 0.5)); }
        /* Hintergrund für RÜSTEN STARTEN */
/* --- LOKALE BILDER-STEUERUNG (.png) --- */

/* 1. RÜSTEN STARTEN */
.nav-button:nth-child(1) .premium-card {
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), 
                      url('../assets/ruesten.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

/* 2. ARTIKEL HINZUFÜGEN */
.nav-button:nth-child(2) .premium-card {
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), 
                      url('../assets/anlegen.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

/* 3. RETOURE */
.nav-button:nth-child(3) .premium-card {
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), 
                      url('../assets/retoure.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

/* 4. BESTAND */
.nav-button:nth-child(4) .premium-card {
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), 
                      url('../assets/bestand.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

/* 5. MEINE LEISTUNG */
.nav-button:nth-child(5) .premium-card {
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), 
                      url('../assets/leistung.png')!important;
    background-size: cover !important;
    background-position: center !important;
}

/* Gemeinsame Einstellungen für alle Karten-Bilder */
.premium-card { 
    background-color: transparent !important; /* WICHTIG */
    border: 1px solid var(--border-light); 
    border-radius: 12px;
}

/* Hintergrund für MEINE LEISTUNG */
.nav-button.span-full:last-child .premium-card {
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), 
                      url('https://images.unsplash.com/photo-1551288049-bbbda546697c?auto=format&fit=crop&q=80&w=1000') !important;
    background-size: cover !important;
    background-position: center !important;
}
        /* --- CARD GRID SYSTEM (1:1 KOPIE VOM ADMIN) --- */
        /* --- FINALES KARTEN-DESIGN (Admin-Clone) --- */
.card-grid-container {
    display: grid !important;
    /* Erstellt 3 gleich große Spalten */
    grid-template-columns: repeat(3, 1fr) !important; 
    gap: 12px !important;
    width: 100% !important;
}

.data-card { 
    position: relative; 
    /* Der dunkle Hintergrund (Admin-Style, aber warm getönt) */
    background: linear-gradient(145deg, rgba(30, 25, 20, 0.92) 0%, rgba(10, 5, 0, 0.98) 100%); 
    border: 1px solid rgba(240, 147, 43, 0.15); 
    border-radius: 12px; 
    padding: 20px; 
    min-height: 140px; /* Exakt Admin-Höhe */
    display: flex; 
    flex-direction: column; 
    justify-content: space-between;
    overflow: hidden; 
    transition: transform 0.2s, border-color 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    cursor: pointer;
}

.data-card:hover {
    transform: translateY(-2px);
    border-color: var(--user-accent);
    box-shadow: 0 8px 25px rgba(240, 147, 43, 0.15);
}

/* Hintergrundbild - Füllt die Karte jetzt aggressiver aus */
.card-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;      /* Bild füllt alles */
    background-position: center; /* Bild-Mitte */
    opacity: 0.18;               /* Einen Hauch sichtbarer (war 0.15) */
    filter: grayscale(100%) contrast(120%);
    mix-blend-mode: luminosity;
    z-index: 0;
    pointer-events: none;
}

/* Wenn man drüber fährt, wird das Bild deutlicher */
.data-card:hover .card-bg { 
    opacity: 0.28; 
    transition: opacity 0.3s ease; 
}

/* Textebene nach vorne holen */
.data-card > div, .data-card > span { 
    position: relative; 
    z-index: 1; 
}

        /* --- CARD GRID SYSTEM (1:1 KOPIE VOM ADMIN) --- */
        /* --- FINALES KARTEN-DESIGN (Admin-Clone) --- */
.card-grid-container {
    display: grid !important;
    /* Erstellt 3 gleich große Spalten */
    grid-template-columns: repeat(3, 1fr) !important; 
    gap: 12px !important;
    width: 100% !important;
}

.data-card { 
    position: relative; 
    /* Der dunkle Hintergrund (Admin-Style, aber warm getönt) */
    background: linear-gradient(145deg, rgba(30, 25, 20, 0.92) 0%, rgba(10, 5, 0, 0.98) 100%); 
    border: 1px solid rgba(240, 147, 43, 0.15); 
    border-radius: 12px; 
    padding: 20px; 
    min-height: 140px; /* Exakt Admin-Höhe */
    display: flex; 
    flex-direction: column; 
    justify-content: space-between;
    overflow: hidden; 
    transition: transform 0.2s, border-color 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    cursor: pointer;
}

.data-card:hover {
    transform: translateY(-2px);
    border-color: var(--user-accent);
    box-shadow: 0 8px 25px rgba(240, 147, 43, 0.15);
}

/* Hintergrundbild - Füllt die Karte jetzt aggressiver aus */
.card-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;      /* Bild füllt alles */
    background-position: center; /* Bild-Mitte */
    opacity: 0.18;               /* Einen Hauch sichtbarer (war 0.15) */
    filter: grayscale(100%) contrast(120%);
    mix-blend-mode: luminosity;
    z-index: 0;
    pointer-events: none;
}

/* Wenn man drüber fährt, wird das Bild deutlicher */
.data-card:hover .card-bg { 
    opacity: 0.28; 
    transition: opacity 0.3s ease; 
}

/* Textebene nach vorne holen */
.data-card > div, .data-card > span { 
    position: relative; 
    z-index: 1; 
}
/* Text-Styling (Exakt Admin) */
.card-title { 
    font-size: 1rem; 
    font-weight: 600; 
    color: white; 
    margin-bottom: 2px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.9);
}
.card-sub { font-size: 0.7rem; color: #aaa; margin-bottom: auto; }

.card-val { 
    font-size: 1.4rem; 
    color: var(--user-accent); 
    font-weight: bold; 
    margin-top: 10px;
    text-shadow: 0 2px 8px rgba(0,0,0,1);
}

.card-unit {
     font-size: 0.7rem; opacity: 0.6; font-weight: 400; color: #ccc;
}
/* Deaktiviert die Interaktion in der Bestandsliste */
#inventoryList .data-card {
    cursor: default !important;
    pointer-events: none !important; /* Verhindert das Öffnen des Buchungsfensters */
    transform: none !important;      /* Kein Hover-Effekt mehr */
    box-shadow: none !important;
}

/* Optional: Den Bestand etwas dezenter färben, um "Nur-Lese-Modus" zu signalisieren */
#inventoryList .data-card .stock-badge {
    background: #444 !important;
    color: #fff !important;
}
/* Hintergrund für Bestand und Buchungs-Historie */
#inventoryModal .modal-box, 
#statsModal .modal-box {
    background-image: linear-gradient(rgba(10, 5, 0, 0.8), rgba(10, 5, 0, 0.9)), 
                      url('../assets/hintergrund.png') !important;
    background-size: cover !important;
    background-position: center !important;
    border: 1px solid var(--user-accent) !important;
    box-shadow: inset 0 0 60px rgba(0,0,0,0.9), 0 0 30px rgba(0,0,0,0.5) !important;
}
/* --- PROJEKT SCHNELLWAHL (Im Start-Fenster) --- */
.project-history-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important; /* Exakt 2 Spalten */
    gap: 8px !important;       /* Engerer Abstand */
    margin-top: 10px !important;
    margin-bottom: 15px !important;
    
    /* WICHTIG: Scrollen deaktivieren, Box wachsen lassen */
    max-height: none !important; 
    overflow: visible !important; 
    padding: 0 !important;
}

.project-card-mini {
    background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 15px; /* Kompakter */
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    
    /* Text schön verteilen */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-card-mini:hover {
    background: rgba(240, 147, 43, 0.1);
    border-color: var(--user-accent);
    transform: translateX(2px);
}

.project-card-mini .p-nr {
    font-size: 0.9rem;
    color: white;
    font-weight: bold;
    letter-spacing: 1px;
}

.project-card-mini .p-icon {
    color: var(--user-accent);
    opacity: 0.5;
    font-size: 1.2rem;
}

/* Scrollbar schick machen */
.project-history-grid::-webkit-scrollbar { width: 4px; }
.project-history-grid::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }

/* Glas-Effekt für die Karten innerhalb dieser Modale */
#inventoryModal .data-card, 
#statsModal .data-card {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

        @keyframes calmSuccessPulse {
            0% { border-color: #00e676; box-shadow: 0 0 25px rgba(0, 230, 118, 0.3); background: rgba(0, 230, 118, 0.1); }
            100% { border-color: rgba(240, 147, 43, 0.3); box-shadow: none; background: linear-gradient(145deg, rgba(35, 25, 20, 0.9) 0%, rgba(10, 5, 0, 0.95) 100%); }
        }
        .data-card.pulse { animation: calmSuccessPulse 2.5s ease-out forwards; }

        .card-badge { font-size: 1.2rem; position: absolute; top: 10px; right: 10px; opacity: 0.4; text-shadow: 0 2px 5px black; }

        /* MODALS */
        .modal-overlay, .ruest-layer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10, 5, 0, 0.92); backdrop-filter: blur(8px); z-index: 1000; display: flex; justify-content: center; align-items: center; }
        .modal-overlay.hidden, .ruest-layer.hidden { display: none !important; }
        .modal-content {
    background-image: linear-gradient(rgba(10, 5, 0, 0.85), rgba(10, 5, 0, 0.92)), 
                      url('../assets/hintergrund.png') !important;
    background-size: cover !important;
    background-position: center !important;
    border: 1px solid var(--user-accent); /* Der goldene Rahmen */
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
/* Dieser Selektor ist extrem stark und überschreibt fast alles */
html body div#quickAddModal div.modal-content {
    background-color: transparent !important;
    background-image: linear-gradient(rgba(10, 5, 0, 0.9), rgba(10, 5, 0, 0.95)), 
                      url('../assets/hintergrund.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: local !important;
    display: block !important;
}

/* Hintergrund für ALLE Fenster-Boxen (Neu, Bestand, Statistik, Projekt, Menge) */
#quickAddModal .modal-box, 
#inventoryModal .modal-box, 
#statsModal .modal-box,
#projectInputModal .modal-box {
    width: 95% !important;
    max-width: 700px !important; /* Breiter für 2 Spalten */
    display: flex;
    flex-direction: column;
}

/* 2. Das Eingabefeld etwas kompakter */
#projectInputParams {
    font-size: 1.2rem !important; /* Nicht ganz so riesig */
    padding: 10px !important;
    margin-bottom: 5px !important;
}
#qtyModal .modal-box,
#correctionModal .modal-box {
    background-image: linear-gradient(rgba(10, 5, 0, 0.75), rgba(10, 5, 0, 0.85)), 
                      url('../assets/hintergrund.png') !important;
    background-size: cover !important;
    background-position: center !important;
    border: 1px solid var(--user-accent) !important;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8), 0 0 30px rgba(240, 147, 43, 0.2) !important;
    /* Damit der Inhalt nicht am Rand klebt */
    padding: 25px !important; 
}

/* Glas-Effekt für die Eingabefelder in diesen Fenstern */
.modal-box .modal-input-field, 
.modal-box .master-input {
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(240, 147, 43, 0.3) !important;
    color: #fff !important;
}

/* Spezielle Transparenz für die Gebinde-Optionen im Neu-Anlegen-Fenster */
.type-option {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}      .ruest-layer { z-index: 900; }

        .modal-box { background: var(--bg-glass); border: 1px solid var(--user-accent); padding: 25px; border-radius: 12px; width: 90%; max-width: 600px; box-shadow: 0 0 40px rgba(240, 147, 43, 0.1); display: flex; flex-direction: column; gap: 15px; text-align: center; border-top: 3px solid var(--user-accent); }
        .modal-box.large { height: 85vh; max-height: 800px; width: 95%; max-width: 800px; }

        .modal-input-field, .master-input { width: 100%; background: #080500; border: 1px solid #333; color: white; padding: 12px; border-radius: 6px; font-size: 1rem; outline: none; box-sizing: border-box; text-align: center; transition: 0.3s; font-family: 'Inter', sans-serif; }
        .modal-input-field:focus { border-color: var(--user-accent); box-shadow: 0 0 15px rgba(240, 147, 43, 0.15); background: #151005; }
        .input-error { border-color: var(--danger) !important; }

        .btn-confirm { background: var(--user-accent); color: black; border: none; padding: 12px; font-weight: bold; border-radius: 6px; cursor: pointer; width: 100%; transition: 0.2s; letter-spacing: 1px; }
        .btn-confirm:hover { background: #ffbe76; box-shadow: 0 0 15px rgba(240, 147, 43, 0.3); }
        .btn-cancel { background: transparent; border: 1px solid #333; color: #888; padding: 12px; font-weight: bold; border-radius: 6px; cursor: pointer; width: 100%; transition: 0.2s; letter-spacing: 1px; }
        .btn-cancel:hover { border-color: #666; color: #fff; background: rgba(255,255,255,0.05); }

        .ruest-header { text-align: center; margin-bottom: 20px; border-bottom: 1px solid #333; padding-bottom: 15px; }
        .ruest-header small { color: #888; font-size: 0.6rem; letter-spacing: 2px; text-transform: uppercase; }
        .ruest-header h2 { margin: 5px 0 0 0; color: var(--user-accent); font-size: 1.5rem; letter-spacing: 1px; }
        .section-label {
    grid-column: 1 / -1 !important; /* Nimmt immer die volle Breite ein */
    display: flex !important;
    width: 100% !important;
}

        .stat-header-row {
            display: flex;
            justify-content: space-around;
            align-items: center;
            /* Ein edlerer Verlauf für den Hintergrund */
            background: linear-gradient(to bottom, rgba(255,255,255,0.03), rgba(0,0,0,0.2));
            border: 1px solid rgba(240, 147, 43, 0.15);
            border-radius: 12px;
            padding: 25px 10px;
            margin-bottom: 25px;
            box-shadow: inset 0 0 20px rgba(0,0,0,0.5); /* Tiefe nach innen */
        }
        .stat-mini-box {
            text-align: center;
            flex: 1;
            position: relative;
        }
        /* Feine Trennlinien zwischen den Werten */
        .stat-mini-box:not(:last-child)::after {
            content: "";
            position: absolute;
            right: 0;
            top: 25%;
            height: 50%;
            width: 1px;
            background: rgba(255,255,255,0.1);
        }
        .stat-mini-label {
            font-size: 0.6rem;
            color: #8899aa; /* Etwas heller für bessere Lesbarkeit */
            letter-spacing: 2px;
            display: block;
            margin-bottom: 8px;
            text-transform: uppercase;
            font-weight: 600;
        }
        /* DIE ZAHLEN: Fett & Leuchtend */
        .stat-mini-val {
            font-size: 1.8rem; /* Deutlich größer (war ca 1.4) */
            color: white;
            font-weight: 800; /* Extra Fett */
            display: block;
            text-shadow: 0 4px 10px rgba(0,0,0,0.8); /* Starker Schatten für Kontrast */
            line-height: 1.1;
        }
        /* Die mittlere Zahl (Stückzahl) besonders hervorheben */
        #statTotalItems {
            color: var(--user-accent); /* Dein Orange/Gold */
            font-size: 2.4rem; /* RIESIG */
            text-shadow: 0 0 25px rgba(240, 147, 43, 0.4); /* Leucht-Effekt */
        }
        .breakdown-row {
            display: flex;
            flex-wrap: wrap;
            justify-content: center; /* Zentriert die Badges */
            gap: 10px;
            margin-bottom: 25px;
        }
        .breakdown-badge {
            background: rgba(0, 0, 0, 0.6);
            border: 1px solid rgba(255, 255, 255, 0.15);
            color: #ccc;
            padding: 8px 16px;
            border-radius: 6px;
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1px;
            display: flex;
            align-items: center;
            gap: 8px; /* Abstand zwischen Icon und Text */
            box-shadow: 0 4px 10px rgba(0,0,0,0.3);
        }
        .breakdown-icon {
            font-size: 1rem;
            filter: drop-shadow(0 0 5px rgba(240, 147, 43, 0.4)); /* Goldenes Leuchten */
        }

        h3 { margin: 0; font-size: 1rem; color: #fff; letter-spacing: 2px; font-weight: 200; text-transform: uppercase; }
        label { font-size: 0.65rem; color: var(--user-accent); display: block; margin-bottom: 8px; letter-spacing: 1px; text-transform: uppercase; }
        .hidden { display: none !important; }

        select.modal-input-field { color-scheme: dark; }
        select.modal-input-field option { background-color: #111; color: white; }
        /* --- REPAIR KIT: Erzwingt das Hintergrundbild über die ganze Karte --- */
        .data-card {
            position: relative !important;
            overflow: hidden !important;
            isolation: isolate; /* Sichert ab, dass der Hintergrund hinten bleibt */
        }
        
        .data-card .card-bg {
            position: absolute !important;
            top: 0 !important;
            left: 0 !important;
            width: 100% !important;
            height: 100% !important;
            background-size: cover !important; /* Bild füllt alles */
            background-position: center !important;
            opacity: 0.25 !important; /* Deutlicher sichtbar machen */
            z-index: -1 !important; /* Zwingend hinter den Text */
            border-radius: 12px !important; /* Passt sich der Karte an */
        }

        /* Sicherstellen, dass der Text VOR dem Bild liegt */
        .data-card > div, .data-card > span {
            position: relative !important;
            z-index: 2 !important;
        }
        /* Fix: Damit der Schließen-Button nicht verdeckt wird */
        .modal-box button {
            position: relative;
            z-index: 100; /* Immer ganz oben */
            margin-top: 15px; /* Sicherer Abstand */
        }
        /* --- PROFI EDIT ICON --- */
        .edit-icon-svg {
            width: 20px;
            height: 20px;
            fill: none;
            stroke: rgba(255, 255, 255, 0.6); /* Dezent Silber */
            stroke-width: 2;
            stroke-linecap: round;
            stroke-linejoin: round;
            transition: all 0.3s ease;
        }
        
        /* Beim Hover über die Karte wird der Stift farbig */
        .data-card:hover .edit-icon-svg {
            stroke: var(--user-accent); /* Wird Orange/Gold */
            transform: scale(1.1);
            opacity: 1;
        }
        #globalLoader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10, 5, 0, 0.9); /* Fast schwarzer, warmer Hintergrund */
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(240, 147, 43, 0.1);
    border-top: 3px solid var(--user-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    margin-top: 15px;
    color: var(--user-accent);
    letter-spacing: 2px;
    font-size: 0.8rem;
    text-transform: uppercase;
}
        /* --- MOBILE OPTIMIERUNG --- */
        @media (max-width: 500px) {
    .card-grid-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
            
            /* 1. Badges kompakter machen */
            .breakdown-row {
                gap: 5px; /* Weniger Abstand */
            }
            .breakdown-badge {
                font-size: 0.65rem; /* Kleinere Schrift */
                padding: 6px 10px; /* Weniger Polster */
                flex-grow: 1; /* Sollen den Platz füllen, aber nicht sprengen */
                justify-content: center;
                min-width: 45%; /* 2 pro Zeile garantiert */
            }

            /* 2. Historie-Karten höher machen (damit alles reinpasst) */
            .data-card {
                min-height: 220px !important; /* Mehr Platz für Handy-Layout */
                padding: 15px !important;
            }
            
            /* Schriftgrößen in der Karte etwas anpassen */
            .card-title { font-size: 0.9rem !important; }
            .card-sub { font-size: 0.65rem !important; }
        }
        /* =========================================
           REPARATUR-KIT (Einfach unten im CSS anfügen)
           ========================================= */

        /* 1. FIX FÜR DIE RÜST-ANSICHT (PC) */
        /* Damit "Zuletzt gebucht" und "Top 6" UNTEREINANDER stehen */
        #ruestListContainer {
            display: block !important; /* Kein Grid für den Hauptcontainer */
            width: 100%;
        }
        /* Hintergrund für alle großen und kleinen Fenster-Boxen */
.modal-box, 
.modal-box.large,
#ruestSection .modal-box {
    background-image: linear-gradient(rgba(10, 5, 0, 0.75), rgba(10, 5, 0, 0.85)), 
                      url('../assets/hintergrund.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: local !important;
    border: 1px solid var(--user-accent) !important;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8), 0 0 30px rgba(240, 147, 43, 0.2) !important;
}

/* Transparenz-Effekt für die Karten-Listen (Rüsten & Bestand) */
#ruestListContainer .data-card,
#articleDbList .data-card,
#userHistoryList .data-card {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

        .section-label {
            width: 100%;
            display: flex; /* Flexbox für den gelben Strich links */
            align-items: center;
            margin-top: 30px;
            margin-bottom: 15px;
            padding-left: 15px;
            border-left: 3px solid var(--user-accent);
            font-size: 0.8rem;
            color: #888;
            letter-spacing: 2px;
            text-transform: uppercase;
        }

        /* Das Grid für die Karten selbst wiederherstellen */
        .card-grid-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 15px;
            width: 100%;
            margin-bottom: 30px;
        }

        /* 2. FIX FÜR DIE HANDY-ANSICHT (MOBILE) */
        @media (max-width: 600px) {
            
            /* Badges oben aufräumen */
            .breakdown-row {
                display: flex;
                flex-wrap: wrap;
                gap: 8px;
                justify-content: space-between; /* Verteilt sie schön */
            }
            
            .breakdown-badge {
                width: 48%; /* Immer 2 pro Zeile */
                font-size: 0.65rem;
                padding: 8px 5px;
                justify-content: center;
                margin-bottom: 5px;
            }

            /* Die Historie-Karten höher machen, damit nichts abgeschnitten wird */
            .data-card {
                min-height: 240px !important; /* Mehr Platz in der Höhe */
                padding: 15px !important;
                display: flex !important;
                flex-direction: column !important;
                justify-content: space-between !important;
            }

            /* Schriftgrößen auf Handy anpassen */
            .data-card .card-title { font-size: 1rem !important; }
            .data-card span { font-size: 0.75rem !important; }
            
            /* Den Edit-Stift etwas vergrößern für Touch */
            .edit-icon-svg {
                width: 24px;
                height: 24px;
            }
        }
        /* --- TYPE SELECTOR GRID (Bilder statt Dropdown) --- */
        .type-grid { 
            display: grid; 
            grid-template-columns: repeat(3, 1fr); /* 3 Spalten */
            gap: 10px; 
            margin-bottom: 15px; 
        }
        
        .type-option { 
            position: relative;
            background: rgba(20, 20, 20, 0.6); 
            border: 1px solid rgba(240, 147, 43, 0.2); 
            border-radius: 8px; 
            height: 70px; 
            cursor: pointer; 
            overflow: hidden; 
            transition: 0.2s; 
            display: flex; 
            align-items: center; 
            justify-content: center;
        }
        
        .type-option:hover { 
            border-color: var(--user-accent);
            transform: translateY(-2px);
        }
        
        /* Das Bild im Hintergrund */
        .type-icon { 
            position: absolute; top: 0; left: 0; width: 100%; height: 100%;
            object-fit: cover; opacity: 0.35; 
            filter: grayscale(100%); z-index: 0; transition: 0.3s;
        }

        /* Der Text darüber */
        .type-label { 
            position: relative; z-index: 1; font-size: 0.65rem; color: #ccc; 
            text-transform: uppercase; letter-spacing: 1px; font-weight: 600;
            text-shadow: 0 2px 5px black;
        }

        /* Ausgewählter Zustand */
        .type-option.selected { 
            border-color: var(--user-accent); 
            background: rgba(240, 147, 43, 0.15); 
            box-shadow: 0 0 15px rgba(240, 147, 43, 0.25); 
        }
        
        .type-option.selected .type-icon { 
            opacity: 0.6; filter: none; transform: scale(1.1); 
        }
        
        .type-option.selected .type-label { 
            color: white; text-shadow: 0 0 10px rgba(240, 147, 43, 0.8);
        }
        /* --- MOBILE HISTORY FIX --- */
        /* NEUES MOBILE LAYOUT: Große Karten untereinander */
        @media (max-width: 600px) {
            .card-grid-container {
                display: flex !important;
                flex-direction: column !important;
                gap: 15px !important;
            }
            
            .data-card {
                min-height: 200px !important; /* Wieder schön groß */
                width: 100% !important;
            }
            
            /* Bild wieder heller machen für den coolen Look */
            .data-card .card-bg {
                opacity: 0.25 !important;
            }

            /* Zeilenabstände optimieren */
            #userHistoryList .data-card > div {
                margin-bottom: 6px !important;
            }
            
            /* Das Icon unten rechts etwas kleiner */
            .edit-icon-svg {
                width: 20px !important;
                height: 20px !important;
                bottom: 10px !important;
                right: 10px !important;
            }
        }
        /* --- FINALE ARCHIV- & GRID-REPARATUR --- */

/* --- FINALE ARCHIV-REPARATUR --- */

/* 1. Das Archiv-Fenster: Blau und groß genug */
#archiveModal .modal-box {
    border: 2px solid var(--admin-accent) !important;
    max-height: 95vh !important; /* Nutzt fast den ganzen Screen */
    display: flex !important;
    flex-direction: column !important;
}

/* 2. Der Listen-Container: Flexibles Grid ohne Quetschen */
#archiveListContainer {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important; /* Breitere Karten */
    gap: 25px !important; /* Mehr Abstand zwischen den Karten */
    padding: 15px !important;
    overflow-y: auto !important;
    align-content: start !important;
}

/* 3. Die Archiv-Karte: Keine feste Höhe, damit sie wachsen kann */
#archiveListContainer .data-card {
    min-height: 320px !important; /* Genug Platz für alle 6 Zeilen */
    height: auto !important;      /* WICHTIG: Erlaubt Wachstum nach unten */
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 12px !important; /* Mehr Platz zwischen den Textzeilen */
}

/* 4. Die Scrollbar: Schmaler, damit sie die Karten nicht überdeckt */
#archiveListContainer::-webkit-scrollbar {
    width: 6px !important;
}
#archiveListContainer::-webkit-scrollbar-thumb {
    background: var(--admin-accent) !important;
    border-radius: 10px !important;
}
/* Spezieller Look für den Beenden-Button im Projekt */
#ruestSection .btn-cancel {
    border-color: rgba(255, 77, 77, 0.4);
    color: var(--danger);
    margin-top: 20px;
    font-size: 0.8rem;
}

#ruestSection .btn-cancel:hover {
    background: rgba(255, 77, 77, 0.1);
    border-color: var(--danger);
    box-shadow: 0 0 15px rgba(255, 77, 77, 0.2);
}
/* --- NEUES HEADER DESIGN (FLEX) --- */
.ruest-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 15px;
    margin-bottom: 20px;
    width: 100%;
}

.header-spacer, .header-right { flex: 1; }
.header-center { flex: 2; text-align: center; }
.header-center small { display: block; color: #888; font-size: 0.75rem; letter-spacing: 2px; margin-bottom: 5px; text-transform: uppercase; }
.header-center h2 { margin: 0; font-size: 2rem; color: var(--user-accent); text-shadow: 0 0 20px rgba(240, 147, 43, 0.3); }
.header-right { text-align: right; display: flex; flex-direction: column; justify-content: flex-end; }
.header-right small { display: block; color: #666; font-size: 0.6rem; letter-spacing: 1px; margin-bottom: 2px; text-transform: uppercase; }
.total-display { font-size: 1.8rem; font-weight: 800; color: var(--user-accent); text-shadow: 0 0 15px rgba(240, 147, 43, 0.4); line-height: 1; }
.total-display .unit { font-size: 0.8rem; color: #aaa; font-weight: normal; margin-left: 3px; }

/* --- HEADER BUTTON LINKS --- */
.header-left {
    flex: 1; /* Damit die Symmetrie bleibt */
    display: flex;
    align-items: flex-end; /* Unten bündig mit dem Rest */
}

.btn-correction-header {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ccc;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    transition: 0.2s;
    text-transform: uppercase;
}

.btn-correction-header:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: white;
}

/* Die Karten im Korrektur-Fenster */
.correction-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid #333;
    padding: 15px;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.correction-item:hover {
    border-color: var(--user-accent);
    background: rgba(240, 147, 43, 0.1);
}

/* --- FIX: KORREKTUR-FENSTER MUSS GANZ NACH VORNE --- */
#quickCorrectionModal {
    z-index: 20000 !important; /* Höher als alles andere (9000) */
    background: rgba(0, 0, 0, 0.85) !important; /* Etwas dunklerer Hintergrund */
    backdrop-filter: blur(5px);
}

/* Sicherstellen, dass der Button im Header klickbar ist */
.btn-correction-header {
    position: relative;
    z-index: 100 !important; /* Über dem Header-Hintergrund */
    pointer-events: auto !important;
}
