/* Admin-Backend: dieselben Farben wie die App, aber ruhiger und dichter. Ein Arbeitswerkzeug.
   Kopie aus mockup/admin/admin.css, ergänzt um Laden, Warten und Umbenennen (ganz unten). */

:root {
  --side-w: 248px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

body { background: var(--ink-0); min-height: 100vh; }
body.drawer-open { overflow: hidden; }
[hidden] { display: none !important; }

.ic { width: 18px; height: 18px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.input:focus-visible { outline: none; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }

/* ------------------------------------------------------------ Anmeldung */

.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse 60% 50% at 15% 0%, rgba(255, 61, 139, 0.14), transparent 70%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(138, 107, 255, 0.16), transparent 70%),
    var(--ink-0);
}
.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 20px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--ink-1);
  box-shadow: var(--shadow);
}
.login-card h1 { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.login-card p { color: var(--text-2); font-size: 15px; }
.login-card .brand { padding: 0; }
.login-foot { display: flex; justify-content: center; font-size: 13px; }
.login-foot a { color: var(--text-2); text-decoration: none; }
.login-foot a:hover { color: var(--text); }

/* ------------------------------------------------------------ Gerüst */

.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 14px;
  overflow-y: auto;
  background: var(--ink-1);
  border-right: 1px solid var(--line);
}
.side-top { display: flex; align-items: center; gap: 8px; }
.side-toggle { display: none; margin-left: auto; }

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 14px; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; flex: none; border-radius: 11px; box-shadow: 0 6px 22px rgba(255, 61, 139, 0.28); }
.brand-name { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.brand-name small { display: block; font-family: var(--font-ui); font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }

.nav { display: grid; gap: 2px; }
.nav a, .side-foot a, .side-foot button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
}
.nav a:hover, .side-foot a:hover, .side-foot button:hover { background: var(--ink-2); color: var(--text); }
.nav a[aria-current="page"] { color: #fff; background: var(--grad-soft); }
.nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--grad);
}
.nav a[aria-current="page"] .ic { color: #ff86b7; }
.nav .count {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.nav .count:empty { display: none; }

.side-foot { margin-top: auto; display: grid; gap: 2px; padding-top: 14px; border-top: 1px solid var(--line); }
.side-foot .ic { width: 16px; height: 16px; }
.side-foot button:hover { color: var(--danger); }

.content { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 66px;
  padding: 12px 28px;
  background: rgba(7, 8, 15, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search { position: relative; flex: 0 1 320px; min-width: 0; }
.search[hidden] { display: none; }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.search .input { min-height: 38px; padding: 6px 14px 6px 38px; border-radius: 999px; background: var(--ink-2); font-size: 14px; }
.search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font: 600 11px var(--font-ui);
  color: var(--text-3);
  pointer-events: none;
}
.search .input:focus + kbd, .search .input:not(:placeholder-shown) + kbd { display: none; }
.who { display: flex; align-items: center; gap: 10px; flex: none; }
.who-text { display: grid; line-height: 1.2; }
.who-text b { font-size: 13px; }
.who-text span { font-size: 11.5px; color: var(--text-3); }
.who .icon-btn { width: 36px; height: 36px; }
.who .icon-btn svg { width: 17px; height: 17px; }

.page { width: 100%; max-width: 1440px; padding: 24px 28px 72px; display: grid; gap: 20px; align-content: start; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head p { color: var(--text-2); font-size: 14px; max-width: 70ch; }
.page-head .tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters .chip { cursor: pointer; }
.filters .chip .n { font-variant-numeric: tabular-nums; opacity: 0.7; }

/* ------------------------------------------------------------ Bausteine */

.btn.xs { min-height: 30px; padding: 0 11px; font-size: 12.5px; gap: 6px; }
.btn.xs svg { width: 14px; height: 14px; }
.btn.small svg { width: 16px; height: 16px; }
.btn.danger:hover { background: rgba(255, 90, 95, 0.1); }
.btn.ghost:hover { background: var(--ink-2); }

.link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.link:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--text-3); }

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--c, var(--text-3));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, #888) 20%, transparent);
}
.code { font-family: var(--mono); font-size: 12.5px; padding: 2px 7px; border-radius: 6px; background: var(--ink-3); color: var(--text); white-space: nowrap; }
.lv { display: inline-grid; place-items: center; min-width: 30px; height: 20px; padding: 0 6px; margin-right: 6px; border-radius: 6px; background: var(--ink-3); font-size: 11px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.badge.sky { background: rgba(90, 209, 255, 0.14); color: var(--sky); }
.badge.violet { background: rgba(138, 107, 255, 0.18); color: #b6a4ff; }
.hint { font-size: 12.5px; color: var(--text-3); }
.muted-line { font-size: 13px; color: var(--text-2); }
.tags { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.tag .dot { width: 8px; height: 8px; box-shadow: none; }

.panel { min-width: 0; background: var(--ink-1); border: 1px solid var(--line); border-radius: var(--r-md); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 14.5px; font-weight: 700; }
.panel-head .hint { font-size: 12px; }
.panel-body { padding: 16px; }
.panel-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); }
.panel-foot .grow { flex: 1; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; min-width: 0; }

.empty { display: grid; justify-items: center; gap: 6px; padding: 40px 20px; text-align: center; color: var(--text-2); }
.empty .ic { width: 30px; height: 30px; color: var(--text-3); margin-bottom: 4px; }
.empty b { color: var(--text); font-size: 15px; }
.empty p { font-size: 13.5px; max-width: 42ch; }

/* Kennzahlen */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 12px; }
.tile {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 14px 16px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--ink-1);
  color: inherit;
  text-decoration: none;
}
.tile .label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.tile .label .ic { width: 15px; height: 15px; color: var(--text-3); }
.tile .value { white-space: nowrap; font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile .value small { margin-left: 3px; font-size: 13px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.tile .sub { font-size: 12px; color: var(--text-3); }
.tile .sub .up { color: var(--lime); }
.tile .sub .down { color: #ff86b7; }
a.tile:hover { border-color: var(--line-strong); background: var(--ink-2); }
.tile.alert { border-color: rgba(255, 61, 139, 0.4); background: linear-gradient(160deg, rgba(255, 61, 139, 0.1), transparent 60%), var(--ink-1); }
.tile.alert .label .ic { color: var(--pink); }

/* Tabellen */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--ink-1); }
.panel .table-wrap { border: 0; border-radius: 0 0 var(--r-md) var(--r-md); }
table.t { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 14px; }
.t th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: left;
  color: var(--text-3);
  white-space: nowrap;
}
.t td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background 0.12s; }
.t tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.off td { color: var(--text-3); }
.t .num, .t th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.t td.nowrap { white-space: nowrap; }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-user .name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.t .input.sm { min-width: 0; }

