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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* Neuer Background wie gewünscht */
    background: linear-gradient(135deg, #bdc3c7 0%, #e67e22 60%, #c0392b 100%);
    min-height: 100vh;
    padding: 20px;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 20px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.user-greeting {
    font-size: 1em;
    margin-top: 10px;
}

.header-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
    flex-wrap: wrap;
}

.template-btn, .admin-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    border: none;
}

.template-btn {
    background: white;
    /* Angepasste Textfarbe (Orange) */
    color: #e67e22;
    border: 2px solid white;
}

.template-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.admin-btn {
    background: #dc3545;
    color: white;
    border: 2px solid #dc3545;
}

.admin-btn:hover {
    background: #c82333;
    border-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

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

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 15px;
}

.modal-content p {
    color: #666;
    margin-bottom: 20px;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.modal-content input:focus {
    outline: none;
    /* Fokus Farbe (Orange) */
    border-color: #e67e22;
}

.modal-content button {
    width: 100%;
    padding: 12px;
    /* Button Gradient angepasst */
    background: linear-gradient(135deg, #bdc3c7 0%, #e67e22 60%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.2s;
}

.modal-content button:hover {
    transform: translateY(-2px);
}

/* Warning Banner */
.warning-banner {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    color: #856404;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.3);
}

.upload-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.file-input-wrapper input[type="file"] {
    display: none;
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    /* Border Farbe (Orange) */
    border: 3px dashed #e67e22;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
    font-size: 1.1em;
}

.file-label:hover {
    /* Hover Border Farbe (Rot) */
    border-color: #c0392b;
    background: #f0f0f0;
}

.file-icon {
    font-size: 2em;
}

.info-box {
    background: #f8f9fa;
    /* Info Box Rand (Orange) */
    border-left: 4px solid #e67e22;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.info-box h3 {
    color: #333;
    margin-bottom: 10px;
}

.info-box ul {
    list-style-position: inside;
    color: #666;
}

.info-box li {
    margin-bottom: 5px;
}

#uploadBtn {
    width: 100%;
    padding: 15px;
    /* Upload Button Gradient angepasst */
    background: linear-gradient(135deg, #bdc3c7 0%, #e67e22 60%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

#uploadBtn:hover {
    transform: translateY(-2px);
    /* Angepasster Shadow (Orange-Basis) */
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.4);
}

#uploadBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    display: none;
}

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

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

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 15px;
}

.progress-fill {
    height: 100%;
    /* Progress Bar Gradient angepasst */
    background: linear-gradient(90deg, #bdc3c7 0%, #e67e22 60%, #c0392b 100%);
    width: 0%;
    transition: width 0.3s;
    animation: progress 1.5s infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 0%; }
}

.uploaded-files {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.uploaded-files h2 {
    color: #333;
    margin-bottom: 15px;
}

.refresh-btn {
    /* Button Farbe (Orange) */
    background: #e67e22;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 15px;
    font-size: 1em;
}

.refresh-btn:hover {
    /* Hover Farbe (Rot) */
    background: #c0392b;
}

#fileList {
    list-style: none;
}

#fileList li {
    padding: 12px;
    background: #f8f9fa;
    margin-bottom: 8px;
    border-radius: 5px;
    /* Rand Farbe (Orange) */
    border-left: 4px solid #e67e22;
    word-break: break-all;
}

#fileList li:hover {
    background: #e9ecef;
}

/* User's Files Section */
.my-files {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.my-files h2 {
    color: #333;
    margin-bottom: 15px;
}

#myFileList {
    list-style: none;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    margin-bottom: 8px;
    border-radius: 8px;
    /* Rand Farbe (Orange) */
    border-left: 4px solid #e67e22;
    transition: all 0.3s;
}

.file-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.file-name {
    flex: 1;
    word-break: break-word;
    margin-right: 10px;
    color: #333;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.delete-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.empty-message {
    padding: 20px;
    text-align: center;
    color: #666;
    background: transparent !important;
    border: none !important;
}

@media (max-width: 600px) {
    header h1 {
        font-size: 2em;
    }
    
    .upload-section, .uploaded-files {
        padding: 20px;
    }
}
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    color: white;
}

.admin-header h1 {
    font-size: 2em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border: 2px solid white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.back-btn:hover {
    background: white;
    color: #e67e22; /* Dein Orange-Ton */
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.dashboard-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.dashboard-section h2 {
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-size: 1.5em;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #eee;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.stat-card h3 {
    font-size: 3em;
    color: #e67e22; /* Dein Orange-Ton */
    margin: 0 0 10px 0;
}

.stat-card p {
    color: #666;
    font-weight: 500;
    margin: 0;
}

/* Tabellen */
.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th, .users-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.users-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
    border-radius: 4px;
}

.users-table tr:hover {
    background-color: #fcfcfc;
}

.admin-badge {
    background: #e67e22;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: bold;
    margin-left: 8px;
    vertical-align: middle;
}

/* Missing Users List */
.missing-users-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    list-style: none;
    padding: 0;
}

