:root {
  /* Flächen */
  --bg: #f1f2f9;
  --bg-2: #eef0f8;
  --card: #ffffff;
  --line: #ececf3;
  --line-strong: #e2e3ee;

  /* Text */
  --ink: #1d1d33;
  --ink-soft: #3a3a53;
  --muted: #6f7189;
  --muted-2: #9a9cb2;

  /* Akzente (aus der Plattform) */
  --brand: #9b2c5f;          /* Magenta/Bordeaux – üK */
  --brand-dark: #85254f;
  --brand-tint: #f7ecf2;
  --violet: #5b4bc4;         /* Anmelden / primäre Form-Aktion */
  --violet-dark: #4a3cae;
  --teal: #2e5d5f;

  --danger: #d24141;
  --ok: #178a4d;
  --ok-bg: #e7f5ec;

  --radius-card: 18px;
  --radius-el: 11px;
  --shadow: 0 1px 2px rgba(28,28,60,.04), 0 12px 30px rgba(28,28,60,.07);
  --shadow-sm: 0 1px 2px rgba(28,28,60,.05), 0 4px 12px rgba(28,28,60,.05);

  font-family: "Segoe UI", -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
  background: linear-gradient(160deg, #f4f5fb 0%, #eef0f8 55%, #eaecf6 100%);
  -webkit-font-smoothing: antialiased;
}
/* Dezenter Farb-Schimmer oben rechts wie in der Plattform (günstig zu rendern) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 460px at 100% -8%, rgba(155,44,95,.06), transparent 62%),
    radial-gradient(760px 420px at 0% 108%, rgba(91,75,196,.05), transparent 60%);
}

.wrap { max-width: 760px; margin: 0 auto; padding: 40px 18px 48px; }
.wrap.admin { max-width: 1080px; }
.wrap.centered { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-height: 100vh; padding-top: 8vh; }

h1 { font-size: 2rem; line-height: 1.12; letter-spacing: -.01em; margin: 0 0 6px; font-weight: 700; color: var(--ink); }
h2 { font-size: 1.05rem; margin: 0 0 12px; font-weight: 700; }
.sub { color: var(--muted); font-size: .92rem; margin: 0 0 24px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 26px 26px 24px;
}
.card.pad-lg { padding: 34px 34px 30px; }

/* ---- Formulare ---- */
label { display: block; font-size: .82rem; font-weight: 700; color: var(--ink-soft); margin: 0 0 7px; }
input, select {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-el);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--muted-2); }
input:focus, select:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(91,75,196,.16);
}
.field { margin-bottom: 16px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 150px; }

