:root {
    --glass: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.15);
    --accent: #22c55e;
    --blue: #38bdf8;
    --indigo: #6366f1;
    --red: #ef4444;
}

/* Grund-Setup */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    background: linear-gradient(rgba(15,23,42,0.8), rgba(15,23,42,0.8)), 
                url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?auto=format&fit=crop&q=80&w=2000');
    background-size: cover; 
    background-attachment: fixed;
    font-family: 'Inter', sans-serif; 
    color: #f8fafc; 
    padding: 20px 10px; /* Reduziertes Padding für mobile Bildschirme */
}

/* Layout Container */
.container { 
    max-width: 950px; 
    margin: 0 auto; 
    display: flex; 
    flex-direction: column; 
    gap: 20px; /* Kompakterer Abstand */
}

.main-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 10px; 
}

.logo-large { 
    height: 60px; /* Leicht verkleinert für Mobile */
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4)); 
}

/* Karten & Panels */
.card { 
    background: var(--glass); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border); 
    border-radius: 20px; 
    padding: 20px; 
}

.admin-card { border: 1px solid var(--blue); }
.border-red { border: 1px solid var(--red) !important; }
.section-title { margin-bottom: 15px; font-weight: 800; font-size: 1.2rem; }

.admin-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
}

.admin-panel { 
    background: rgba(0,0,0,0.2); 
    padding: 15px; 
    border-radius: 15px; 
    border: 1px solid var(--border); 
}

.admin-panel h3 { 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    color: var(--blue); 
    margin-bottom: 12px; 
}

/* Formularelemente */
.field-stack { display: flex; flex-direction: column; gap: 10px; }
.input-row { display: flex; gap: 10px; }
.input-with-del { display: grid; grid-template-columns: 1fr 45px; gap: 10px; }
.hr { height: 1px; background: var(--border); margin: 10px 0; }

.main-form-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 12px; 
}

.input-group { display: flex; flex-direction: column; gap: 5px; }
.input-group label { 
    font-size: 0.7rem; 
    font-weight: 700; 
    color: #94a3b8; 
    margin-left: 5px; 
}

input, select { 
    background: rgba(15, 23, 42, 0.7); 
    border: 1px solid var(--border); 
    color: white; 
    padding: 12px; 
    border-radius: 12px; 
    font-size: 1rem; /* 1rem verhindert den Auto-Zoom auf iPhones */
    outline: none; 
    transition: 0.3s; 
    width: 100%;
}

input:focus { border-color: var(--blue); background: rgba(15, 23, 42, 0.9); }

/* Buttons */
button { 
    cursor: pointer; 
    border: none; 
    font-weight: 700; 
    border-radius: 12px; 
    transition: 0.2s; 
    min-height: 48px; /* Bessere Treffsicherheit für Fingerbedienung */
}

.btn-primary { background: var(--accent); color: white; padding: 10px; }
.btn-blue { background: var(--blue); color: #0f172a; padding: 10px; }
.btn-indigo { background: var(--indigo); color: white; padding: 10px; }
.btn-ghost { 
    background: var(--glass); 
    color: white; 
    border: 1px solid var(--border); 
    padding: 8px 15px; 
    min-height: 40px; 
}
.btn-del-icon { background: rgba(239, 68, 68, 0.2); color: var(--red); }

/* Verbrauchs-Helfer */
.consumption-grid {
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px;
    margin-top: 15px; 
    background: rgba(56, 189, 248, 0.1); 
    padding: 15px;
    border-radius: 15px; 
    border: 1px solid var(--blue);
}

.con-item { 
    font-size: 0.75rem; 
    color: #94a3b8; 
    display: flex; 
    justify-content: space-between; 
}

.con-item.full-width { grid-column: span 2; }
.con-item b { color: white; }

/* Admin Tabelle */
.price-input-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr 80px 100px; 
    gap: 10px; 
    margin-bottom: 15px; 
}

.table-container { 
    max-height: 250px; 
    overflow-y: auto; 
    border-radius: 12px; 
}

.modern-table { 
    width: 100%; 
    border-collapse: collapse; 
    background: rgba(0,0,0,0.2); 
    text-align: left; 
}

.modern-table th { 
    padding: 12px; 
    font-size: 0.7rem; 
    border-bottom: 1px solid var(--border); 
    color: #94a3b8; 
}

.modern-table td { 
    padding: 10px 12px; 
    border-bottom: 1px solid rgba(255,255,255,0.05); 
    font-size: 0.85rem; 
}

/* Rechnungen & Stempel */
.filter-select { width: 100%; margin-bottom: 15px; }

.invoice-item { 
    padding: 20px; 
    border-bottom: 1px solid rgba(255,255,255,0.1); 
    position: relative; 
    overflow: hidden; 
}

.invoice-item:last-child { border-bottom: none; }

.status-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    border: 5px solid;
    padding: 8px 20px;
    border-radius: 12px;
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
    white-space: nowrap;
}

.stamp-paid { color: var(--accent); border-color: var(--accent); }
.stamp-rejected { color: var(--red); border-color: var(--red); }

.status-tag { 
    padding: 4px 8px; 
    border-radius: 6px; 
    font-size: 0.65rem; 
    font-weight: 800; 
    text-transform: uppercase; 
}

.total-banner { 
    background: var(--accent); 
    color: white; 
    padding: 15px; 
    border-radius: 15px; 
    text-align: center; 
    margin-top: 15px; 
    font-weight: 800; 
    font-size: 1.1rem; 
}

/* Modal */
.modal-overlay { 
    position: fixed; 
    inset: 0; 
    background: rgba(15, 23, 42, 0.9); 
    backdrop-filter: blur(15px); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 9999; 
    padding: 20px;
}

.modal-content { max-width: 400px; width: 100%; }
.modal-btns { display: flex; gap: 10px; margin-top: 20px; }

/* Hilfsklassen */
.hidden { display: none !important; }
.w-100 { width: 100%; }
.margin-top { margin-top: 15px; }
.btn-group { display: flex; gap: 10px; }

/* --- MOBILE OPTIMIERUNGEN (Traktor-Modus) --- */
@media (max-width: 650px) {
    .main-form-grid, .admin-grid {
        grid-template-columns: 1fr; /* Felder untereinander statt nebeneinander */
    }
    
    .price-input-grid {
        grid-template-columns: 1fr 1fr; /* Admin Preiseingabe kompakter */
    }
    
    .price-input-grid button {
        grid-column: span 2;
    }

    .btn-group {
        flex-direction: column; /* Buttons stapeln für bessere Daumen-Erreichbarkeit */
    }

    .logo-large {
        height: 45px;
    }

    .section-title {
        font-size: 1.1rem;
    }

    /* Tabelle kompakter für kleine Bildschirme */
    .modern-table th:nth-child(1), 
    .modern-table td:nth-child(1) {
        display: none; /* Blendet "Kategorie" aus, um Platz für Leistung/Preis zu schaffen */
    }
    
    .card {
        padding: 15px;
    }
}