/* ------------------------------------------------------------ Drawer */

.drawer-layer { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; }
.drawer-layer[hidden] { display: none; }
.scrim { position: absolute; inset: 0; background: rgba(4, 5, 10, 0.62); animation: fade 0.2s ease; }
.drawer {
  position: relative;
  width: min(580px, 100vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--ink-1);
  border-left: 1px solid var(--line-strong);
  box-shadow: -30px 0 90px rgba(0, 0, 0, 0.6);
}
.drawer.enter { animation: slide 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.drawer.wide { width: min(1140px, 100vw); }
.drawer-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head .dh-text { min-width: 0; flex: 1; }
.drawer-head h2 { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.drawer-head .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; color: var(--text-2); }
.drawer-head .icon-btn { flex: none; width: 36px; height: 36px; align-self: flex-start; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 20px; display: grid; gap: 22px; align-content: start; }
.drawer-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--ink-1); }
.drawer-foot .grow { flex: 1; }
@keyframes slide { from { transform: translateX(48px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.sec { display: grid; gap: 10px; min-width: 0; }
.sec > h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.mini { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-2); }
.mini span { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.mini b { font-family: var(--font-display); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mini b small { font-family: var(--font-ui); font-size: 12px; color: var(--text-2); font-weight: 500; margin-left: 2px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; }
.level-box { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-2); }
.level-box .row { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); min-width: 0; }
.list > li:first-child { border-top: 0; }
.list.boxed { border: 1px solid var(--line); border-radius: 14px; background: var(--ink-2); }
.list.boxed > li { padding: 9px 12px; }
.list .grow { flex: 1; min-width: 0; }
.list .grow > b, .list .grow > .link { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .side-num { margin-left: auto; text-align: right; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.list .side-num b { display: block; font-size: 14px; color: var(--text); }
.list .side-num span { color: var(--text-3); font-size: 12px; }
.list li.clickable { cursor: pointer; }
.list li.clickable:hover { background: rgba(255, 255, 255, 0.025); }
.mini-route { width: 72px; height: 48px; flex: none; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--ink-0); }
.mini-route svg { width: 100%; height: 100%; border-radius: 0; }
.meter { height: 5px; border-radius: 999px; background: var(--ink-3); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--pink)); }
.trophy-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--ink-2); font-size: 13px; }
.tchip .ic { width: 16px; height: 16px; color: var(--amber); }
.tchip span { color: var(--text-3); font-size: 12px; }

