/* Aufgabenboard Empire V — Design nach dem Manual "Luxury Tech" */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #171721;
  --bg-hover: #1d1d2b;
  --border: #2a2a3a;
  --text-primary: #ffffff;
  --text-secondary: #b2b2c4;
  --text-muted: #7a7a91;
  --success: #32d583;
  --warning: #fbbf24;
  --error: #f04438;
  --info: #338cff;
  --gradient: linear-gradient(90deg, #eb004c, #d300a7, #b808f1, #7845ff, #338cff);
  --accent: #7845ff;
  --radius: 16px;
  --radius-sm: 10px;
  --pad: 24px;
  --ease: 180ms cubic-bezier(0.2, 0, 0.2, 1);
  --kopf: 60px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--info); }

/* ---------------------------------------------------------------- Anmeldeseite */

body.anmelden { display: grid; place-items: center; padding: var(--pad); }

.anmeldekarte {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 400px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.anmeldekarte::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--gradient);
}
.marke {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.anmeldekarte h1 {
  font-size: 26px;
  margin: 0 0 14px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.anmeldekarte p { color: var(--text-secondary); line-height: 1.6; margin: 0 0 26px; }
.anmeldekarte p.klein { font-size: 13px; color: var(--text-muted); margin: 20px 0 0; }

.discord-knopf {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #5865f2;
  color: #fff;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: transform var(--ease), box-shadow var(--ease);
}
.discord-knopf:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(88, 101, 242, 0.35); }

/* ---------------------------------------------------------------- Kopfzeile */

.kopf {
  height: var(--kopf);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 var(--pad);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.kopf-marke {
  font-weight: 700;
  letter-spacing: -0.01em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.kopf-mitte { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.kopf-titel { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf-notiz { font-size: 13px; color: var(--text-muted); white-space: nowrap; }

.ich { display: flex; align-items: center; gap: 9px; }
.ich img, .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-hover);
  object-fit: cover;
  flex: none;
}
.avatar-buchstabe {
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff;
}

/* ---------------------------------------------------------------- Layout */

.rahmen { display: flex; height: calc(100vh - var(--kopf)); }

.seitenleiste {
  width: 236px;
  flex: none;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  overflow-y: auto;
}
.seitenleiste-titel {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 10px 10px;
}
.board-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  transition: background var(--ease), color var(--ease);
  margin-bottom: 2px;
}
.board-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.board-link.aktiv { background: var(--bg-card); color: var(--text-primary); }
.board-link .punkt { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.board-link .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.board-link .abz {
  font-size: 10px; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px;
}

.buehne { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }

.board-kopf { padding: 18px var(--pad) 12px; }
.board-kopf h1 { font-size: 21px; margin: 0 0 4px; display: flex; align-items: center; gap: 9px; }
.board-kopf p { margin: 0; color: var(--text-muted); font-size: 13.5px; }

/* ---------------------------------------------------------------- Spalten */

.spalten {
  flex: 1;
  display: flex;
  gap: 14px;
  padding: 6px var(--pad) var(--pad);
  overflow-x: auto;
  overflow-y: hidden;
  align-items: flex-start;
}

.spalte {
  width: 288px;
  flex: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: 100%;
}
.spalte.ziel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.spalte.gesperrt { opacity: 0.55; }

.spalte-kopf {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 14px 10px;
}
.spalte-kopf .titel { font-weight: 600; font-size: 14px; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spalte-kopf .zahl {
  font-size: 11px; color: var(--text-muted);
  background: var(--bg-card); border-radius: 20px; padding: 2px 8px; flex: none;
}
.schloss { font-size: 11px; color: var(--text-muted); flex: none; }

.karten {
  padding: 0 10px 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.karte {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  cursor: grab;
  transition: border-color var(--ease), transform var(--ease);
}
.karte:hover { border-color: #3a3a4e; }
.karte.zieht { opacity: 0.4; }
.karte .titel { font-size: 14px; line-height: 1.45; word-break: break-word; }
.karte .labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; }
.karte .fuss {
  display: flex; align-items: center; gap: 10px;
  margin-top: 9px; font-size: 12px; color: var(--text-muted);
}
.karte .fuss .rechts { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.karte .avatar { width: 21px; height: 21px; }

.label-chip {
  height: 7px; width: 26px; border-radius: 20px;
}
.label-voll {
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  color: #0a0a0f; font-weight: 600;
}

.frist { padding: 1px 6px; border-radius: 5px; background: var(--bg-hover); }
.frist.faellig { background: rgba(240, 68, 56, 0.16); color: #ffa8a2; }
.frist.bald { background: rgba(251, 191, 36, 0.14); color: var(--warning); }

.neue-karte {
  margin: 0 10px 10px;
  padding: 9px 11px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-align: left;
  font-size: 13.5px;
  transition: border-color var(--ease), color var(--ease);
}
.neue-karte:hover { border-color: var(--accent); color: var(--text-secondary); }

.spalte-eingabe {
  margin: 0 10px 10px;
  width: calc(100% - 20px);
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 11px;
  font-size: 14px;
  resize: vertical;
  min-height: 62px;
}
.spalte-eingabe:focus { outline: none; }

/* ---------------------------------------------------------------- Kartendetail */

.schleier {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(5, 5, 9, 0.72);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: var(--pad);
}
.blatt {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: min(660px, 100%);
  max-height: min(86vh, 900px);
  overflow-y: auto;
  position: relative;
}
.blatt-kopf { padding: 22px var(--pad) 0; }
.blatt-kopf .weg {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--text-muted);
  font-size: 22px; line-height: 1; padding: 4px 8px; border-radius: 8px;
}
.blatt-kopf .weg:hover { background: var(--bg-hover); color: var(--text-primary); }
.blatt-kopf .ort { font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; }
.blatt h2 {
  font-size: 19px; margin: 0 40px 4px 0; line-height: 1.4;
  border-radius: 6px; padding: 3px 5px; margin-left: -5px;
}
.blatt h2[contenteditable]:hover { background: var(--bg-hover); }
.blatt h2:focus { outline: 1px solid var(--accent); background: var(--bg-primary); }

.blatt-inhalt { padding: 16px var(--pad) var(--pad); display: grid; gap: 20px; }

.feld-titel {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 8px;
}

.beschreibung {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  min-height: 76px;
  color: var(--text-secondary);
  font-size: 14px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.beschreibung:focus { outline: none; border-color: var(--accent); color: var(--text-primary); }
.beschreibung:empty::before { content: attr(data-leer); color: var(--text-muted); }

.reihe { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

.knopf {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 13px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.knopf:hover { background: var(--bg-hover); color: var(--text-primary); }
.knopf.an { border-color: var(--accent); color: var(--text-primary); }
.knopf.gefahr:hover { border-color: var(--error); color: #ffa8a2; }
.knopf.haupt { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.knopf.haupt:hover { background: #8a5cff; }

input[type="datetime-local"], select, input[type="text"] {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 11px;
  font: inherit;
  font-size: 13.5px;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }

.kommentar { display: flex; gap: 10px; margin-bottom: 14px; }
.kommentar .inhalt { flex: 1; min-width: 0; }
.kommentar .zeile { display: flex; gap: 8px; align-items: baseline; margin-bottom: 3px; }
.kommentar .wer { font-weight: 600; font-size: 13.5px; }
.kommentar .wann { font-size: 11.5px; color: var(--text-muted); }
.kommentar .text {
  color: var(--text-secondary); font-size: 14px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}

.kommentar-neu { display: flex; gap: 10px; }
.kommentar-neu textarea {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 12px;
  font: inherit; font-size: 14px;
  resize: vertical; min-height: 44px;
}
.kommentar-neu textarea:focus { outline: none; border-color: var(--accent); }

/* ---------------------------------------------------------------- Kleinteile */

.leer {
  padding: 60px var(--pad);
  text-align: center;
  color: var(--text-muted);
}
.leer h2 { color: var(--text-secondary); font-size: 17px; margin: 0 0 8px; }

.hinweis {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 18px;
  font-size: 13.5px; z-index: 80;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  animation: hoch var(--ease) both;
}
.hinweis.fehler { border-color: var(--error); color: #ffa8a2; }
@keyframes hoch { from { opacity: 0; transform: translate(-50%, 10px); } }

.laedt { padding: 60px; text-align: center; color: var(--text-muted); }

/* ---------------------------------------------------------------- Schmale Fenster */

@media (max-width: 780px) {
  :root { --pad: 14px; }
  .seitenleiste {
    position: fixed; inset: var(--kopf) auto 0 0; z-index: 25;
    transform: translateX(-100%);
    transition: transform var(--ease);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  }
  .seitenleiste.offen { transform: none; }
  .menue-knopf { display: grid !important; }
  .spalte { width: 84vw; }
}
.menue-knopf {
  display: none;
  place-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 9px; width: 34px; height: 34px; flex: none;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #262636; border-radius: 20px; border: 2px solid var(--bg-primary); }
::-webkit-scrollbar-thumb:hover { background: #34344a; }

/* ---------------------------------------------------------------- Rechteverwaltung */

.rechte-seite { padding: 18px var(--pad) 60px; overflow-y: auto; max-width: 920px; }
.rechte-kopf h1 { font-size: 21px; margin: 0 0 6px; }
.rechte-kopf p { margin: 0 0 14px; color: var(--text-muted); font-size: 13.5px; line-height: 1.55; }

.abschnitt {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); margin: 28px 0 10px; font-weight: 600;
}

.warnung {
  background: rgba(251, 191, 36, 0.09);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13.5px; line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.warnung strong { color: var(--warning); }

.rechte-karte {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}

.rechte-karte-kopf {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 14px 16px;
  background: none; border: none; text-align: left;
  transition: background var(--ease);
}
.rechte-karte-kopf:hover { background: var(--bg-hover); }
.rechte-karte-kopf .name { font-weight: 600; font-size: 14.5px; flex: 1; }
.rechte-karte-kopf .zahl { font-size: 12px; color: var(--text-muted); }
.rechte-karte-kopf .pfeil { color: var(--text-muted); font-size: 12px; }

.rechte-karte-koerper {
  padding: 4px 16px 18px;
  border-top: 1px solid var(--border);
  display: grid; gap: 14px;
}

.rechte-tabelle {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.rechte-zeile {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}
.rechte-zeile:last-child { border-bottom: none; }
.rechte-zeile:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
.zeile-name { font-size: 13.5px; flex: 1; min-width: 0; word-break: break-word; }
.zeile-name.unbekannt { color: var(--text-muted); font-style: italic; }
.zeile-person { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }

.stufen { display: flex; gap: 3px; flex: none; }
.stufe {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 7px;
  transition: all var(--ease);
  white-space: nowrap;
}
.stufe:hover { background: var(--bg-hover); color: var(--text-primary); }
.stufe.an {
  background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 600;
}

.schalter-reihe { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hinweis-text { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.rechte-tabelle .hinweis-text { padding: 11px 12px; }

@media (max-width: 700px) {
  .rechte-zeile { flex-wrap: wrap; }
  .stufen { width: 100%; }
  .stufe { flex: 1; text-align: center; }
}
