@charset "UTF-8";
/* ============================================================
   Aufgabendatenbank Elektrotechnik – Stylesheet
   Design: Technisch-präzise, aufgeräumt, professionell
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

/* -- Variablen ---------------------------------------------- */
:root, [data-theme="dark"] {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-card: #1e2130;
    --bg-card-hover: #252839;
    --bg-input: #151822;

    --text-primary: #e8eaf0;
    --text-secondary: #9499ad;
    --text-muted: #5e6378;

    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-subtle: rgba(59, 130, 246, 0.12);
    --accent-glow: rgba(59, 130, 246, 0.25);

    --green: #22c55e;
    --green-bg: rgba(34, 197, 94, 0.1);
    --amber: #f59e0b;
    --amber-bg: rgba(245, 158, 11, 0.1);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.1);

    --border: #2a2d3d;
    --border-light: #33374a;

    --radius: 8px;
    --radius-lg: 12px;

    --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 24px rgba(59, 130, 246, 0.15);
}

[data-theme="light"] {
    --bg-primary: #f5f6f8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f1f5;
    --bg-input: #f8f9fb;

    --text-primary: #1a1d27;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-subtle: rgba(37, 99, 235, 0.08);
    --accent-glow: rgba(37, 99, 235, 0.15);

    --green: #16a34a;
    --green-bg: rgba(22, 163, 74, 0.08);
    --amber: #d97706;
    --amber-bg: rgba(217, 119, 6, 0.08);
    --red: #dc2626;
    --red-bg: rgba(220, 38, 38, 0.08);

    --border: #e2e4ea;
    --border-light: #d1d5db;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 24px rgba(37, 99, 235, 0.1);
}

/* ── Reset & Basis ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--accent-hover); }

/* ── Navigation ─────────────────────────────────────── */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 60px;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.nav-brand-icon {
    font-size: 1.3rem;
    filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.5));
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 4px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: 0.2s;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.nav-link {
    color: var(--text-secondary);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-link:hover {
    color: var(--text-primary);
    background: var(--accent-subtle);
}

.nav-link-muted { font-size: 0.85rem; opacity: 0.7; }
.nav-link-muted:hover { opacity: 1; }

.nav-spacer { flex: 1; }

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-user-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-family: var(--font-mono);
}
.nav-user-badge.admin { background: var(--red-bg); color: var(--red); }
.nav-user-badge.dozent { background: var(--accent-subtle); color: var(--accent); }
.nav-user-badge.student { background: var(--green-bg); color: var(--green); }

.btn-primary-sm {
    background: var(--accent);
    color: #fff !important;
    padding: 0.4rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.85rem;
}
.btn-primary-sm:hover { background: var(--accent-hover); color: #fff; }

/* ── Flash Messages ─────────────────────────────────── */
.messages-container {
    max-width: 1280px;
    margin: 1rem auto 0;
    padding: 0 1.5rem;
}

.message {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.3s ease;
}

.message-success { background: var(--green-bg); color: var(--green); border: 1px solid rgba(34, 197, 94, 0.2); }
.message-error { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.2); }
.message-warning { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.2); }
.message-info { background: var(--accent-subtle); color: var(--accent); border: 1px solid rgba(59, 130, 246, 0.2); }

.message-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    line-height: 1;
}

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

/* ── Hauptinhalt ────────────────────────────────────── */
.main-content {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
}

/* ── Seitentitel ────────────────────────────────────── */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.page-header p {
    color: var(--text-secondary);
    margin-top: 0.3rem;
    font-size: 1rem;
}

/* ── Statistik-Karten ───────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.2rem;
}

/* ── Filter-Bereich ─────────────────────────────────── */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: 2fr repeat(4, 1fr) 0.7fr 0.7fr;
    gap: 0.75rem;
    align-items: end;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.3rem;
}

/* ── Formular-Elemente ──────────────────────────────── */
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea {
    resize: vertical;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.7;
}

.form-select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239499ad' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ── Aufgaben-Karten ────────────────────────────────── */
.aufgaben-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1rem;
}

.aufgabe-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.aufgabe-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
    color: inherit;
}

.aufgabe-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.aufgabe-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

.aufgabe-card-nummer {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.aufgabe-card-preview {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    margin-bottom: 1rem;
}

.aufgabe-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: var(--font-mono);
}

