/* === GRUNDLAGEN === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* === NAVBAR === */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-brand {
    font-size: 1.4rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.nav-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

.badge.admin {
    background: #e74c3c;
}

.btn-logout {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.2);
}

/* === LOGIN === */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

/* === BUTTONS === */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-full {
    width: 100%;
}

.btn-refresh {
    background: #ecf0f1;
    color: #333;
}

.btn-refresh:hover {
    background: #bdc3c7;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

/* === DASHBOARD === */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-header h1 {
    color: #2c3e50;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.filter-select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
}

/* === AUFTRÄGE LISTE === */
.auftraege-liste {
    display: grid;
    gap: 15px;
}

.auftrag-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.3s;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    align-items: center;
}

.auftrag-card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.auftrag-info h3 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.auftrag-info p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.auftrag-meta {
    text-align: right;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.status-neu { background: #3498db; color: white; }
.status-bestaetigt { background: #2ecc71; color: white; }
.status-in_arbeit { background: #f39c12; color: white; }
.status-erledigt { background: #95a5a6; color: white; }
.status-storniert { background: #e74c3c; color: white; }

.auftrag-datum {
    color: #95a5a6;
    font-size: 0.85rem;
}

/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-large {
    max-width: 800px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #95a5a6;
}

.modal-close:hover {
    color: #333;
}

/* === DETAIL ANSICHT === */
.detail-header {
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.detail-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.detail-item label {
    display: block;
    font-size: 0.8rem;
    color: #95a5a6;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.detail-item span {
    font-size: 1.1rem;
    color: #2c3e50;
}

.detail-beschreibung {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* === GESPRÄCHSVERLAUF === */
.verlauf-container {
    max-height: 500px;
    overflow-y: auto;
}

.verlauf-nachricht {
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 10px;
    max-width: 80%;
}

.verlauf-eingehend {
    background: #ecf0f1;
    margin-right: auto;
}

.verlauf-ausgehend {
    background: #3498db;
    color: white;
    margin-left: auto;
}

.verlauf-zeit {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 5px;
}

/* === ALERTS === */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success { background: #d4edda; color: #155724; }
.alert-error { background: #f8d7da; color: #721c24; }
.alert-warning { background: #fff3cd; color: #856404; }

/* === LOADING === */
.loading {
    text-align: center;
    padding: 40px;
    color: #95a5a6;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .auftrag-card {
        grid-template-columns: 1fr;
    }
    
    .auftrag-meta {
        text-align: left;
    }
}

/* === ADMIN PANEL === */
.admin-container {
    max-width: 1000px;
    margin: 0 auto;
}

.admin-container h1 {
    margin-bottom: 30px;
    color: #2c3e50;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: none;
    font-size: 1rem;
    cursor: pointer;
    color: #7f8c8d;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #ecf0f1;
}

.tab-btn.active {
    background: #3498db;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tab-header h2 {
    color: #2c3e50;
}

.tab-header-actions {
    display: flex;
    gap: 15px;
}

.admin-liste {
    display: grid;
    gap: 15px;
}

.admin-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-card-info h3 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.admin-card-info p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.admin-card-actions {
    display: flex;
    gap: 10px;
}

.btn-edit {
    background: #3498db;
    color: white;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

/* === ADMIN FORMULARE === */
.admin-form {
    display: grid;
    gap: 20px;
}

.admin-form h2 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 150px;
}

.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 10px;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.dokument-typ-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #666;
}

.dokument-typ-info strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
}

/* === DATEI UPLOAD === */
.file-input {
    width: 100%;
    padding: 12px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
}

.file-input:hover {
    border-color: #3498db;
}

.datei-info {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.datei-info.datei-gewaehlt {
    background: #d4edda;
    color: #155724;
}

.aktuelle-datei {
    background: #e3f2fd;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #1565c0;
}