/* ==========================================================================
   GLOBAL CONSTANTS & THEME VARIABLES (Schädelfest / Band-Logistik Look)
   ========================================================================== */
:root {
    /* Farbpalette */
    --color-bg: #f8fafc;          
    --color-surface: #ffffff;     
    --color-text: #1e293b;        
    --color-muted: #64748b;       
    
    /* Akzentfarben */
    --color-primary: #198754;     
    --color-primary-hover: #146c43;
    --color-secondary: #0d6efd;   
    --color-danger: #dc3545;      
    --color-dark: #1e252b;        
    
    /* Layout-Konstanten */
    --max-width: 1200px;
    --radius: 6px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --transition: all 0.2s ease-in-out;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
}

h1, h2, h3 {
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

p {
    color: var(--color-muted);
    margin-bottom: 1rem;
}

/* ==========================================================================
   THE STRUCTURAL GRID & UTILITIES
   ========================================================================== */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem;
}

/* Info-, Warn- und Statusboxen */
.msg-box {
    padding: 12px;
    margin-bottom: 1.25rem;
    border-left: 4px solid var(--color-danger);
    background: #f8d7da;
    color: #842029;
    font-size: 0.85rem;
    font-weight: bold;
    border-radius: var(--radius);
}

.msg-box-success {
    border-left: 4px solid var(--color-primary);
    background: #e8f5e9;
    color: #1b5e20;
}

.info-box {
    margin-top: 2.5rem;
    background-color: #e8f4fd;
    border-left: 4px solid var(--color-secondary);
    padding: 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: #1c3d5a;
}

.warning-box {
    margin: 20px 0;
    padding: 12px;
    background-color: #fff8db;
    border-left: 4px solid #ffc107;
    border-radius: var(--radius);
}

.warning-box label {
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-box input[type="checkbox"] {
    transform: scale(1.2);
    cursor: pointer;
}

.warning-box small {
    color: #665200;
    display: block;
    margin-top: 5px;
    font-style: italic;
}

/* ==========================================================================
   RESPONSIVE NAVIGATION BAR
   ========================================================================== */
.main-nav {
    background-color: var(--color-dark);
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
}

.nav-brand {
    color: #fff;
    font-weight: bold;
    font-size: 1.2rem;
    text-decoration: none;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    align-items: center;
}

.nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-links a:hover, .nav-links a.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.private-user-info {
    color: #cbd5e1;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.private-user-info span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.user-divider { 
    color: #475569; 
}

.badge-admin { 
    background-color: #ffc107; 
    color: #000; 
    padding: 3px 8px; 
    border-radius: 4px; 
    font-size: 11px; 
    font-weight: 700; 
    line-height: 1;
    display: inline-block;
}

.lang-selector {
    display: flex;
    gap: 6px;
    align-items: center;
}

.flag-link {
    text-decoration: none;
    font-size: 1.25rem;
    transition: var(--transition);
    opacity: 0.6;
    line-height: 1;
    display: inline-block;
}

.flag-link:hover {
    opacity: 1;
    transform: scale(1.15);
}

.flag-active {
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
}

@media (min-width: 992px) {
    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        gap: 0;
    }
    .nav-links {
        gap: 1rem;
    }
}
/* ==========================================================================
   BUTTONS & FORMS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn-primary { background-color: var(--color-primary); color: #fff; }
.btn-primary:hover { background-color: var(--color-primary-hover); }
.btn-secondary { background-color: var(--color-secondary); color: #fff; }
.btn-secondary:hover { opacity: 0.9; }
.btn-danger { background-color: var(--color-danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-logout { padding: 5px 10px; font-size: 12px; line-height: 1; }

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

.form-group label { 
    display: block; 
    font-weight: 600; 
    font-size: 0.9rem; 
    margin-bottom: 0.4rem; 
    color: #334155; 
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-size: 0.95rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--color-secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.form-control:disabled {
    background-color: #e2e8f0;
    font-weight: 600;
    color: var(--color-muted);
    cursor: not-allowed;
}

.form-actions { margin-top: 25px; display: flex; gap: 10px; }
.admin-action-bar { display: flex; justify-content: flex-end; margin-bottom: 20px; }

/* ==========================================================================
   KRYPTO, AUTH & LOGIN COMPONENTS
   ========================================================================== */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 85vh;
    padding: 1rem;
}

