:root {
            --primary: #2d7a4d;
            --primary-light: #4ade80;
            --primary-dark: #1e5a33;
            --secondary: #f0fdf4;
            --text: #1f2937;
            --text-light: #6b7280;
            --border: #e5e7eb;
            --danger: #ef4444;
            --warning: #f59e0b;
            --success: #10b981;
            --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            --radius: 8px;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #f8fafc;
            color: var(--text);
            line-height: 1.6;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 20px;
        }

        header {
            background: linear-gradient(135deg, var(--primary-dark), var(--primary));
            color: white;
            padding: 15px 0 25px 0;
            margin-bottom: 30px;
            box-shadow: var(--shadow);
        }

        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 20px;
        }

        header h1 {
            font-size: 1.8rem;
            margin-bottom: 0;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        header p {
            text-align: center;
            opacity: 0.9;
            margin-top: 5px;
        }

        /* Main Navigation */
        .main-nav ul {
            display: flex;
            list-style: none;
            margin: 0;
            padding: 0;
            gap: 5px;
            flex-wrap: wrap;
        }

        .main-nav li {
            margin: 0;
        }

        .main-nav a {
            color: white;
            text-decoration: none;
            padding: 10px 16px;
            border-radius: var(--radius);
            font-size: 0.95rem;
            font-weight: 500;
            transition: all 0.3s ease;
            display: block;
        }

        .main-nav a:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .main-nav a.active {
            background: rgba(255, 255, 255, 0.3);
            /*font-weight: 600;*/
        }

        .nav-tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            border-bottom: 2px solid var(--border);
            flex-wrap: wrap;
        }

        .nav-tab {
            padding: 12px 24px;
            background: transparent;
            border: none;
            border-bottom: 3px solid transparent;
            cursor: pointer;
            font-size: 1rem;
            font-weight: 500;
            color: var(--text-light);
            transition: all 0.3s ease;
        }

        .nav-tab:hover {
            color: var(--primary);
        }

        .nav-tab.active {
            color: var(--primary);
            border-bottom-color: var(--primary);
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .card {
            background: white;
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 20px;
            margin-bottom: 20px;
        }

        .card h2 {
            color: var(--primary);
            margin-bottom: 15px;
            font-size: 1.25rem;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .card h2::before {
            content: '';
            width: 4px;
            height: 20px;
            background: var(--primary);
            border-radius: 2px;
        }

        /* Wochentags-Überschriften */
        .wochentag {
            background: color-mix(in srgb, var(--primary) 10%, white);
            padding: 15px 20px;
            margin: 20px 0 10px 0;
            border-radius: var(--radius);
            border-left: 4px solid var(--primary);
            font-weight: 600;
            font-size: 1.1rem;
            color: var(--primary-dark);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        /* Unterrichtsstunden Übersicht */
        .stunden-uebersicht {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .stunden-tag-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 15px;
            margin-bottom: 15px;
        }

        .stunde-card {
            background: white;
            border-radius: var(--radius);
            padding: 15px;
            box-shadow: var(--shadow);
            border-left: 4px solid var(--primary);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        a > .stunde-card {
            cursor: pointer;
        }

        a > .stunde-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .stunde-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
            flex-wrap: wrap;
            gap: 10px;
        }

        .stunde-fach {
            font-weight: 600;
            color: var(--primary);
            font-size: 1.1rem;
        }

        .stunde-klasse {
            font-size: 0.9rem;
            color: var(--text);
            background: var(--secondary);
            padding: 4px 10px;
            border-radius: 12px;
            font-weight: 500;
        }

        .stunde-info {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 10px;
            margin-bottom: 10px;
        }

        .stunde-meta {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.9rem;
            color: var(--text-light);
        }

        .stunde-meta i {
            color: var(--primary);
        }

        .stunde-raum {
            font-weight: 500;
        }

        .stunde-status, .badge {
            display: inline-block;
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 0.8rem;
            font-weight: 500;
            text-transform: uppercase;
        }

        .anstehend, .status-ok {
            background: #d1fae5;
            color: #065f46;
        }

        .abgeschlossen, .status-tbd {
            background: #dbeafe;
            color: #1e40af;
        }

        .abgesagt, .status-nok {
            background: #fee2e2;
            color: #991b1b;
        }

        /* Stundendetailansicht */
        .stunde-detail {
            background: white;
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 25px;
            margin-bottom: 20px;
        }

        .stunde-detail-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 20px;
            border-bottom: 2px solid var(--border);
            flex-wrap: wrap;
            gap: 15px;
        }

        .stunde-detail-titel {
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--primary);
        }

        .stunde-detail-info {
            display: flex;
            gap: 20px;
            flex-wrap: wrap;
        }

        .stunde-detail-meta {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.9rem;
            color: var(--text-light);
            background: var(--secondary);
            padding: 6px 12px;
            border-radius: 8px;
        }

        .stunde-detail-meta i {
            color: var(--primary);
        }

        .stunde-detail-section {
            margin-bottom: 25px;
        }

        .stunde-detail-section h3 {
            color: var(--primary);
            margin-bottom: 12px;
            font-size: 1.1rem;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .stunde-detail-section h3::before {
            content: '';
            width: 3px;
            height: 18px;
            background: var(--primary);
            border-radius: 2px;
        }

        .anwesenheits-liste {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 10px;
        }

        .anwesenheits-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px;
            background: var(--secondary);
            border-radius: var(--radius);
            transition: background 0.2s ease;
        }

        .anwesenheits-item:hover {
            background: #e0f2e6;
        }

        .anwesenheits-checkbox {
            width: 20px;
            height: 20px;
            cursor: pointer;
        }

        .anwesenheits-name {
            flex: 1;
            font-weight: 500;
        }

        .muendliche-note-input {
            width: 50px;
            padding: 6px;
            border: 1px solid var(--border);
            border-radius: 4px;
            text-align: center;
            font-size: 0.9rem;
            transition: border-color 0.2s ease;
        }

        .muendliche-note-input:focus {
            outline: none;
            border-color: var(--primary);
        }

        .stundeninhalt-textarea {
            width: 100%;
            min-height: 100px;
            padding: 12px;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            font-size: 0.95rem;
            font-family: inherit;
            resize: vertical;
            transition: border-color 0.2s ease;
        }

        .stundeninhalt-textarea:focus {
            outline: none;
            border-color: var(--primary);
        }

        /* Buttons */
        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: var(--radius);
            font-size: 0.95rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .btn-primary {
            background: var(--primary);
            color: white !important;
        }

        .btn-primary:hover {
            background: var(--primary-dark);
        }

        .btn-secondary {
            background: var(--secondary);
            color: var(--primary);
            border: 1px solid var(--primary);
        }

        .btn-secondary:hover {
            background: var(--primary);
            color: white;
        }

        .btn-success {
            background: var(--success);
            color: white;
        }

        .btn-warning {
            background: var(--warning);
            color: white;
        }

        .btn-danger {
            background: var(--danger);
            color: white;
        }

        .btn-sm {
            padding: 6px 12px;
            font-size: 0.85rem;
        }

        .btn-group {
            display: flex;
            gap: 3px;
            flex-wrap: wrap;
        }

        /* Notenverwaltung */
        .noten-filter {
            display: flex;
            gap: 15px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .filter-group {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .filter-group label {
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--text-light);
        }

        .filter-group select,
        .filter-group input {
            padding: 8px 12px;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            font-size: 0.95rem;
            transition: border-color 0.2s ease;
        }

        .filter-group select:focus,
        .filter-group input:focus {
            outline: none;
            border-color: var(--primary);
        }

        .noten-table-container {
            overflow-x: auto;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            background: white;
            border-radius: var(--radius);
            overflow: hidden;
            box-shadow: var(--shadow);
        }

        th {
            background: var(--primary);
            color: white;
            padding: 12px 15px;
            text-align: left;
            font-weight: 600;
            font-size: 0.9rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        td {
            padding: 12px 15px;
            border-bottom: 1px solid var(--border);
        }

        tr:last-child td {
            border-bottom: none;
        }

        tr:hover {
            background: #f8fafc;
        }

        .schueler-name {
            font-weight: 500;
            color: var(--text);
        }

        .note-input {
            width: 60px;
            padding: 6px;
            border: 1px solid var(--border);
            border-radius: 4px;
            text-align: center;
            font-size: 0.9rem;
            transition: border-color 0.2s ease;
        }

        .note-input:focus {
            outline: none;
            border-color: var(--primary);
        }

        .durchschnitt {
            font-weight: 600;
            color: var(--primary);
        }

        /* Statistik */
        .statistik-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
        }

        .stat-card {
            background: white;
            border-radius: var(--radius);
            padding: 20px;
            box-shadow: var(--shadow);
            text-align: center;
        }

        .stat-value {
            font-size: 2rem;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 5px;
        }

        .stat-label {
            font-size: 0.9rem;
            color: var(--text-light);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* Zurück Button */
        .zurueck-btn {
            margin-bottom: 20px;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .header-content {
                flex-direction: column;
                align-items: flex-start;
            }

            .main-nav ul {
                width: 100%;
                justify-content: center;
                margin-top: 10px;
            }

            .main-nav a {
                padding: 8px 12px;
                font-size: 0.9rem;
            }


            .stunden-uebersicht {
                grid-template-columns: 1fr;
            }

            .noten-filter {
                flex-direction: column;
            }

            .filter-group {
                width: 100%;
            }

            th, td {
                padding: 8px 10px;
                font-size: 0.85rem;
            }

            .note-input {
                width: 50px;
                padding: 4px;
            }

            .stunde-detail-header {
                flex-direction: column;
                align-items: flex-start;
            }

            .stunde-detail-info {
                width: 100%;
                justify-content: space-between;
            }

            .anwesenheits-liste {
                grid-template-columns: 1fr;
            }

            .modal {
                margin: 20px;
            }
        }

        
        @media (max-width: 480px) {
            .main-nav ul {
                gap: 3px;
            }

            .main-nav a {
                padding: 6px 10px;
                font-size: 0.85rem;
            }
        }

        /* Scrollbar */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }

        ::-webkit-scrollbar-track {
            background: #f1f1f1;
        }

        ::-webkit-scrollbar-thumb {
            background: var(--primary);
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--primary-dark);
        }

        /* Badges für Anwesenheit */
        .anwesenheits-badge {
            display: inline-block;
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 0.8rem;
            font-weight: 500;
        }

        .anwesenheits-badge.anwesend {
            background: #d1fae5;
            color: #065f46;
        }

        .anwesenheits-badge.fehlend {
            background: #fee2e2;
            color: #991b1b;
        }

        .anwesenheits-badge.entschuldigt {
            background: #fef3c7;
            color: #92400e;
        }

        /* Noten Legende */
        .noten-legende {
            display: flex;
            gap: 20px;
            margin-top: 20px;
            flex-wrap: wrap;
        }

        .legende-item {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .legende-color {
            width: 20px;
            height: 20px;
            border-radius: 4px;
        }


        a.no-deco {
            text-decoration: none;
            color: var(--text);
        }


/* Native HTML5 Dialog */
dialog{
    min-width: 35%;
    /*max-width: 600px;*/
    max-height: 90vh;
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background: white;  
    padding: 0;
    overflow: auto;
    animation: modalSlideIn 0.5s ease;
    margin: auto;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.dialog-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dialog-header h2 {
    color: var(--p);
    margin: 0;
    font-size: 1.3rem;
}

.dialog-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 5px;
    line-height: 1;
    transition: color 0.2s ease;
}

.dialog-close:hover {
    color: var(--d);
}

.dialog-body {
    padding: 25px;
}

.dialog-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}


/* Modal Form Elements */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.modal-form-group {
    flex: 1;
    min-width: 200px;
}

.modal-form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
}