/* ------------------------------------------------------------ Formulare */

.form { display: grid; gap: 18px; align-content: start; min-width: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { min-width: 0; }
.field .hint { font-weight: 400; }
.input.sm, select.input.sm { min-height: 36px; padding: 6px 10px; border-radius: 10px; font-size: 14px; }
select.input { appearance: auto; }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255, 90, 95, 0.15); }
.form-error { color: var(--danger); font-size: 13px; font-weight: 600; }
.input.otp { font-family: var(--mono); font-size: 18px; letter-spacing: 0.18em; max-width: 180px; }

/* Zwei-Faktor (two-factor.js) */
.tf-steps { display: grid; gap: 22px; margin: 0; padding-left: 20px; color: var(--text-2); font-size: 14px; }
.tf-steps b { color: var(--text); }
.tf-qr { margin-top: 12px; }
.qr { display: block; width: 216px; height: 216px; max-width: 100%; border-radius: 12px; }
.tf-manual { margin-top: 12px; }
.tf-manual summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
.tf-manual .hint { margin: 8px 0; }
.tf-secret { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tf-secret .code { white-space: normal; word-break: break-all; font-size: 13.5px; letter-spacing: 0.06em; user-select: all; }
.tf-confirm { margin-top: 12px; gap: 12px; }
.tf-sub { font-size: 15px; font-weight: 600; }
.form-error:empty { display: none; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid rgba(90, 209, 255, 0.22); border-radius: 12px; background: rgba(90, 209, 255, 0.07); color: #c4ecff; font-size: 13px; }
.note .ic { width: 16px; height: 16px; margin-top: 1px; color: var(--sky); }
.note.amber { border-color: rgba(255, 194, 75, 0.25); background: rgba(255, 194, 75, 0.07); color: #ffe2a8; }
.note.amber .ic { color: var(--amber); }

.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--ink-1); justify-self: start; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg input:checked + span { background: var(--text); color: var(--ink-1); }
.seg input:focus-visible + span { outline: 2px solid var(--pink); outline-offset: 2px; }

.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; max-height: 280px; overflow-y: auto; padding: 2px; }
.check { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-1); font-size: 14px; cursor: pointer; }
.check:hover { border-color: var(--line-strong); }
.check:has(input:checked) { border-color: rgba(255, 61, 139, 0.55); background: rgba(255, 61, 139, 0.08); }
.check input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--pink); }
.check .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check .hint { margin-left: auto; white-space: nowrap; }

.radio-cards { display: grid; gap: 8px; }
.radio-card { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-1); cursor: pointer; }
.radio-card:has(input:checked) { border-color: rgba(255, 61, 139, 0.55); background: rgba(255, 61, 139, 0.07); }
.radio-card input { grid-row: span 2; margin: 3px 0 0; accent-color: var(--pink); }
.radio-card b { font-size: 14px; }
.radio-card span { font-size: 12.5px; color: var(--text-2); }

.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.switch input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  margin: 0;
  border-radius: 999px;
  background: var(--ink-4);
  cursor: pointer;
  transition: background 0.2s;
}
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch input:checked { background: var(--grad); }
.switch input:checked::after { transform: translateX(16px); }