.login-card {
    background: var(--color-surface);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 420px;
}
.register-card { max-width: 500px; } 

.login-header-group { text-align: center; margin-bottom: 1.5rem; }
.login-header-icon { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.login-form-group-last { margin-bottom: 1.75rem; }
.btn-login-submit { width: 100%; padding: 0.65rem; font-size: 0.95rem; justify-content: center; }
.login-back-link { text-align: center; margin-top: 1.25rem; font-size: 0.8rem; }
.login-back-link a { color: var(--color-muted); text-decoration: none; transition: var(--transition); }
.login-back-link a:hover { color: var(--color-secondary); }

.crypto-invite-box {
    background-color: #fff8db;
    border: 1px solid #ffc107;
    border-left: 6px solid #ffc107;
    margin-bottom: 25px;
    padding: 1.5rem;
    border-radius: var(--radius);
}
.crypto-invite-box h3 { color: #665200; margin-bottom: 0.5rem; }
.crypto-invite-box p { color: #665200; font-size: 0.85rem; margin-bottom: 1rem; }
.crypto-link-wrapper { display: flex; gap: 10px; align-items: center; background: #ffffff; padding: 10px; border: 1px solid #cbd5e1; border-radius: var(--radius); }
.crypto-link-input { width: 100%; border: none; font-family: monospace; font-size: 0.9rem; outline: none; background: transparent; }

/* Passwort-Checkliste */
.password-requirements, .password-checklist-box {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
}
.password-checklist-box { margin: 10px 0 15px 0; }
.password-requirements p, .password-checklist-box p { font-weight: bold; color: #475569; margin-bottom: 6px; }
.requirement-list, .checklist-group { list-style: none; }
.requirement-item, .checklist-item { color: var(--color-danger); font-weight: 600; transition: var(--transition); display: flex; align-items: center; gap: 6px; }
.requirement-item.valid, .checklist-item.valid { color: var(--color-primary); }

/* Reset Admin Box */
.danger-zone-box { margin-top: 2rem; border-top: 3px solid var(--color-danger); }
.danger-zone-box h3 { color: var(--color-danger); }
.danger-zone-box p { font-size: 0.85rem; margin-top: 0.25rem; }
.btn-spacing-top { margin-top: 0.5rem; }
.form-wide { max-width: 600px; }
/* ==========================================================================
   TABELLEN, FILTERS & INTERACTIVE WAAGEN
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background-color: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow);
    margin-top: 1.5rem;
}

.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.925rem; }
.data-table th { background-color: #f1f5f9; color: #334155; font-weight: 700; padding: 0.75rem 1rem; border-bottom: 2px solid #cbd5e1; white-space: nowrap; }
.data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background-color: #f8fafc; }

/* Tabellenzellen-Typen */
.table-cell-category { color: var(--color-secondary); font-weight: 600; }
.table-cell-bold { font-weight: bold; }
.table-cell-quantity { font-weight: bold; color: #475569; }
.table-cell-description { color: var(--color-muted); font-size: 0.85rem; }
.table-cell-empty-notice { text-align: center; color: var(--color-muted); padding: 20px; }
.table-cell-center { text-align: center; }
.table-cell-badge-container { vertical-align: middle; }
.row-archived td { opacity: 0.6; font-style: italic; }

/* Aktionen Kopf & Gruppe */
th.thead-width-actions { text-align: center; width: 120px; }
.table-action-group { display: flex; gap: 4px; justify-content: center; }
.btn-table-action { padding: 4px 8px; font-size: 11px; }

/* Filter & Tabs */
.tab-container { display: flex; gap: 4px; margin-bottom: 1.5rem; border-bottom: 2px solid #e2e8f0; padding-bottom: 2px; }
.tab-btn { padding: 0.6rem 1.2rem; font-weight: 600; font-size: 0.9rem; color: var(--color-muted); background: transparent; border: none; cursor: pointer; transition: var(--transition); border-radius: var(--radius) var(--radius) 0 0; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.tab-btn:hover { color: var(--color-text); background-color: #f1f5f9; }
.tab-btn.tab-active { color: var(--color-secondary); background-color: #e8f4fd; border-bottom: 2px solid var(--color-secondary); margin-bottom: -4px; }

.sub-filter-container { display: flex; gap: 15px; margin-bottom: 1rem; font-size: 0.85rem; font-weight: 600; }
.sub-filter-link { color: var(--color-muted); text-decoration: none; transition: var(--transition); }
.sub-filter-link:hover, .sub-filter-link.sub-active { color: var(--color-secondary); text-decoration: underline; }

.filter-bar { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
@media (min-width: 576px) { .filter-bar { flex-direction: row; justify-content: space-between; align-items: center; } }
.search-filter-input { max-width: 350px; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { background-color: #e2e8f0 !important; color: var(--color-text) !important; }

/* ==========================================================================
   STATUS BADGES & CROWDSOURCING COMPONENTS
   ========================================================================== */
.status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; }

/* Die 7 Logistikstufen */
.status-kaufen { background-color: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }
.status-prüfen { background-color: #fff3cd; color: #664d03; border: 1px solid #ffecb5; }
.status-aufladen { background-color: #fff8db; color: #533f00; border: 1px solid #ffc107; }
.status-geprüft { background-color: #e8f4fd; color: #1c3d5a; border: 1px solid #bbeeec; }
.status-bereitgestellt { background-color: #f3e5f5; color: #4a148c; border: 1px solid #e1bee7; }
.status-verpackt { background-color: #e0f7fa; color: #006064; border: 1px solid #b2ebf2; }
.status-verladen { background-color: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }

/* Kategorie-Zustände */
.status-kategorie-active { background-color: #e8f5e9; color: var(--color-primary); border: 1px solid var(--color-primary); }
.status-kategorie-inactive { background-color: #f1f5f9; color: var(--color-muted); border: 1px solid var(--color-muted); }

/* Crowdsourcing-Elemente */
.qty-cell-container { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.qty-badge { padding: 2px 6px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; }
.qty-unfulfilled { background-color: #fff8db; color: #533f00; } 
.qty-fulfilled { background-color: #e8f5e9; color: #1b5e20; }   

.contribution-list { font-size: 0.75rem; color: var(--color-muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.contribution-chip { background-color: #e2e8f0; color: var(--color-text); padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.contribution-minus-link { color: var(--color-danger); text-decoration: none; font-weight: 700; margin-left: 4px; padding: 0 2px; border-radius: 3px; transition: var(--transition); }
.contribution-minus-link:hover { background-color: rgba(220, 53, 69, 0.1); }

.btn-contribution-plus {
    background-color: var(--color-primary);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(25, 135, 84, 0.15);
}
.btn-contribution-plus:hover { background-color: var(--color-primary-hover); transform: translateY(-1px); }

/* ==========================================================================
   DASHBOARD GRID KACHELN
   ========================================================================== */
.dash-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin-top: 1.5rem; }
.dash-card { background-color: var(--color-surface); border: 1px solid #e2e8f0; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: var(--transition); }
.dash-card:hover { transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.dash-card-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.dash-card h3 { font-size: 1.15rem; margin-bottom: 0.25rem; }
.dash-card p { font-size: 0.85rem; margin-bottom: 0; }
.dash-card-counter { margin-top: 1.25rem; font-size: 0.8rem; font-weight: bold; }
.dash-card-primary { border-left: 5px solid var(--color-primary); }
.dash-card-primary .dash-card-counter { color: var(--color-primary); }
.dash-card-secondary { border-left: 5px solid var(--color-secondary); }
.dash-card-secondary .dash-card-counter { color: var(--color-secondary); }

@media (min-width: 576px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .dash-grid { grid-template-columns: repeat(3, 1fr); } }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer { background-color: #ffffff; border-top: 1px solid #e2e8f0; padding: 1.5rem; text-align: center; font-size: 0.8rem; color: var(--color-muted); }
.footer-timestamp { margin-top: 0.25rem; font-size: 0.75rem; opacity: 0.8; }
/* ==========================================================================
   BRAND LOGO SCHÄDEL-INTEGRATION (100% Inline-Style-Frei)
   ========================================================================== */
/* Richtet das Logo und den Text perfekt zentriert nebeneinander aus */
.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px; /* Abstand zwischen Schädel und Schrift */
}

/* Skaliert den brennenden Totenkopf exakt auf die Höhe der Navigationsleiste */
.nav-logo-img {
    height: 32px;  /* Perfekte Höhe, damit es dezent aber kraftvoll wirkt */
    width: auto;   /* Behält das Seitenverhältnis des Bildes exakt bei */
    vertical-align: middle;
}
/* ==========================================================================
   INTERACTIVE PASSWORD TEFLON-SHIELD (Handbuch-Härtung)
   ========================================================================== */
.password-checklist-box {
    margin-top: 8px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    padding: 12px;
    font-size: 0.8rem;
}

.password-checklist-box p {
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
}

.checklist-group {
    list-style: none;
}

.checklist-item {
    color: var(--color-danger);
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Wenn die Bedingung erfüllt ist, schlägt das Schädelfest-Grün zu */
.checklist-item.valid {
    color: var(--color-primary);
}
/* ==========================================================================
   LOGIN BRANDING: SKULL-INTEGRATION (100% Inline-Style-Frei)
   ========================================================================== */
/* Zentriert den Schädel auf der Login-Card und sorgt für sauberen Abstand */
.login-brand-logo {
    display: block;
    height: 251px;       /* Kraftvolle, markante Größe für den Einstieg */
    width: auto;        /* Behält das Seitenverhältnis des Bildes exakt bei */
    margin: 0 auto 1.5rem auto; /* Perfekt mittig mit Abstand nach unten */
}
/* ==========================================================================
   UNIVERSAL STATIC HEAD ENGINE (Maximale Ergonomie für lange Listen)
   ========================================================================== */
/* Der umschließende Container begrenzt die Höhe und aktiviert den Scrollbalken */
.table-scroll-container {
    max-height: 70vh; /* Verhindert, dass die Tabelle den Footer aus dem Bild schiebt */
    overflow-y: auto;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow);
    margin-top: 1.5rem;
    background: #ffffff;
}

/* Zwingt den Tabellenkopf (th), beim vertikalen Scrollen oben kleben zu bleiben */
.table-scroll-container th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--color-dark) !important; /* Nutzt eure dunkle Navigationsfarbe */
    color: #ffffff !important;
    box-shadow: inset 0 -2px 0 #cbd5e1; /* Verhindert optisches Durchscheinen der Zeilen */
}
/* ==========================================================================
   KOMPAKTE TABELLEN-BUTTONS (100% Inline-Style-Frei)
   ========================================================================== */
/* Verkleinert die Standard-Buttons, damit sie in Tabellenzeilen nicht klobig wirken */
.btn-small {
    padding: 4px 8px !important;
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
}
/* ==========================================================================
   INTERACTIVE TAB NAV ENGINE (Lehrbuch-Layout für die Weichen)
   ========================================================================== */
/* Der umschließende Container reiht die Reiter sauber nebeneinander auf */
.tab-container {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #cbd5e1; /* Solide Grundlinie */
    margin-bottom: 1.5rem;
    margin-top: 1rem;
}

/* Das Grunddesign für jeden einzelnen Reiter-Knopf */
.tab-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    text-decoration: none !important; /* Weg mit dem hässlichen Standard-Unterstrich! */
    font-weight: 600;
    color: #64748b;
    border: 1px solid #cbd5e1;
    border-bottom: none; /* Unten offen, damit es auf der Linie aufsitzt */
    border-radius: var(--radius) var(--radius) 0 0; /* Nur oben abgerundet */
    background-color: #f8fafc;
    transition: var(--transition);
}

/* Hover-Effekt beim Drüberfahren mit der Maus */
.tab-link:hover {
    background-color: #f1f5f9;
    color: var(--color-dark);
}

/* DER AKTIVE REITER: Holt sich euer mächtiges Schädelfest-Blau/Dunkel */
.tab-link.tab-active {
    background-color: var(--color-dark, #1e293b); /* Nutzt eure dunkle Hauptfarbe */
    color: #ffffff !important;
    border-color: var(--color-dark, #1e293b);
    position: relative;
    margin-bottom: -2px; /* Setzt sich direkt AUF die Trennlinie */
    z-index: 2;
}

/* ==========================================================================
   TAB NAV BRANDING: POMMESGABEL-ICONS (100% Inline-Style-Frei)
   ========================================================================== */
/* Formatiert die quadratischen Favicon-Grafiken innerhalb der Registerkarten */
.tab-favicon-icon {
    height: 24px;       /* Perfekt austariert für die kleine PNG-Grafik */
    width: auto;
    vertical-align: middle;
    margin-right: 4px;  /* Knackiger Abstand zum Text */
    opacity: 0.7;       /* Dezenter Hintergrund-Modus für inaktive Tabs */
    transition: var(--transition);
}

/* Lässt die Pommesgabel beim Hovern und im aktiven Zustand voll aufblitzen */
.tab-link:hover .tab-favicon-icon,
.tab-active .tab-favicon-icon {
    opacity: 1;
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.4));
}

/* Wenn der Reiter aktiv ist oder überfahren wird, brennt der Schädel mit voller Kraft */
.tab-active .tab-skull-icon,
.tab-link:hover .tab-skull-icon {
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.5));
}

/* ==========================================================================
   CREW UTILITIES (100% Inline-Style-Frei)
   ========================================================================== */
.table-cell-center { text-align: center !important; }
.table-actions-flex { display: flex; gap: 4px; justify-content: center; }
.table-cell-code { font-family: monospace; font-weight: 700; color: #475569; }
.table-cell-muted { font-size: 0.85rem; color: var(--color-muted); }
.table-cell-notice { font-size: 11px; color: #94a3b8; font-style: italic; padding: 4px; }
/* ==========================================================================
   AVATAR UPLOAD & LIVE PREVIEW ENGINE (100% Inline-Style-Frei)
   ========================================================================== */
.image-upload-wrapper {
    background: #fafafa;
    border: 1px dashed #cbd5e1;
    padding: 15px;
    max-width: 100%;
    border-radius: var(--radius);
    box-sizing: border-box;
    margin-top: 5px;
}

.avatar-flex-container {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.avatar-box {
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.avatar-box span {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 6px;
}

.preview-img-frame {
    width: 120px;
    height: 120px;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow);
    background: #ffffff;
    object-fit: cover;
}

/* Neue Vorschau hebt sich stilvoll in eurem Schädelfest-Blau ab */
#new_preview_box span {
    color: #3b82f6;
}
#new_preview_image {
    border-color: #3b82f6;
}
/* ==========================================================================
   ADMIN CREW TABLE AVATARS (100% Inline-Style-Frei)
   ========================================================================== */
.table-avatar-frame {
    width: 32px;
    height: 32px;
    border-radius: 50%; /* Macht den Avatar perfekt kreisrund */
    border: 1px solid #cbd5e1;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 8px; /* Knackiger Abstand zum Vornamen */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ==========================================================================
   INTERACTIVE AVATAR LIGHTBOX ZOOM (100% Inline-Style-Frei)
   ========================================================================== */
/* Verwandelt den Cursor über den Avataren in eine Lupe */
.table-avatar-frame {
    cursor: pointer;
    transition: var(--transition);
}
.table-avatar-frame:hover {
    transform: scale(1.1);
    border-color: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* Das abgedunkelte Hintergrund-Gehäuse des Modals */
.avatar-lightbox-overlay {
    display: none; /* Standardmäßig unsichtbar im Hintergrund */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, 0.95); /* Tiefschwarzer Festival-Grund */
    z-index: 2000; /* Thront über allen Navigations-Elementen */
    justify-content: center;
    align-items: center;
    cursor: zoom-out; /* Signalisiert dem User: Klick zum Schließen */
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* Zeigt das Modal mit weichem Einblenden, wenn die Klasse aktiv ist */
.avatar-lightbox-overlay.lightbox-active {
    display: flex;
    opacity: 1;
}

/* Das hochauflösende Riesen-Bild im Zentrum */
.lightbox-big-image {
    max-width: 90%;
    max-height: 85vh;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    transform: scale(0.95);
    transition: transform 0.25s ease;
}
.avatar-lightbox-overlay.lightbox-active .lightbox-big-image {
    transform: scale(1);
}

/* ==========================================================================
   PASSWORD CHECKLIST SIGNAL STATES (100% Inline-Style-Frei)
   ========================================================================== */
/* Wenn die Krypto-Richtlinie noch verletzt ist */
.checklist-item-invalid {
    color: #ef4444 !important;
    font-weight: 700;
}

/* Sobald die Richtlinie erfolgreich erfüllt wurde */
.checklist-item-valid {
    color: #10b981 !important;
    font-weight: 700;
}

/* ==========================================================================
   SYSTEM GATEWAY STEALTH MASTER (ABSOLUTE REPARATUR)
   ========================================================================== */
/* 1a. Hintergrund der Loginseite wird reines Tiefschwarz */
.bg-white { 
    background-color: #ffffff !important; 
}

/* 1b. Hintergrund der Loginseite wird reines Tiefschwarz */
.bg-black { 
    background-color: #000000 !important; 
}

/* 2. Graue Login-Karte verschmilzt nahtlos mit der Finsternis */
.bg-black .login-card { 
    background-color: #000000 !important; 
    border: none !important;               
    box-shadow: none !important;           
    padding: 20px;
}

/* 3. Alle Texte und Labels auf der Loginseite strahlen in hellem Grau/Weiß */
.bg-black .login-card h2,
.bg-black .login-card p,
.bg-black .login-card label,
.bg-black .login-card .table-cell-muted {
    color: #f3f4f6 !important; 
}

/* 4. Der untere "Zurück zur Startseite"-Link wird farblich harmonisiert */
.bg-black .login-card .login-back-link a {
    color: #6b7280 !important;
    transition: var(--transition);
}
.bg-black .login-card .login-back-link a:hover {
    color: #ffffff !important;
}

/* 5. DIE FEURIGE ANMELDE-TASTE: Scharf isoliert NUR für die Login-Seite! */
.bg-black .login-card .btn-login-submit {
    background-color: #ea580c !important; /* Sattes Festival-Orange */
    border: 1px solid #c2410c !important;
    color: #ffffff !important;
    font-weight: 700;
    transition: var(--transition);
}

/* HOVER-EFFEKT: Wird beim Mouse-Over einen Ton HELLER und strahlender! */
.bg-black .login-card .btn-login-submit:hover {
    background-color: #f97316 !important; /* Strahlendes, helleres Orange */
    border-color: #ea580c !important;
    box-shadow: 0 0 14px rgba(249, 115, 22, 0.6) !important; /* Klares Augenfeuer-Glühen */
}

/* ==========================================================================
   PREMIUM PRINT ENGINE: DIN-A4 AUSDRUCK FÜR DIE RAMPE
   ========================================================================== */
@media print {
    /* 1. Alles auf Papier-Optimierung umpolen (Hintergrund weiß, Text schwarz) */
    body, .bg-clean, .table-scroll-container, .data-table {
        background: #ffffff !important;
        color: #000000 !important;
        font-family: Arial, sans-serif !important;
    }

    /* 2. Ballast-Abwurf: Alles ausblenden, was auf dem Klemmbrett nichts verloren hat */
    .sidebar, 
    nav, 
    header, 
    footer, 
    .tab-container, 
    .form-actions,            /* Versteckt normale Formular-Aktionen */
    .filter-row,              /* Blendet die Eingabefelder im Spaltenkopf aus */
    .login-back-link,
    .btn-print-trigger {      /* REPARIERT: Versteckt den Drucken-Knopf exklusiv auf dem Papier! */
        display: none !important;
    }

    /* 3. DIE MAGISCHE FILTER-WEICHE: Blendet Zeilen aus, die das JS versteckt hat */
    #artikelTable tbody tr[style*="display: none"] {
        display: none !important;
    }

    /* 4. Tabelle für das Papier strecken und fixieren */
    .table-scroll-container {
        overflow: visible !important;
        max-height: none !important;
    }

    .data-table {
        width: 100% !important;
        border-collapse: collapse !important;
        page-break-inside: auto !important;
    }

    .data-table tr {
        page-break-inside: avoid !important;
        page-break-after: auto !important;
    }

    /* 5. Kontrastreiche Rahmen für die Maloche auf dem Platz */
    .data-table th, 
    .data-table td {
        border: 1px solid #000000 !important;
        padding: 8px !important;
        color: #000000 !important;
        background: transparent !important;
    }

    /* 6. Status-Badges lesbar machen (Keine bunten Boxen auf Schwarz-Weiß-Druckern) */
    .status-badge, .qty-badge {
        background: transparent !important;
        color: #000000 !important;
        border: none !important;
        padding: 0 !important;
        font-weight: 700 !important;
    }
}

/* ==========================================================================
   TICK-BOX COUNTER & PRINT PURGE (100% Inline-Style-Frei)
   ========================================================================== */
/* Im normalen Browser-Modus auf dem Bildschirm ist das Abhakkästchen unsichtbar */
.table-cell-checkbox-print {
    display: none;
}

@media print {
    /* 1. Buttons für Bearbeiten und Löschen komplett vernichten */
    .data-table th:last-child, 
    .data-table td:last-child,
    .table-actions-flex {
        display: none !important;
    }

    /* 2. Die Abhakkästchen-Spalte exklusiv auf dem Papier einblenden */
    .table-cell-checkbox-print {
        display: table-cell !important;
        width: 30px !important;
        text-align: center !important;
        vertical-align: middle !important;
    }

    /* Das quadratische Kästchen für den Kugelschreiber auf dem Papier zeichnen */
    .print-tick-box {
        display: block !important;
        width: 16px !important;
        height: 16px !important;
        border: 2px solid #000000 !important;
        margin: 0 auto !important;
        background: #ffffff !important;
    }
}

/* ==========================================================================
   LINUX/CUPS PRINT-NAME ENGINE (100% Inline-Style-Frei)
   ========================================================================== */
/* Im normalen Browser auf dem Bildschirm existiert dieser Titel nicht */
.print-only-filename-header {
    display: none;
}

@media print {
    /* Die normale, emoji-belastete Überschrift radikal für den Drucker vernichten */
    h1, .login-card h2 {
        display: none !important;
    }

    /* Den klinisch reinen, dateisicheren Titel als allererstes Element einblenden */
    .print-only-filename-header {
        display: block !important;
        color: #000000 !important;
        font-size: 24px !important;
        font-weight: bold !important;
        font-family: Arial, sans-serif !important;
        margin-bottom: 10px !important;
        border-bottom: 2px solid #000000 !important;
        padding-bottom: 5px !important;
    }
}

/* ==========================================================================
   VISUELLER SCREEN-AIRBAG FOR DEN TEXT-DRUCKKNOPF
   ========================================================================== */
/* Isolierter Container sorgt dafür, dass der Knopf im Browser IMMER sichtbar bleibt */
.print-action-bar-screen {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Der dezente, sekundäre Button nach Lehrbuch-Standard */
.btn-sekundaer {
    display: inline-block;
    padding: 8px 16px;
    color: #000000 !important;
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important; /* Diskreter, grauer Rahmen */
    border-radius: 4px !important;       /* Feine, saubere Rundung */
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

/* Ruhiger Hover-Effekt: Der Rahmen wird minimal dunkler und der Hintergrund kriegt ein dezentes Grau */
.btn-sekundaer:hover {
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    text-decoration: none !important;
}

/* Der massive, professionelle Haupt-Button für die Vereins-Zentrale */
.btn-primary-solid {
    display: block;
    width: 100%;                  /* Füllt die Login-Karte sauber in der Breite aus */
    padding: 12px 24px;
    color: #ffffff !important;     /* Kristallklares Weiß auf tiefschwarzem Grund */
    background-color: #000000 !important; /* Hauch von zeitloser Eleganz statt Standard-Blau */
    border: 2px solid #000000 !important;
    border-radius: 6px !important;  /* Perfekt austarierte, moderne Rundung */
    font-size: 1rem !important;
    font-weight: 700 !important;   /* Kraftvoller Schriftschnitt für die Aktion */
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

/* Hover-Effekt: Perfekter visueller Bezug zum jugendlichen Sonnengelb des Vereins */
.btn-primary-solid:hover {
    background-color: #ffcf38 !important; /* Euer markantes Sonnengelb blitzt beim Drüberfahren auf */
    border-color: #e0b428 !important;
    color: #000000 !important;            /* Text wechselt für maximalen Kontrast auf Schwarz */
    text-decoration: none !important;
}

/* Der dezente, schlichte Button nach dem exakten Vorbild der Startseite */
.btn-sekundaer {
    display: inline-block;
    color: #000000 !important;
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important; /* Diskreter, grauer Rahmen */
    border-radius: 4px !important;       /* Feine, saubere Rundung */
    font-weight: 700 !important;         /* Kräftiger Schriftschnitt für die Lesbarkeit */
    text-decoration: none !important;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

/* Ruhiger, unaufdringlicher Hover-Effekt ohne jede Farb-Explosion */
.btn-sekundaer:hover {
    background-color: #f1f5f9 !important; /* Ganz dezentes, mattes Hellgrau */
    border-color: #94a3b8 !important;     /* Rahmen wird minimal dunkler */
    text-decoration: none !important;
}

/* ==========================================================================
   UNBUNTE GEFAHREN-SCHALTFLÄCHE (Passend zum Profil-Design)
   ========================================================================== */
.btn-danger-outline {
    display: inline-block;
    padding: 8px 16px;
    color: var(--color-danger, #dc3545) !important;
    background-color: #ffffff !important;
    border: 1px solid var(--color-danger, #dc3545) !important;
    border-radius: 4px !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger-outline:hover {
    background-color: #f8d7da !important; /* Ganz dezentes, mattes Hellrot */
    text-decoration: none !important;
}

/* Spezifische Begrenzung für die administrative Crew-Tabelle zur Vermeidung von Doppel-Scrollbalken */
.table-scroll-container-admin {
    position: relative;
    overflow-y: auto;
    max-height: 60vh;
    border-bottom: 1px solid #cbd5e1;
}

/* Bombenfeste Fixierung für die erste Zeile (Überschriften) */
.sticky-th-row th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #1e293b;
    color: #ffffff;
}

/* Bombenfeste Fixierung für die zweite Zeile (Filter-Inputs) */
.sticky-filter-row th {
    position: sticky;
    top: 43px; /* Versatz entspricht der Höhe der ersten Zeile */
    z-index: 9;
    background: #1e293b;
}
/* Kompaktes Datenblatt für die schreibgeschützte Detailansicht */
.member-sheet-container {
    max-width: 700px;
    margin-top: 20px;
}

.member-sheet-flex {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    justify-content: space-between;
}

.member-sheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.member-sheet-table th {
    text-align: left;
    font-size: 1.15rem;
    padding-bottom: 12px;
    border-bottom: 2px solid #cbd5e1;
    color: #1e293b;
}

.member-sheet-table td {
    padding: 8px 0;
    color: #0f172a;
}

/* Die linke Beschriftungs-Spalte */
.member-sheet-label {
    color: #64748b !important;
    width: 150px;
}

/* Spezifische Abstände für Sektionswechsel innerhalb der Tabelle */
.member-sheet-section-break th {
    padding-top: 12px;
}

.member-sheet-section-break td {
    padding-bottom: 24px;
}

/* Bild-Spalte im Datenblatt */
.member-sheet-avatar-box {
    flex-shrink: 0;
    text-align: center;
}

.member-sheet-avatar-box img {
    cursor: zoom-in;
    width: 160px;
    height: 160px;
    object-fit: cover;
}

.member-sheet-avatar-box div {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 6px;
}

/* Trennlinie zu den Fuß-Aktionen */
.member-sheet-actions {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 16px;
}

.btn-flat-outline {
    background: none;
    border: 1px solid #cbd5e1;
    color: #475569;
}

/* Erzwingt eine normale (nicht fette) Schriftstärke für die Mitgliedsnummer im Datenblatt */
.member-sheet-table .table-cell-code {
    font-weight: normal !important;
}
