:root {
  --bg:        #0f1117;
  --bg-2:      #161922;
  --bg-3:      #1d2130;
  --line:      #2a2f40;
  --line-2:    #353c52;
  --text:      #e7eaf3;
  --text-dim:  #98a0b8;
  --text-mute: #6b7390;
  --accent:    #6366f1;
  --accent-2:  #818cf8;
  --danger:    #ef4444;
  --radius:    14px;
  --shadow:    0 8px 30px rgba(0,0,0,.35);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #1a1f33 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

/* ---------- Auth / Setup ---------- */
.auth-body { display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 28px; box-shadow: var(--shadow);
}
.auth-logo {
  font-weight: 800; letter-spacing: .18em; font-size: 13px;
  color: var(--accent-2); margin-bottom: 18px;
}
.auth-card h1 { margin: 0 0 6px; font-size: 22px; }
.auth-sub { color: var(--text-dim); font-size: 14px; margin: 0 0 20px; }
.auth-card label, .modal label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }
.auth-card input, .modal input, .modal textarea, .modal select {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 9px;
  color: var(--text); font: inherit; font-size: 14px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.alert { padding: 10px 12px; border-radius: 9px; font-size: 13px; margin-bottom: 16px; }
.alert.warn { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.4); color: #fca5a5; }
.alert.ok   { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.4); color: #6ee7b7; }

/* ---------- Buttons ---------- */
.btn-primary, .btn-ghost, .btn-danger {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  border-radius: 9px; padding: 9px 16px; border: 1px solid transparent;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--accent); color: #fff; width: 100%; justify-content: center; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: var(--bg-3); color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--accent); color: #fff; }
.btn-danger { background: rgba(239,68,68,.14); color: #fca5a5; border-color: rgba(239,68,68,.4); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.modal .btn-primary { width: auto; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 22px; border-bottom: 1px solid var(--line);
  background: rgba(15,17,23,.7); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 800; font-size: 17px; letter-spacing: .01em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.role-badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; }
.role-badge.admin { background: rgba(99,102,241,.18); color: var(--accent-2); }
.role-badge.gast  { background: rgba(148,160,184,.14); color: var(--text-dim); }
.save-status { font-size: 12px; color: var(--text-mute); min-width: 90px; }
.save-status.ok { color: #6ee7b7; }
.save-status.err { color: #fca5a5; }

/* ---------- Filterzeile ---------- */
.filters {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  padding: 12px 22px; color: var(--text-dim); font-size: 13px;
}
.filters-label { color: var(--text-mute); font-weight: 600; }
.legend-chip { display: inline-flex; align-items: center; gap: 6px; }
.legend-chip .dot { width: 9px; height: 9px; border-radius: 99px; }
.toggle-internal { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.toggle-internal input { accent-color: var(--accent); }

/* ---------- Board: Swimlanes (Kategorie) × Spalten (Status) ---------- */
.board { padding: 8px 22px 60px; display: flex; flex-direction: column; gap: 26px; }
.lane { }
.lane-head {
  display: flex; align-items: center; gap: 8px; margin: 6px 2px 10px;
  font-weight: 700; font-size: 15px; color: var(--text);
}
.lane-head .lane-icon { font-size: 18px; }
.lane-head .lane-count { color: var(--text-mute); font-weight: 600; font-size: 13px; }
.lane-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
}
.cell {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  min-height: 90px; padding: 10px; display: flex; flex-direction: column; gap: 9px;
  transition: border-color .12s, background .12s;
}
.cell-head {
  display: flex; align-items: center; gap: 7px; font-size: 12px;
  color: var(--text-dim); font-weight: 600; padding: 2px 2px 6px;
  border-bottom: 1px dashed var(--line); margin-bottom: 2px;
}
.cell-head .dot { width: 8px; height: 8px; border-radius: 99px; }
.cell.drop-hover { border-color: var(--accent); background: rgba(99,102,241,.07); }
.cell-empty { color: var(--text-mute); font-size: 12px; font-style: italic; padding: 6px 4px; }

/* ---------- Karten ---------- */
.card {
  background: var(--bg-3); border: 1px solid var(--line-2); border-left: 3px solid var(--st-color, var(--accent));
  border-radius: 11px; padding: 11px 12px; cursor: grab; position: relative;
  transition: transform .08s, box-shadow .12s, border-color .12s;
}
.card:hover { box-shadow: var(--shadow); border-color: var(--accent); }
.card:active { cursor: grabbing; }
.card.dragging { opacity: .45; }
.card .card-top { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.card .nr {
  font-size: 11px; font-weight: 700; color: var(--text-mute);
  background: var(--bg); padding: 2px 6px; border-radius: 6px; letter-spacing: .03em;
}
.card .name { font-weight: 700; font-size: 14px; }
.card .desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.card a.live {
  font-size: 11px; font-weight: 600; color: var(--accent-2);
  text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
}
.card a.live:hover { text-decoration: underline; }
.card .tag {
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px;
  background: rgba(148,160,184,.13); color: var(--text-dim);
}
.card .tag.internal { background: rgba(239,68,68,.14); color: #fca5a5; }
.card .note {
  font-size: 11.5px; color: var(--text-mute); margin-top: 7px;
  padding-top: 7px; border-top: 1px dashed var(--line); display: flex; gap: 5px;
}
.card .data-src { font-size: 11px; color: var(--text-mute); margin-top: 6px; }
.card .edit-btn {
  position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity .12s;
  background: var(--bg); border: 1px solid var(--line-2); color: var(--text-dim);
  width: 24px; height: 24px; border-radius: 7px; cursor: pointer; font-size: 13px; line-height: 1;
}
.card:hover .edit-btn { opacity: 1; }
.card .edit-btn:hover { color: #fff; border-color: var(--accent); }
.card.internal-hidden { display: none; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(7,9,14,.7); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 50; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  width: 100%; max-width: 520px; background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); max-height: 90vh; overflow: auto;
}
.modal h2 { margin: 0 0 18px; font-size: 19px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal .checkrow { display: flex; align-items: center; gap: 8px; flex-direction: row; }
.modal .checkrow input { width: auto; margin: 0; }
.modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.modal-actions .spacer { flex: 1; }

/* ---------- Hub (Startseite nach Login) ---------- */
.hub { max-width: 1100px; margin: 0 auto; padding: 40px 22px 60px; }
.hub-intro { color: var(--text-dim); font-size: 15px; margin: 0 0 22px; }
.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.hub-grid-3 { grid-template-columns: repeat(3, 1fr); }
.hub-grid-4 { grid-template-columns: repeat(4, 1fr); }
.hub-grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) { .hub-grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .hub-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px)  { .hub-grid-5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .hub-grid-5 { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .hub-grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .hub-grid-4 { grid-template-columns: 1fr; } }
.hub-tile {
  display: flex; flex-direction: column; gap: 8px; text-decoration: none;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; color: var(--text); transition: border-color .12s, transform .08s, box-shadow .12s;
}
.hub-tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.hub-icon { font-size: 34px; }
.hub-title { font-size: 20px; font-weight: 800; }
.hub-desc { color: var(--text-dim); font-size: 14px; line-height: 1.5; }
.hub-stat { color: var(--text-mute); font-size: 12.5px; margin-top: 6px; }

/* ---------- Tools-Seite ---------- */
.tools-wrap { max-width: 980px; margin: 0 auto; padding: 28px 22px 60px; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tool-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 10px;
}
.tool-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-top .nr {
  font-size: 11px; font-weight: 700; color: var(--text-mute);
  background: var(--bg); padding: 2px 6px; border-radius: 6px;
}
.tool-name { font-weight: 700; font-size: 16px; }
.tool-desc { color: var(--text-dim); font-size: 13.5px; line-height: 1.5; margin: 0; }
.tool-note { color: var(--text-mute); font-size: 12.5px; margin: 0; }
.tool-actions { margin-top: 4px; }
.tool-local-hint { color: var(--text-mute); font-size: 12.5px; font-style: italic; }

@media (max-width: 900px) {
  .lane-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .hub-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .lane-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .grid2 { grid-template-columns: 1fr; }
}

/* ---------- Ideen-Seite ---------- */
.ideen-wrap { max-width: 860px; margin: 0 auto; padding: 24px 22px 60px; }
.ideen-list { display: flex; flex-direction: column; gap: 12px; }
.ideen-empty { color: var(--text-mute); font-style: italic; text-align: center; padding: 60px 0; font-size: 15px; }

.idea-filters {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 10px 22px; border-bottom: 1px solid var(--line);
  background: rgba(15,17,23,.75); backdrop-filter: blur(8px);
  position: sticky; top: 56px; z-index: 10; font-size: 13px;
}
.idea-filters .filters-label { color: var(--text-mute); font-weight: 600; margin-right: 2px; }
.ifilter {
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  border-radius: 99px; padding: 3px 11px; border: 1px solid var(--line-2);
  background: transparent; color: var(--text-dim); transition: .12s;
  display: inline-flex; align-items: center; gap: 5px;
}
.ifilter:hover { border-color: var(--accent); color: var(--text); }
.ifilter.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ifilter-count {
  font-size: 10.5px; font-weight: 700; opacity: .75;
  background: rgba(255,255,255,.15); border-radius: 99px; padding: 0 5px;
}
.filter-sep { color: var(--line-2); margin: 0 4px; }

.idea-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-left: 3px solid var(--st-color, var(--accent));
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color .12s, box-shadow .12s;
}
.idea-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.idea-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.idea-id {
  font-size: 10.5px; font-weight: 700; color: var(--text-mute);
  background: var(--bg); padding: 2px 7px; border-radius: 6px; letter-spacing: .03em;
}
.idea-autor { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; }
.idea-autor.zero   { background: rgba(99,102,241,.2); color: var(--accent-2); }
.idea-autor.phreak { background: rgba(16,185,129,.15); color: #6ee7b7; }
.idea-autor.system { background: rgba(148,160,184,.13); color: var(--text-dim); }
.idea-datum { font-size: 11.5px; color: var(--text-mute); margin-left: auto; }
.idea-text { font-size: 14.5px; font-weight: 600; line-height: 1.5; }
.idea-footer {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 2px;
}
.idea-status {
  font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 99px;
}
.idea-score {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-dim);
}
.idea-score-bar { display: flex; gap: 2px; align-items: center; }
.score-dot {
  width: 9px; height: 9px; border-radius: 2px;
  background: var(--bg-3); border: 1px solid var(--line-2);
}
.score-dot.filled { background: #f59e0b; border-color: #d97706; }
.idea-score-num { font-weight: 700; color: #f59e0b; font-size: 11.5px; }
.idea-notiz { font-size: 12px; color: var(--text-mute); font-style: italic; }
.idea-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }

.idea-card .edit-btn {
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line-2); color: var(--text-dim);
  padding: 3px 10px; border-radius: 7px; transition: .12s;
}
.idea-card .edit-btn:hover { border-color: var(--accent); color: #fff; }

.idea-card .proj-btn {
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.35); color: #93c5fd;
  padding: 3px 10px; border-radius: 7px; transition: .12s;
}
.idea-card .proj-btn:hover { background: #3b82f6; border-color: #3b82f6; color: #fff; }

/* ---------- Agentenaufgaben ---------- */
.agent-section {
  max-width: 1100px; margin: 36px auto 0; padding: 0 22px;
}
.agent-section-page {
  max-width: 1100px; margin: 0 auto; padding: 28px 22px 60px;
}
.agent-page-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  color: var(--text-dim); font-size: 13px; margin-bottom: 18px;
}
.agent-section-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.agent-section-icon { font-size: 20px; }
.agent-section-title { font-size: 17px; font-weight: 800; margin: 0; }
.agent-section-link { margin-left: auto; }
.agent-subsection-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-dim); margin-bottom: 10px; padding-left: 2px;
}
.agent-empty { color: var(--text-mute); font-style: italic; text-align: center; padding: 40px 0; }
.agent-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px;
}
.agent-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-left: 3px solid var(--st-color, var(--accent));
  border-radius: var(--radius); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 9px;
  transition: border-color .12s, box-shadow .12s;
}
.agent-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.agent-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agent-emoji { font-size: 20px; line-height: 1; }
.agent-name { font-weight: 700; font-size: 15px; flex: 1; }
.agent-status {
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 99px;
}
.agent-status.aktiv    { background: rgba(16,185,129,.18);  color: #6ee7b7; }
.agent-status.pausiert { background: rgba(245,158,11,.18);  color: #fcd34d; }
.agent-status.geplant  { background: rgba(148,160,184,.13); color: var(--text-dim); }
.agent-task { font-weight: 600; font-size: 14px; }
.agent-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }
.agent-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.agent-chip {
  font-size: 11.5px; color: var(--text-mute);
  background: var(--bg-3); border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 7px;
  display: inline-flex; align-items: center; gap: 4px;
}
.agent-chip a { color: var(--accent-2); text-decoration: none; }
.agent-chip a:hover { text-decoration: underline; }