/* Editor mit Vorschau */
.editor { display: grid; grid-template-columns: minmax(0, 430px) minmax(0, 1fr); gap: 28px; align-items: start; }
.preview { position: sticky; top: 0; display: grid; gap: 12px; min-width: 0; }
.preview > h3 { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }

.boards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.board { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--ink-2); }
.board.sel { border-color: transparent; background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, var(--grad) border-box; }
.board h4 { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 14px; }
.board .expl { margin: 4px 0 12px; min-height: 4.2em; font-size: 11.5px; color: var(--text-3); }
.board ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.board li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 1px 6px; align-items: center; font-size: 13px; }
.board .sub { grid-column: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.board .rk { font-weight: 800; color: var(--text-3); font-variant-numeric: tabular-nums; }
.board li.first .rk { color: var(--amber); }
.board li.first .nm span { font-weight: 700; }
.board .nm { display: flex; align-items: center; gap: 7px; min-width: 0; }
.board .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .nm .dot { width: 8px; height: 8px; box-shadow: none; }
.board .val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.board .val small { font-weight: 500; color: var(--text-3); font-size: 11px; }
.board .meta { font-size: 11px; color: var(--text-3); }

.phone-frame { max-width: 380px; padding: 18px 14px; border: 1px solid var(--line-strong); border-radius: 30px; background: var(--ink-0); }
.phone-frame .hint { margin-bottom: 10px; padding-left: 4px; }
.banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 12px;
  padding: 14px 16px;
  border: 1.5px solid transparent;
  border-radius: 20px;
  background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, var(--grad) border-box;
  box-shadow: 0 12px 40px rgba(255, 61, 139, 0.16);
}
.banner .bi { grid-row: span 3; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--grad); color: #fff; }
.banner .bi svg { width: 20px; height: 20px; }
.banner b { font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.banner p { font-size: 13.5px; color: var(--text-2); overflow-wrap: anywhere; }
.banner .left { font-size: 12px; font-weight: 700; color: var(--amber); }

/* Aktions-Karten */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.acard { display: grid; gap: 10px; align-content: start; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--ink-1); cursor: pointer; transition: border-color 0.15s; }
.acard:hover { border-color: var(--line-strong); }
.acard.off { opacity: 0.72; }
.acard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.acard h3 { font-size: 16px; font-weight: 700; }
.acard p { font-size: 13.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acard .kv { font-size: 13px; gap: 4px 14px; }
.acard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; margin-top: 2px; border-top: 1px solid var(--line); }

/* Moderation */
.reports { display: grid; gap: 12px; }
.report { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--ink-1); }
.report-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-top .hint { margin-left: auto; }
.report blockquote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--line-strong); border-radius: 0 10px 10px 0; background: var(--ink-2); font-size: 14.5px; overflow-wrap: anywhere; }
.report-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-2); }
.report-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.report.done { opacity: 0.8; }
.resolution { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.resolution .ic { width: 16px; height: 16px; color: var(--lime); }

/* Pokale und Level */
.ticon { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 10px; background: rgba(255, 194, 75, 0.12); color: var(--amber); }
.ticon svg { width: 18px; height: 18px; }
.icon-pick { display: flex; align-items: center; gap: 8px; }
.icon-pick select { width: 118px; }
.cell-stack { display: grid; gap: 6px; }
.unsaved { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--amber); }
.unsaved::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.xp-row { display: flex; flex-wrap: wrap; gap: 12px; }
.xp-row .field { width: 180px; }

/* Mentoren */
.mentors { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.mcard { position: relative; display: grid; gap: 10px; align-content: start; padding: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--ink-1); }
.mcard::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c); }
.mcard::after { content: ""; position: absolute; top: -60px; right: -60px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%); pointer-events: none; }
.morb { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--ink-1); background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c) 65%, white), var(--c) 60%, color-mix(in srgb, var(--c) 55%, black)); }
.mcard h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.mcard .tone { font-size: 13.5px; color: var(--text-2); font-style: italic; }
.mcard .counts { display: flex; flex-wrap: wrap; gap: 4px; }
.mcard .btn { justify-self: start; }
.ph-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ph { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--ink-2); font-size: 12.5px; color: var(--text-2); }
button.ph { cursor: pointer; }
button.ph:hover { border-color: var(--pink); color: var(--text); }
.ph code { font-family: var(--mono); font-size: 12px; color: var(--text); }
.line-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: start; }
.line-item textarea.input { min-height: 64px; font-size: 14px; }
.line-item .icon-btn { width: 34px; height: 34px; }
.line-item .icon-btn svg { width: 16px; height: 16px; }
.line-preview { grid-column: 1 / -1; font-size: 12.5px; color: var(--text-3); }
.line-preview .warn { color: var(--amber); font-weight: 600; }
.situation { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--ink-2); }
.situation header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.situation header b { font-size: 14.5px; }