.modal-form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.modal-form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 122, 77, 0.1);
}

.modal-form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: white;
    transition: all 0.3s ease;
    font-family: inherit;
}

.modal-form-select:focus {
    outline: none;
    border-color: var(--p);
    box-shadow: 0 0 0 3px rgba(45, 122, 77, 0.1);
}

.modal-form-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
}

.modal-form-textarea:focus {
    outline: none;
    border-color: var(--p);
    box-shadow: 0 0 0 3px rgba(45, 122, 77, 0.1);
}

.modal-form-btn-group {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

.modal-form-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: none;
}

.modal-form-error.show {
    display: block;
}

.modal-form-success {
    background: #d1fae5;
    color: #065f46;
    padding: 10px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: none;
}

.modal-form-success.show {
    display: block;
}

.float-end {
    float:right;
}



/* Schüler-Tabelle */
.schueler-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.schueler-table th {
    background: var(--primary);
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
}

.schueler-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}

.schueler-table tr:last-child td {
    border-bottom: none;
}

.schueler-table tr:hover {
    background: #f8fafc;
}

.schueler-table .name-cell {
    font-weight: 600;
    color: var(--text);
}

.schueler-table .note-cell {
    text-align: center;
    font-weight: 500;
}

.schueler-table .note-1 { color: #16a34a; }
.schueler-table .note-2 { color: #2d7a4d; }
.schueler-table .note-3 { color: #4ade80; }
.schueler-table .note-4 { color: #86efac; }
.schueler-table .note-5 { color: #bbf7d0; }
.schueler-table .note-6 { color: #ef4444; }




.infobox {
    margin: 10px 0px; 
    padding: 10px; 
    border: 1px solid var(--primary); 
    background-color: var(--secondary); 
    border-radius: var(--radius);
}

.clickable {
    cursor: pointer;
}
.icon {
    border-radius: var(--radius);
}


.dataTables_wrapper > * {
    margin: 10px;
}