:root {
  --bg: #0f1115;
  --panel: #171a21;
  --border: #272b35;
  --text: #e6e8ec;
  --muted: #9aa1ae;
  --accent: #5b8cff;
  --ok: #3ecf8e;
  --warn: #f2b84b;
  --danger: #ef5a5a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

header h1 { font-size: 18px; margin: 0; }
header nav a { color: var(--muted); text-decoration: none; margin-left: 16px; font-size: 14px; }
header nav a:hover { color: var(--text); }

main { padding: 24px; max-width: 1000px; margin: 0 auto; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.card:hover { border-color: var(--accent); }

.card h3 { margin: 0 0 8px; font-size: 16px; }
.card .code { color: var(--muted); font-size: 12px; margin-bottom: 12px; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #22262f;
  color: var(--muted);
}
.badge.laeuft { color: var(--ok); background: rgba(62,207,142,0.12); }
.badge.abgeschlossen { color: var(--accent); background: rgba(91,140,255,0.12); }

.progress { height: 6px; background: #22262f; border-radius: 999px; margin-top: 12px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); }

.countdown { font-size: 12px; margin-top: 8px; color: var(--muted); }
.countdown.soon { color: var(--warn); }
.countdown.overdue { color: var(--danger); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; }

.section { margin-top: 32px; }
.section h2 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 12px; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
}
.dropzone.drag { border-color: var(--accent); color: var(--text); }

.filelist { list-style: none; padding: 0; margin: 12px 0 0; }
.filelist li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; display: flex; justify-content: space-between; }
.filelist li span.size { color: var(--muted); font-size: 12px; }

.backlink { color: var(--muted); text-decoration: none; font-size: 13px; }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.login-box { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 32px; width: 100%; max-width: 280px; text-align: center; }
.login-box input { width: 100%; font-size: 22px; letter-spacing: 0.3em; text-align: center; padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: #0f1115; color: var(--text); margin: 16px 0; }
.login-box button { width: 100%; padding: 10px; border-radius: 8px; border: none; background: var(--accent); color: white; font-size: 15px; cursor: pointer; }
.login-box .error { color: var(--danger); font-size: 13px; min-height: 16px; }

select, textarea, input[type=number] {
  background: #0f1115; color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font-size: 14px;
}

.notizen {
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
.notizen h1, .notizen h2, .notizen h3 { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; margin: 20px 0 8px; }
.notizen h1:first-child, .notizen h2:first-child, .notizen h3:first-child { margin-top: 0; }
.notizen ul { padding-left: 20px; }
.notizen li { margin: 4px 0; }
.notizen li.task-list-item { list-style: none; margin-left: -20px; }
.notizen input[type=checkbox] { margin-right: 6px; }
.notizen p { margin: 8px 0; }

/* Mobile */
@media (max-width: 640px) {
  header { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px; }
  header nav { display: flex; gap: 0; margin-left: -4px; }
  header nav a { margin-left: 0; padding: 4px 10px; }
  main { padding: 16px; }
  .grid { grid-template-columns: 1fr; }
  table { font-size: 13px; }
  th, td { padding: 6px; }
  #modul-status-row { flex-direction: column; align-items: stretch !important; }
  #modul-status-row > label { width: 100%; }
  #modul-status-row select, #modul-status-row input { width: 100%; }
}