.missing-users-list li {
    background: #fff3cd; /* Gelblicher Ton für Warnung/Fehlend */
    color: #856404;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #ffeeba;
    font-weight: 500;
}

/* Missing Users Collapsible */
.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    padding: 8px 0;
}

.collapsible-toggle {
    background: none;
    border: none;
    font-size: 1rem;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: inherit;
}

.collapsible-toggle:focus {
    outline: 2px solid rgba(230,126,34,0.5);
    outline-offset: 2px;
}

.collapsible-content {
    overflow: hidden;
    transition: height 220ms ease;
    height: 0;
}

.collapsible-content.open {
    /* height set inline via JS when opened */
}

.chevron {
    transition: transform 220ms ease;
    display: inline-block;
}

.chevron.open {
    transform: rotate(90deg);
}

/* End Missing Users Collapsible */

/* File Explorer */
.file-explorer {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
}

.file-item-admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: white;
}

.file-item-admin:last-child {
    border-bottom: none;
}

.file-item-admin:hover {
    background-color: #f8f9fa;
}
/* Generelles Loading Styling */
.loading {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Inputs und Selects schön machen */
.search-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
}

.search-input:focus {
    outline: none;
    border-color: #e67e22; /* Dein Orange */
    background-color: white;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

/* Buttons (z.B. für "Verknüpfung erstellen") */
.download-btn {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 0.95em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(211, 84, 0, 0.3);
}

/* Delete Buttons (klein rot) */
.delete-btn-small {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
}

.delete-btn-small:hover {
    background-color: #c62828;
    color: white;
    border-color: #c62828;
}

/* Datei Explorer */
.file-explorer {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fafafa;
}

.file-item-admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    background: white;
    transition: background-color 0.2s;
}

.file-item-admin:last-child {
    border-bottom: none;
}

.file-item-admin:hover {
    background-color: #fff3e0; /* Ganz leichtes Orange beim Hover */
}

.file-info strong {
    color: #333;
    display: block;
    margin-bottom: 2px;
}

.file-info span {
    color: #888;
    font-size: 0.85em;
}

.file-actions {
    display: flex;
    gap: 8px;
}

/* Mappings (Verknüpfungen) Liste */
.mapping-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    border: 1px solid #eee;
    border-left: 4px solid #e67e22; /* Oranger Akzent links */
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.mapping-text {
    font-weight: 500;
    color: #444;
}

.mapping-arrow {
    margin: 0 10px;
    color: #bbb;
}

/* Suchergebnisse (Admin Grant) */
.user-search-result {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-search-result:last-child {
    border-bottom: none;
}
/* Widget links styling */
.widgets-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.widget-link {
    flex: 1;
    min-width: 200px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.widget-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.widget-link:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.widget-link:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.widget-link-icon {
    font-size: 32px;
}

.widget-link-text {
    font-size: 16px;
    font-weight: bold;
}

.widget-link-desc {
    font-size: 12px;
    opacity: 0.9;
}

/* Email Section Styles */
.email-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.email-section h2 {
    color: #e67e22;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.email-section input[type="email"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    margin-bottom: 10px;
}

.email-section input[type="email"]:focus {
    outline: none;
    border-color: #e67e22;
}

.email-section button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    margin-right: 10px;
    margin-top: 10px;
}

.email-section button:first-of-type {
    background: #e67e22;
    color: white;
}

.email-section button:first-of-type:hover {
    background: #d35400;
}

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

.secondary-btn:hover {
    background: #7f8c8d !important;
}

/* Password Modal Styles */
#passwordModal .modal-content {
    max-width: 450px;
}

#passwordModal input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    margin: 15px 0;
}

#passwordModal input[type="text"]:focus {
    outline: none;
    border-color: #e67e22;
}

.link-btn {
    background: none;
    border: none;
    color: #e67e22;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
}

.link-btn:hover {
    color: #d35400;
}

/* Email input in name modal */
#nameModal input[type="email"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    margin-top: 5px;
}

#nameModal input[type="email"]:focus {
    outline: none;
    border-color: #e67e22;
}

#missingCountBoxItem {
    font-size: 0.95rem !important;
    padding: 6px 9px !important;
    min-width: 34px !important;
    border-radius: 8px !important;
    line-height: 1 !important;
    text-align: center !important;
    vertical-align: middle !important;
    font-weight: 600 !important;
}
#missingTeachersCountBoxItem {
    font-size: 0.95rem !important;
    padding: 6px 9px !important;
    min-width: 34px !important;
    border-radius: 8px !important;
    line-height: 1 !important;
    text-align: center !important;
    vertical-align: middle !important;
    font-weight: 600 !important;
}