:root {
  --primary: #1f4e79;
  --accent: #c8a24a;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5d6878;
  --border: #e2e6ec;
  --ok: #2e7d4f;
  --warn: #b26a00;
  --danger: #b3261e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { font-size: 15px; line-height: 1.55; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 4rem; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* Buttons & Formulare */
.btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--border); background: var(--surface); padding: .55rem 1rem; border-radius: 10px; cursor: pointer; text-decoration: none; color: var(--text); font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: #c5ccd6; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: .3rem .65rem; font-size: .85rem; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: default; }
label.field { display: block; margin-bottom: .9rem; }
label.field > span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: 1px; }
.error { color: var(--danger); font-size: .9rem; margin: .5rem 0; }

/* Layout */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--primary); color: #fff; }
.topbar-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; padding: .7rem 1.25rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.brand img { height: 34px; max-width: 160px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px 4px; }
.nav { display: flex; gap: .25rem; margin-left: 1rem; }
.nav a { color: rgba(255,255,255,.85); text-decoration: none; padding: .45rem .8rem; border-radius: 8px; font-weight: 500; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.14); color: #fff; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; border: none; cursor: pointer; }
.dropdown { position: absolute; right: 1.25rem; top: 58px; background: #fff; color: var(--text); border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--border); min-width: 220px; padding: .4rem; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: .55rem .75rem; border-radius: 8px; color: var(--text); text-decoration: none; background: none; border: none; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--bg); }
.dropdown hr { border: none; border-top: 1px solid var(--border); margin: .3rem 0; }
.burger { display: none; background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; }
main.page { max-width: 1240px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.section { margin-top: 2rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 2rem 1rem; }
.footer a { color: var(--muted); }

/* Hero */
.hero { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #000)); color: #fff; border-radius: 20px; padding: 2rem; display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center; }
.hero p { opacity: .9; max-width: 640px; margin: 0; }
.hero .stat { background: rgba(255,255,255,.12); border-radius: 14px; padding: 1rem 1.25rem; text-align: center; min-width: 150px; }
.hero .stat b { display: block; font-size: 1.8rem; }

/* Kurskacheln */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.1rem; }
.course-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s; }
.course-card:hover { transform: translateY(-2px); }
.course-cover { height: 120px; padding: 1rem; color: #fff; display: flex; flex-direction: column; justify-content: space-between; background: var(--c, var(--primary)); background-image: radial-gradient(circle at 85% 20%, rgba(255,255,255,.25), transparent 45%), linear-gradient(135deg, transparent, rgba(0,0,0,.25)); }
.course-cover .play { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.25); display: grid; place-items: center; font-size: 1.1rem; align-self: flex-end; }
.course-body { padding: 1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.course-body h3 { margin: 0; }
.course-body p { margin: 0; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.chip { display: inline-block; font-size: .72rem; font-weight: 600; padding: .15rem .55rem; border-radius: 99px; background: rgba(255,255,255,.22); color: #fff; letter-spacing: .02em; text-transform: uppercase; }
.chip.soft { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.chip.draft { background: #fff3cd; color: #7a5a00; }
.progress { height: 7px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.progress-label { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: auto; }

/* Hub */
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.hub a { display: flex; gap: .8rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .85rem 1rem; text-decoration: none; color: var(--text); }
.hub a:hover { border-color: var(--primary); }
.hub .ico { font-size: 1.5rem; width: 2.2rem; text-align: center; }
.hub b { display: block; }
.hub small { color: var(--muted); }

/* Kursübersicht */
.course-head { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; align-items: start; }
.module { margin-bottom: 1rem; }
.module h3 { display: flex; justify-content: space-between; align-items: center; }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list li a { display: flex; gap: .8rem; align-items: center; padding: .7rem .8rem; border-radius: 10px; text-decoration: none; color: var(--text); }
.lesson-list li a:hover { background: var(--bg); }
.lesson-list li a.current { background: color-mix(in srgb, var(--primary) 10%, #fff); font-weight: 600; }
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: .75rem; flex: none; color: #fff; }
.check.done { background: var(--ok); border-color: var(--ok); }
.lesson-list .dur { margin-left: auto; color: var(--muted); font-size: .8rem; white-space: nowrap; }

/* Lektion */
.lesson-layout { display: grid; grid-template-columns: 300px 1fr; gap: 1.5rem; align-items: start; }
.lesson-side { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; padding: 1rem; }
.lesson-side h4 { margin: .8rem .5rem .3rem; font-size: .75rem; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.lesson-side .lesson-list li a { padding: .5rem; font-size: .9rem; }
.lesson-side .check { width: 20px; height: 20px; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }
.breadcrumb a { color: var(--muted); }
.block { margin-bottom: 1.4rem; }
.block p { margin: 0 0 .7rem; }
.block ul { margin: 0 0 .7rem; padding-left: 1.3rem; }
.video-wrap { position: relative; background: #0d1117; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; }
.video-wrap video, .video-wrap iframe { width: 100%; height: 100%; display: block; border: 0; background: #000; }
.video-title { font-weight: 600; margin-top: .5rem; }
.video-placeholder { height: 100%; display: grid; place-items: center; text-align: center; color: #aab4c3; padding: 1rem; }
.video-placeholder .big { font-size: 2.6rem; }
.info { border-radius: 12px; padding: .9rem 1rem .9rem 2.8rem; position: relative; background: #eaf2fb; border: 1px solid #cfe0f3; }
.info::before { content: "ℹ️"; position: absolute; left: 1rem; top: .85rem; }
.info.tip { background: #eaf7ef; border-color: #c6e8d3; }
.info.tip::before { content: "💡"; }
.info.warn { background: #fff6e5; border-color: #f5ddaa; }
.info.warn::before { content: "⚠️"; }
.info p:last-child { margin-bottom: 0; }
.quiz { border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem; background: #fafbfc; }
.quiz .q { font-weight: 600; margin-bottom: .7rem; }
.quiz label { display: flex; gap: .6rem; align-items: center; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 10px; margin-bottom: .45rem; background: #fff; cursor: pointer; }
.quiz label.right { border-color: var(--ok); background: #eaf7ef; }
.quiz label.wrong { border-color: var(--danger); background: #fdecea; }
.quiz .result { margin-top: .6rem; font-weight: 500; }
.checklist label { display: flex; gap: .6rem; align-items: flex-start; padding: .35rem 0; cursor: pointer; }
.checklist input { margin-top: .3rem; width: 17px; height: 17px; accent-color: var(--ok); }
.file-block { display: flex; align-items: center; gap: .8rem; border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; text-decoration: none; color: var(--text); background: #fff; }
.file-block:hover { border-color: var(--primary); }
.image-block img { max-width: 100%; border-radius: 12px; display: block; }
.lesson-footer { display: flex; gap: .75rem; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 1.2rem; margin-top: 1.5rem; flex-wrap: wrap; }
.comments { margin-top: 2rem; }
.comment { padding: .8rem 0; border-bottom: 1px solid var(--border); }
.comment .meta { font-size: .8rem; color: var(--muted); display: flex; gap: .5rem; align-items: center; }
.comment .team { background: var(--accent); color: #fff; border-radius: 6px; padding: 0 .4rem; font-weight: 600; font-size: .7rem; }
.comment p { margin: .25rem 0 0; white-space: pre-wrap; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: linear-gradient(150deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #000)); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h1 { font-size: 2.2rem; max-width: 460px; }
.login-art ul { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .7rem; }
.login-art li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: .6rem; }
.login-form { display: grid; place-items: center; padding: 2rem; background: var(--surface); }
.login-form form { width: 100%; max-width: 360px; }
.login-logo { max-height: 56px; max-width: 220px; margin-bottom: 1.2rem; background: #fff; border-radius: 8px; padding: 4px; }

/* Editor */
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; flex-wrap: wrap; }
.tabs a { padding: .6rem 1rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; }
.tabs a.active { color: var(--primary); border-color: var(--primary); }
.editor-block { border: 1px solid var(--border); border-radius: 12px; background: #fff; margin-bottom: .8rem; }
.editor-block-head { display: flex; align-items: center; gap: .5rem; padding: .5rem .8rem; border-bottom: 1px solid var(--border); background: #fafbfc; border-radius: 12px 12px 0 0; font-weight: 600; font-size: .85rem; }
.editor-block-body { padding: .9rem; }
.add-bar { display: flex; flex-wrap: wrap; gap: .4rem; padding: 1rem; border: 2px dashed var(--border); border-radius: 12px; justify-content: center; }
.option-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.option-row input[type=text] { flex: 1; }
.sticky-save { position: sticky; top: 64px; z-index: 5; background: var(--bg); padding: .6rem 0; }
.editor-module { border: 1px solid var(--border); border-radius: 12px; padding: .8rem; margin-bottom: .8rem; background: #fff; }
.editor-module .lesson-row { display: flex; gap: .5rem; align-items: center; padding: .4rem .5rem; border-radius: 8px; }
.editor-module .lesson-row:hover { background: var(--bg); }
.upload-progress { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: .5rem; }
.upload-progress i { display: block; height: 100%; background: var(--primary); width: 0; transition: width .2s; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: .65rem .7rem; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; }
td select { padding: .3rem .4rem; width: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .9rem; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 1rem; }
.kpi b { display: block; font-size: 1.7rem; color: var(--primary); }

/* Modal & Toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: grid; place-items: center; z-index: 100; padding: 1rem; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; padding: 1.5rem; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 860px; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.2rem; flex-wrap: wrap; }
#toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(150%); background: #1c2430; color: #fff; padding: .7rem 1.2rem; border-radius: 10px; transition: transform .25s; z-index: 200; max-width: 90vw; }
#toast.show { transform: translateX(-50%) translateY(0); }
.recorder-preview { background: #000; border-radius: 12px; aspect-ratio: 16/9; width: 100%; display: block; }
.rec-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #e53935; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; font-size: 5rem; color: #fff; font-weight: 800; background: rgba(0,0,0,.4); }
.copybox { font-family: ui-monospace, Menlo, monospace; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: .8rem; white-space: pre-wrap; font-size: .85rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters button { border: 1px solid var(--border); background: #fff; padding: .35rem .85rem; border-radius: 99px; cursor: pointer; font-size: .85rem; }
.filters button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

@media (max-width: 900px) {
  .lesson-layout, .course-head { grid-template-columns: 1fr; }
  .lesson-side { position: static; max-height: none; order: 2; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { padding: 2rem 1.5rem; }
  .login-art h1 { font-size: 1.6rem; }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .burger { display: block; }
  .nav { display: none; position: absolute; top: 56px; left: 0; right: 0; background: var(--primary); flex-direction: column; padding: .5rem; margin: 0; }
  .nav.open { display: flex; }
  main.page { padding: 1.25rem 1rem 3rem; }
  .hero { padding: 1.4rem; }
  h1 { font-size: 1.4rem; }
}