/* Diagramm */
.chart { position: relative; min-height: 240px; }
.chart svg { display: block; width: 100%; height: 240px; overflow: visible; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font-ui); }
.chart .gl { stroke: var(--line); }
.chart .base { stroke: var(--line-strong); }
.chart .tip { opacity: 0; fill: var(--text); font-weight: 700; transition: opacity 0.12s; pointer-events: none; }
.chart .bg:hover .tip, .chart .bg:focus .tip { opacity: 1; }
.chart .bg:hover .br { filter: brightness(1.25); }
.chart .bg:focus { outline: none; }
.chart .bg:focus .br { stroke: var(--text); stroke-width: 1; }
.chart-sum { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.chart-sum b { color: var(--text); font-variant-numeric: tabular-nums; }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: 22px; z-index: 90; display: grid; gap: 8px; justify-items: center; transform: translateX(-50%); pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--ink-3); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; animation: toast-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); transition: opacity 0.3s, transform 0.3s; }
.toast .ic { color: var(--lime); }
.toast.warn .ic { color: var(--amber); }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ------------------------------------------------------------ Schmal */

@media (max-width: 1180px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }
}
@media (max-width: 899px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { z-index: 40; height: auto; max-height: 100dvh; gap: 0; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .brand { padding: 0; }
  .side-toggle { display: inline-grid; }
  .side .nav, .side .side-foot { display: none; }
  .side.open .nav, .side.open .side-foot { display: grid; }
  .side.open .nav { padding: 14px 0 8px; }
  .side.open .side-foot { padding-bottom: 6px; }
  .nav a[aria-current="page"]::before { left: -6px; }
  .topbar { position: static; flex-wrap: wrap; gap: 10px 12px; padding: 12px 16px; min-height: 0; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--ink-0); }
  .search { order: 3; flex: 1 1 100%; }
  .search kbd { display: none; }
  .who-text { display: none; }
  .page { padding: 16px 16px 56px; gap: 16px; }
  .boards { grid-template-columns: minmax(0, 1fr); }
  .board .expl { min-height: 0; }
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .drawer-body { padding: 16px; }
  .drawer-head, .drawer-foot { padding-left: 16px; padding-right: 16px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile .value { font-size: 22px; }
  .cards, .mentors { grid-template-columns: minmax(0, 1fr); }
  .login-card { padding: 24px; }
  .list > li { padding: 10px 12px; }
}

/* ------------------------------------------------------------ Rückfrage */

.ask-layer { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.ask { position: relative; width: min(420px, 100%); padding: 22px 22px 18px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--ink-2); box-shadow: var(--shadow); animation: ask-in 0.18s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ask h2 { margin: 0; font-size: 17px; line-height: 1.35; text-wrap: balance; }
.ask p { margin: 8px 0 0; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.ask-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
@keyframes ask-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
@media (prefers-reduced-motion: reduce) { .ask { animation: none; } }

/* ------------------------------------------------------------ Server: Laden, Warten, Umbenennen */

.loading { display: grid; justify-items: center; gap: 12px; padding: 56px 20px; color: var(--text-3); font-size: 13.5px; font-weight: 600; }
.loading::before { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--ink-4); border-top-color: var(--pink); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading::before { animation-duration: 2.4s !important; } }
#cmp-preview { transition: opacity 0.2s; }
#cmp-preview[aria-busy="true"] { opacity: 0.55; }
.inline-edit { display: flex; gap: 8px; align-items: center; }
.inline-edit .input { flex: 1; min-width: 0; }
.inline-edit .btn { flex: none; }
.login-card .note { margin: 0; }