.tag-thema { background: var(--accent-subtle); color: var(--accent); }
.tag-quelle { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.tag-leicht { background: var(--green-bg); color: var(--green); }
.tag-mittel { background: var(--amber-bg); color: var(--amber); }
.tag-schwer { background: var(--red-bg); color: var(--red); }
.tag-jahr { background: rgba(99, 102, 241, 0.1); color: #818cf8; }
.tag-art { background: rgba(236, 72, 153, 0.1); color: #ec4899; }

/* ── Aufgabe Detailansicht ──────────────────────────── */
.aufgabe-detail {
    max-width: 860px;
    margin: 0 auto;
}

.aufgabe-detail-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.aufgabe-detail-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.aufgabe-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.aufgabe-section {
    margin-bottom: 2rem;
}

.aufgabe-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.aufgabe-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.aufgabe-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    font-size: 1rem;
    line-height: 1.8;
}

.aufgabe-content p { margin-bottom: 0.75rem; }
.aufgabe-content p:last-child { margin-bottom: 0; }

.aufgabe-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1rem 0;
}

/* ── Aufklapp-System (details/summary) ────────────── */
.aufklapp-details {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.aufklapp-details[open] {
    border-color: var(--accent);
}

.hinweis-details[open] {
    border-color: rgba(245, 158, 11, 0.4);
}

.aufklapp-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: var(--font-body);
    cursor: pointer;
    list-style: none;
    transition: all 0.2s;
    user-select: none;
}

.aufklapp-summary::-webkit-details-marker {
    display: none;
}

.aufklapp-summary::marker {
    display: none;
    content: "";
}

.aufklapp-summary:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.hinweis-summary {
    color: var(--amber);
}

.hinweis-summary:hover {
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.15);
}

.aufklapp-chevron {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.aufklapp-details[open] > .aufklapp-summary .aufklapp-chevron {
    transform: rotate(180deg);
}

.aufklapp-body {
    padding: 1.5rem 2rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    line-height: 1.8;
}

.hinweis-body {
    border-top-color: rgba(245, 158, 11, 0.2);
}

/* ── Hinweis-Box ────────────────────────────────────── */
.hinweis-box {
    background: var(--amber-bg);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.hinweis-box-title {
    font-weight: 700;
    color: var(--amber);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.3rem;
}

.hinweis-box-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ── Buttons ────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.3);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
    background: var(--red);
    color: #fff;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── Formulare ──────────────────────────────────────── */
.form-page {
    max-width: 720px;
    margin: 0 auto;
}

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-group .helptext {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.errorlist {
    list-style: none;
    color: var(--red);
    font-size: 0.82rem;
    margin-top: 0.3rem;
}

/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 1rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.radio-option input[type="radio"] {
    accent-color: var(--accent);
}

/* Checkbox */
input[type="checkbox"] {
    accent-color: var(--accent);
    width: 1rem;
    height: 1rem;
}

/* ── Verwaltungsseiten (Themen, Quellen) ────────────── */
.verwaltung-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.verwaltung-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.verwaltung-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.verwaltung-card-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.verwaltung-card-count {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.unterthemen-list {
    list-style: none;
    margin-top: 0.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--border);
}

.unterthemen-list li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.15rem 0;
}

/* ── Authentifizierung ──────────────────────────────── */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 180px);
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-card .auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* ── Pagination ─────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.3rem;
    margin-top: 2rem;
}

.pagination a, .pagination span {
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 500;
}

.pagination a {
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination .current {
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
}

/* ── Leere Zustände ─────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h2 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* ── Löschen-Bestätigung ────────────────────────────── */
.delete-confirm {
    max-width: 500px;
    margin: 3rem auto;
    text-align: center;
}

.delete-confirm h1 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--red);
}

.delete-confirm p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ── Footer ─────────────────────────────────────────── */
.footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: auto;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem;
        gap: 0.25rem;
    }
    .nav-menu.open { display: flex; }
    .nav-spacer { display: none; }
    .nav-user { flex-direction: column; align-items: flex-start; gap: 0.25rem; }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .aufgaben-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .aufgabe-content {
        padding: 1rem 1.25rem;
    }

    .stats-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* -- Theme Toggle Button ---------------------------------- */
.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    margin-right: 0.5rem;
}
.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}
[data-theme="dark"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: inline; }
[data-theme="light"] .theme-icon-dark { display: inline; }
[data-theme="light"] .theme-icon-light { display: none; }

/* -- Light theme select/option fix ------------------------- */
[data-theme="light"] .form-select option {
    background: #ffffff;
    color: #1a1d27;
}

/* -- Markdown Tables in Aufgaben ------------------------- */
.aufklapp-body table,
.aufgabe-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.9rem;
}
.aufklapp-body th,
.aufgabe-content th {
    background: var(--bg-secondary);
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.aufklapp-body td,
.aufgabe-content td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.aufklapp-body tr:hover,
.aufgabe-content tr:hover {
    background: var(--bg-card-hover);
}
