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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #f5f5f5;
    padding: 20px;
}

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

.header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #333;
    font-size: 24px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 24px;
    background: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.tab:hover {
    background: #f0f0f0;
}

.tab.active {
    background: #007bff;
    color: white;
}

.content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: none;
}

.content.active {
    display: block;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 0;
}

.btn {
    padding: 12px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.btn:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-small {
    padding: 6px 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 5px;
    transition: background 0.3s;
}

.btn-small:hover {
    background: #0056b3;
}

.btn-small.btn-danger {
    background: #dc3545;
}

.btn-small.btn-danger:hover {
    background: #c82333;
}

.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
}

table tr:hover {
    background: #f8f9fa;
}

.barcode-display {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

.login-box {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-box h2 {
    margin-bottom: 30px;
    text-align: center;
    color: #333;
}

.scanner-input {
    font-size: 18px;
    font-weight: bold;
    background: #fffacd;
}

/* Import-Vorschau Styles */
.import-info {
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.import-info code {
    display: block;
    margin-top: 10px;
    padding: 10px;
    background: white;
    border-radius: 4px;
    font-size: 12px;
    overflow-x: auto;
    white-space: nowrap;
}

.import-vorschau {
    margin-top: 20px;
}

.vorschau-legende {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.legende-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.marker {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 3px;
}

.marker-neu {
    background: #d4edda;
    border: 2px solid #28a745;
}

.marker-duplikat {
    background: #fff3cd;
    border: 2px solid #ffc107;
}

.table-wrapper {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 15px 0;
}

.vorschau-tabelle {
    margin: 0;
    font-size: 14px;
}

.vorschau-tabelle thead {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.vorschau-tabelle th {
    background: #007bff;
    color: white;
    font-weight: 600;
    padding: 12px 10px;
}

.vorschau-tabelle td {
    padding: 10px;
}

.row-neu {
    background: #d4edda;
}

.row-duplikat {
    background: #fff3cd;
}

.row-neu:hover,
.row-duplikat:hover {
    filter: brightness(0.95);
}

.duplikat-badge {
    margin-left: 5px;
    font-size: 16px;
    cursor: help;
}

.typ-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.typ-schueler {
    background: #cce5ff;
    color: #004085;
}

.typ-lehrer {
    background: #d4edda;
    color: #155724;
}

.typ-mitarbeiter {
    background: #f8d7da;
    color: #721c24;
}

/* Checkbox Styling */
.vorschau-tabelle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.vorschau-tabelle thead input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 20px;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: #000;
}

/* Suchfeld Styling */
#nutzer_suche {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    width: 100%;
}

#nutzer_suche:focus {
    outline: none;
    border-color: #007bff;
}

/* Button-Gruppen */
.btn + .btn {
    margin-left: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        width: 100%;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    table {
        font-size: 14px;
    }
    
    table th,
    table td {
        padding: 8px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Nutzer-Details Modal */
.nutzer-details-header {
    border-bottom: 2px solid #007bff;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.nutzer-details-header h2 {
    margin-bottom: 15px;
    color: #333;
}

.nutzer-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    font-size: 14px;
}

.nutzer-statistik {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #e9ecef;
}

.stat-box.stat-warning {
    background: #fff3cd;
    border-color: #ffc107;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #007bff;
}

.stat-box.stat-warning .stat-number {
    color: #dc3545;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    text-transform: uppercase;
}

.detail-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.detail-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.detail-tab:hover {
    color: #007bff;
}

.detail-tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.detail-tab-content {
    display: none;
}

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

.detail-table {
    margin: 0;
    font-size: 14px;
}

.detail-table th {
    background: #007bff;
    color: white;
    padding: 12px;
}

.detail-table td {
    padding: 12px;
}

.status-ok {
    color: #28a745;
    font-weight: 600;
}

.status-ueberfaellig {
    color: #dc3545;
    font-weight: 600;
}

.status-verspaetet {
    color: #ffc107;
    font-weight: 600;
}

.status-puenktlich {
    color: #28a745;
    font-weight: 600;
}

/* Spinner für Loading */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Nutzer-Details */
@media (max-width: 768px) {
    .nutzer-statistik {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nutzer-info-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-table {
        font-size: 12px;
    }
    
    .detail-table th,
    .detail-table td {
        padding: 8px;
    }
}