/* ---- Buttons ---- */
button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 0;
  border-radius: var(--radius-el);
  padding: 13px 20px;
  background: var(--violet);
  color: #fff;
  transition: background .15s, transform .05s, box-shadow .15s;
}
button:hover { background: var(--violet-dark); }
button:active { transform: translateY(1px); }
button.block { width: 100%; }
button.brand { background: var(--brand); }
button.brand:hover { background: var(--brand-dark); }
button.ghost { background: #eef0f7; color: var(--ink-soft); }
button.ghost:hover { background: #e5e8f2; }
button.danger { background: #fff; color: var(--danger); box-shadow: inset 0 0 0 1px #f0cfcf; }
button.danger:hover { background: #fbeeee; }
button.sm { padding: 9px 14px; font-size: .87rem; }
button:disabled { opacity: .55; cursor: default; }

.msg { margin-top: 16px; font-size: .9rem; min-height: 1em; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }

/* ---- Sektions-Kopf (wie „Meine üK-Durchführungen") ---- */
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-head .title { font-size: 1.15rem; font-weight: 700; color: var(--brand); margin: 0; }
.section-head .desc { color: var(--muted); font-size: .9rem; margin: 4px 0 0; }
.icon-btn {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
  background: #eef0f7; color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.icon-btn:hover { background: #e5e8f2; }
.icon-btn svg { width: 20px; height: 20px; }

/* ---- Kurs-Liste (Lernende) ---- */
.course-list { list-style: none; margin: 0; padding: 0; }
.course-row {
  display: flex; align-items: center; gap: 15px;
  padding: 15px 12px;
  border-radius: 14px;
  border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.course-row:last-child { border-bottom: 0; }
.course-row.is-next { background: var(--bg-2); }

.c-badge {
  flex: 0 0 auto; position: relative;
  width: 50px; height: 50px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-tint);
  color: var(--brand); font-weight: 800;
}
/* Ring als Overlay – bleibt auch über einem Icon-Bild sichtbar */
.c-badge::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--brand); pointer-events: none; }
.c-badge .c-num { font-size: 1.15rem; line-height: 1; }
.c-badge .c-part { position: absolute; right: 6px; bottom: 7px; font-size: .6rem; font-weight: 800; color: var(--brand); }
.c-badge .c-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.course-row.is-past .c-badge { background: #f0f1f5; color: #9a9cb2; }
.course-row.is-past .c-badge::after { box-shadow: inset 0 0 0 2px #c9cbd8; }
.course-row.is-past .c-badge .c-part { color: #9a9cb2; }
.course-row.is-past .c-badge .c-img { filter: grayscale(.35) opacity(.85); }

.c-main { flex: 1 1 auto; min-width: 0; }
.c-phase { font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--brand); }
.course-row.is-past .c-phase { color: var(--muted-2); }
.c-title { font-weight: 700; color: var(--ink); margin: 2px 0 2px; }
.course-row.is-past .c-title { color: var(--muted); }
.c-dates { color: var(--muted); font-size: .9rem; }
.c-chev { flex: 0 0 auto; color: var(--muted-2); font-size: 1.5rem; line-height: 1; font-weight: 400; }

.badge { display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .03em; padding: 3px 9px; border-radius: 20px; margin-left: 8px; vertical-align: middle; text-transform: none; }
.badge.next { background: var(--ok-bg); color: var(--ok); }
.badge.past { background: #eef0f4; color: var(--muted-2); }

.empty { color: var(--muted); font-style: italic; padding: 8px 4px; }
.foot { margin-top: 22px; color: var(--muted-2); font-size: .78rem; text-align: center; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
a { color: var(--violet); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

/* ---- Admin ---- */
.appbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.appbar .hello { font-size: 1.5rem; font-weight: 700; margin: 0; }
.appbar .hello .accent { color: var(--brand); }
.appbar .tagline { color: var(--muted); font-size: .9rem; margin: 2px 0 0; }
.appbar .actions { display: flex; gap: 9px; flex-wrap: wrap; }

.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.toolbar .field { flex: 1; margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; margin-top: 6px; }
th, td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--line); font-size: .93rem; }
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--bg-2); cursor: pointer; }
tbody tr:last-child td { border-bottom: 0; }
.name-cell { display: flex; align-items: center; gap: 11px; }
.avatar {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 800; color: #fff; background: var(--violet);
}
.pill { display: inline-block; background: var(--brand-tint); color: var(--brand); border-radius: 20px; padding: 2px 11px; font-size: .78rem; font-weight: 700; }
.pill.zero { background: #eef0f4; color: var(--muted-2); }

/* ---- Modal ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,20,42,.48); backdrop-filter: blur(2px); display: none; align-items: flex-start; justify-content: center; padding: 34px 14px; overflow: auto; z-index: 50; }
.modal-bg.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius-card); box-shadow: 0 20px 60px rgba(20,20,50,.28); width: 100%; max-width: 660px; padding: 26px; }
.modal h2 { display: flex; justify-content: space-between; align-items: center; color: var(--ink); }
.slot { border: 1px solid var(--line-strong); border-radius: 13px; padding: 14px; margin-bottom: 11px; background: #fcfcfe; }
.slot .phase-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--brand); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.slot .phase-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.slot .phase-ic { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; box-shadow: inset 0 0 0 1.5px var(--brand); }
.modal-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.hidden { display: none !important; }

/* ---- Icon-Verwaltung ---- */
.ic-langhead { font-weight: 800; color: var(--ink); font-size: .95rem; margin: 16px 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.ic-langhead:first-child { margin-top: 0; }
.ic-phase { font-weight: 800; color: var(--brand); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; margin: 12px 0 8px; }
.ic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.ic-card { border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px; text-align: center; background: #fcfcfe; transition: opacity .15s; }
.ic-card.busy { opacity: .5; pointer-events: none; }
.ic-thumb { width: 62px; height: 62px; margin: 0 auto 8px; border-radius: 50%; background: var(--brand-tint); box-shadow: inset 0 0 0 2px var(--brand); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.ic-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ic-thumb.empty span { color: var(--brand); font-size: 1.5rem; font-weight: 700; opacity: .55; }
.ic-name { font-size: .82rem; font-weight: 600; color: var(--ink); margin-bottom: 8px; min-height: 2.2em; display: flex; align-items: center; justify-content: center; }
.ic-actions { display: flex; gap: 6px; justify-content: center; align-items: center; }
.ic-up { font-size: .78rem; font-weight: 600; color: #fff; background: var(--violet); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.ic-up:hover { background: var(--violet-dark); }
.ic-del { background: #fff; color: var(--danger); box-shadow: inset 0 0 0 1px #f0cfcf; padding: 6px 9px; border-radius: 8px; font-size: .78rem; }
.ic-del:hover { background: #fbeeee; }

@media (max-width: 560px) {
  h1 { font-size: 1.7rem; }
  .card { padding: 22px 18px; }
  .appbar .hello { font-size: 1.3rem; }
}
