/* Academy – Basis-Styles */
* { box-sizing: border-box; }
:root {
  --brand: #1a56db;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1c2434;
  --muted: #6b7280;
  --border: #e4e8f0;
  --radius: 12px;
}
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; }

/* Topbar */
.topbar {
  background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 60px; position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { max-height: 34px; }
.brand-dot { width: 14px; height: 14px; border-radius: 4px; background: var(--brand); display: inline-block; }
.brand-dot.big { width: 22px; height: 22px; border-radius: 6px; }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 8px 14px; border-radius: 8px; color: var(--text); font-weight: 500; }
.topnav a:hover { background: var(--bg); text-decoration: none; }
.topnav a.act { background: var(--brand); color: #fff; }

/* Admin-Nav */
.adminnav {
  background: #1c2434; padding: 0 24px; display: flex; gap: 4px; overflow-x: auto;
}
.adminnav a { color: #cbd5e1; padding: 11px 14px; font-weight: 500; white-space: nowrap; }
.adminnav a:hover { color: #fff; text-decoration: none; }

/* Layout */
.container { max-width: 1180px; margin: 0 auto; padding: 28px 24px 48px; width: 100%; flex: 1; }
.page-title { margin: 0 0 6px; font-size: 26px; }
.page-title .muted { font-size: 15px; font-weight: 400; }
.page-sub { color: var(--muted); margin: 0 0 24px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.back-link { display: inline-block; margin-bottom: 10px; color: var(--muted); font-size: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.two-col .grow2 { grid-column: span 1; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.panel h3 { margin-top: 0; }
.panel.narrow { max-width: 480px; }
.panel.narrow-lg { max-width: 640px; }
.empty { background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
hr { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

/* Flash */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; background: #e7f6ec; color: #14532d; border: 1px solid #bbe5c8; }
.flash-error { background: #fdecec; color: #7f1d1d; border-color: #f5c2c2; }

/* Formulare */
label { display: block; margin-bottom: 14px; font-weight: 500; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; margin-top: 5px;
  border: 1px solid var(--border); border-radius: 8px; font: inherit; background: #fff; color: var(--text);
}
input[type=color] { margin-top: 5px; width: 64px; height: 38px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
.check-label { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-bottom: 8px; }
.check-label input { width: auto; margin: 0; }
.group-box { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.inline-form input[type=text] { margin-top: 0; width: auto; }
.inline-form select { margin-top: 0; width: auto; }
.grow { flex: 1; }
.opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.opt-row input[type=text] { margin-top: 0; }
.opt-row input[type=radio] { width: auto; }

/* Buttons */
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-align: center;
}
.btn:hover { text-decoration: none; filter: brightness(0.96); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn-danger { background: #fff; border-color: #f0b6b6; color: #b42318; }
.btn-danger:hover { background: #fdecec; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; font-weight: 500; }
.btn-cert { display: block; text-align: center; background: #fff7e0; border: 1px solid #f2dd9a; color: #92600a; margin: 10px 0; padding: 9px; border-radius: 8px; font-weight: 600; }
.btn-mini { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 3px 7px; cursor: pointer; font-size: 12px; }
.btn-mini:hover { background: var(--bg); }
.btn-mini.danger { color: #b42318; }
.pill { border: none; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.pill-ok { background: #e7f6ec; color: #14532d; }
.pill-off { background: #eef0f4; color: #6b7280; }
.pill-admin { background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
table.panel { display: table; }
.actions-cell { white-space: nowrap; }
.actions-cell .btn, .actions-cell form { margin-right: 6px; }
.sort-cell { white-space: nowrap; width: 60px; }
.sort-cell form { display: inline; }

/* Statistiken */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat b { display: block; font-size: 28px; color: var(--brand); }
.stat span { color: var(--muted); font-size: 13.5px; }

/* Kurskarten */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.course-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--text); display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.course-card:hover { text-decoration: none; box-shadow: 0 8px 24px rgba(28,36,52,.10); transform: translateY(-2px); }
.course-img { height: 130px; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #000)); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; position: relative; }
.course-img span { font-size: 44px; font-weight: 800; color: rgba(255,255,255,.85); }
.badge-draft { position: absolute; top: 10px; right: 10px; background: #fff; color: #92600a; font-style: normal; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.course-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-body h3 { margin: 0; font-size: 17px; }
.course-body p { margin: 0; color: var(--muted); font-size: 13.5px; flex: 1; }
.course-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.cert-tag { color: #92600a; font-weight: 600; }

/* Fortschrittsbalken */
.progressbar { height: 8px; border-radius: 999px; background: #e8ecf3; overflow: hidden; }
.progressbar span { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .3s; }
.progressbar.small { width: 140px; display: inline-block; vertical-align: middle; margin-right: 8px; }

/* Kursplayer */
.course-layout { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .course-layout { grid-template-columns: 1fr; } }
.course-side { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow-y: auto; }
.side-title { font-size: 17px; margin: 6px 0 10px; }
.side-progress { font-size: 12.5px; color: var(--muted); margin: 6px 0 12px; }
.side-chapter { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; margin: 14px 0 6px; }
.side-lesson { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: 14px; }
.side-lesson:hover { background: var(--bg); text-decoration: none; }
.side-lesson.act { background: color-mix(in srgb, var(--brand) 10%, white); color: var(--brand); font-weight: 600; }
.side-lesson-title { flex: 1; }
.side-lesson .dur { font-size: 12px; color: var(--muted); }
.check { width: 18px; height: 18px; min-width: 18px; border-radius: 50%; border: 2px solid #cbd5e1; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; }
.check.done { background: #16a34a; border-color: #16a34a; }
.course-main { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; min-height: 400px; }
.lesson-title { margin: 0 0 18px; font-size: 22px; }
.lesson-content { line-height: 1.7; }
.lesson-content img { max-width: 100%; }
.lesson-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* Video */
.video-wrap { position: relative; padding-top: 56.25%; border-radius: 10px; overflow: hidden; background: #000; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-file { width: 100%; border-radius: 10px; background: #000; }

/* Quiz */
.quiz-q { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.quiz-q legend { font-weight: 600; padding: 0 6px; }
.quiz-opt { display: flex; gap: 10px; align-items: center; font-weight: 400; padding: 8px 10px; border-radius: 8px; margin-bottom: 4px; cursor: pointer; }
.quiz-opt:hover { background: var(--bg); }
.quiz-opt input { width: auto; margin: 0; }
.quiz-result { background: #fff7e0; border: 1px solid #f2dd9a; border-radius: 10px; padding: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.quiz-result.ok { background: #e7f6ec; border-color: #bbe5c8; }
.quiz-admin-q { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.quiz-admin-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.quiz-admin-opts { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }
.quiz-admin-opts li.right { color: #14532d; font-weight: 600; }

/* Kurs-Editor */
.chapter-block { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.chapter-head { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.chapter-input { font-weight: 600; }
.lesson-row { display: flex; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px; }
.lesson-row:hover { background: var(--bg); }
.lesson-type-tag { font-size: 12px; color: var(--muted); min-width: 64px; }
.lesson-add { margin-top: 8px; }
.chapter-add { margin-top: 4px; }
.logo-preview { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.logo-preview img { max-height: 48px; border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: #fff; }

/* Login */
.login-body { align-items: center; justify-content: center; padding: 24px; background: linear-gradient(160deg, var(--bg) 60%, color-mix(in srgb, var(--brand) 14%, white)); }
.login-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 36px; width: 100%; max-width: 420px; box-shadow: 0 16px 48px rgba(28,36,52,.10); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-brand img { max-height: 44px; }
.login-brand h1 { font-size: 22px; margin: 0; }
.login-sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.login-hint { color: var(--muted); font-size: 12.5px; text-align: center; margin-top: 16px; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 16px 24px; display: flex; gap: 18px; color: var(--muted); font-size: 13px; background: var(--card); }
