/* ============================================================
   Invesco — internes Tool (RKX Consulting)
   Im RKX-Designsystem: dunkel, lila Akzent, Schaltplan-Anleihen.
   Tokens und Sprache identisch zur RKX-Website (rkx-theme.css).

   Fonts werden in lib/layout.js eingebunden:
   Unbounded (Display) · Sora (UI/Text) · JetBrains Mono (Labels/Daten)
   ============================================================ */
:root {
  /* Flächen: von tief nach hoch — RKX-Palette */
  --bg:        #0a0a13;
  --panel:     #131322;
  --panel-2:   #1a1a2c;
  --panel-3:   #232338;
  --border:    rgba(160,107,255,.16);
  --border-hi: rgba(160,107,255,.34);

  /* Text */
  --text:      #eae7f5;
  --text-2:    #9d97b5;
  --muted:     #6b6684;

  /* Akzente — Lila als Haupt-, Cyan als Signalfarbe */
  --accent:      #a06bff;
  --accent-hi:   #c6a6ff;
  --accent-deep: #4d3384;
  --accent-dim:  rgba(160,107,255,.12);
  --wire:        #4de1e8;
  --ok:          #4de1e8;
  --ok-dim:      rgba(77,225,232,.10);
  --warn:        #ffab6b;
  --warn-dim:    rgba(255,171,107,.12);
  --danger:      #ff7a7a;

  /* Typografie */
  --font-display: 'Unbounded', 'Segoe UI', sans-serif;
  --font-body:    'Sora', 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Consolas', monospace;

  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 16px 40px -22px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.03);
  --shadow-lg: 0 30px 60px -30px rgba(160,107,255,.25);

  --sidebar-w: 236px;
  --filters-w: 224px;
}

/* ============================================================
   Reset & Basis
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-hi); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent); }

p { margin: 0 0 10px; }

.muted { color: var(--muted); }
.small { font-size: .84em; }

::selection { background: var(--accent-dim); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(160,107,255,.22); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-hi); }

:focus-visible {
  outline: 2px solid var(--wire);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   Grundlayout: Nav-Spalte · (Filter-Spalte) · Inhalt
   ============================================================ */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #15152a 0%, #0b0b16 100%);
  border-right: 1px solid var(--border);
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: .01em;
  margin-bottom: 28px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 2px;
}
.sidebar .brand span {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 500;
  font-size: .72rem;
  letter-spacing: .08em;
}

.sidebar nav { display: flex; flex-direction: column; gap: 22px; flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group-label {
  font-family: var(--font-mono);
  font-size: .62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  padding: 0 10px;
  margin-bottom: 6px;
}
.sidebar nav a {
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: .9rem;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
  position: relative;
}
.sidebar nav a:hover { background: rgba(160,107,255,.08); color: var(--text); }
.sidebar nav a.active {
  background: var(--accent-dim);
  color: var(--accent-hi);
  font-weight: 600;
}
.sidebar nav a.active::before {
  content: "";
  position: absolute;
  left: -14px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px rgba(160,107,255,.7);
}

.logout-form { margin-top: 12px; }
.logout-form button {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: .76rem;
  letter-spacing: .04em;
  font-weight: 500;
  transition: all .15s ease;
}
.logout-form button:hover { color: var(--text); border-color: var(--border-hi); background: rgba(160,107,255,.08); }

/* Filter-Spalte */
.filters-col {
  width: var(--filters-w);
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 26px 18px;
  overflow-y: auto;
  max-height: 100vh;
  position: sticky;
  top: 0;
}
.filters-col h4 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: .64rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--wire);
}
.filters-col .filter-group {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.filters-col .filter-group:last-of-type { border-bottom: none; }
.filters-col label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  margin: 0 -6px;
  border-radius: 6px;
  font-size: .85rem;
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.filters-col label.check:hover { background: rgba(160,107,255,.08); color: var(--text); }
.filters-col label.check .fc { color: var(--muted); margin-left: auto; font-size: .78em; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.filters-col a.clear-filters { font-size: .78rem; font-family: var(--font-mono); color: var(--muted); display: inline-block; margin-top: 10px; }
.filters-col a.clear-filters:hover { color: var(--accent-hi); }
.filters-col button { width: 100%; }

input[type=checkbox] {
  appearance: none;
  width: 15px; height: 15px;
  flex-shrink: 0;
  border: 1.5px solid var(--border-hi);
  border-radius: 4px;
  background: var(--panel-2);
  cursor: pointer;
  position: relative;
  transition: all .12s ease;
}
input[type=checkbox]:hover { border-color: var(--accent); }
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::after {
  content: "";
  position: absolute;
  left: 4px; top: 1px;
  width: 4px; height: 8px;
  border: solid #0a0a13;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Inhaltsbereich */
.content { flex: 1; padding: 34px 44px 64px; max-width: 1240px; min-width: 0; position: relative; }

h1 { margin: 0 0 6px; font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; letter-spacing: -.015em; }
h2 { margin: 36px 0 14px; font-family: var(--font-display); font-size: 1.04rem; font-weight: 700; letter-spacing: -.01em; }
h3 { margin: 26px 0 10px; font-size: .95rem; font-weight: 600; }
h1 + p.muted, h1 + .muted { margin-top: -2px; }

/* ============================================================
   Kennzahlen-Kacheln
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.stat {
  background: var(--panel);
  background-image: linear-gradient(168deg, rgba(255,255,255,.028), transparent 42%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 17px 18px;
  box-shadow: var(--shadow);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
  position: relative;
}
/* Blueprint-Eckmarke */
.stat::before {
  content: "";
  position: absolute;
  top: 7px; left: 7px;
  width: 8px; height: 8px;
  border: solid var(--border-hi);
  border-width: 1px 0 0 1px;
  opacity: .8;
}
.stat:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
  box-shadow: 0 26px 52px -24px rgba(0,0,0,.75), 0 0 26px -8px rgba(160,107,255,.28), inset 0 1px 0 rgba(255,255,255,.04);
}
.stat.muted { opacity: .5; }
.stat-num {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--accent-hi);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.stat-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-top: 6px;
  line-height: 1.5;
}

/* ============================================================
   Taxonomie-Balken
   ============================================================ */
.tax-bars { display: flex; flex-direction: column; gap: 9px; }
.tax-bar-row {
  display: grid;
  grid-template-columns: 240px 1fr 46px;
  align-items: center;
  gap: 14px;
}
.tax-bar-label { font-size: .87rem; color: var(--text-2); }
.tax-bar-track { background: var(--panel-2); border-radius: 100px; height: 8px; overflow: hidden; border: 1px solid var(--border); }
.tax-bar-fill {
  background: linear-gradient(90deg, var(--accent-deep) 0%, var(--accent) 100%);
  height: 100%;
  border-radius: 100px;
  box-shadow: 0 0 12px rgba(160,107,255,.5);
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.tax-bar-count { text-align: right; color: var(--muted); font-family: var(--font-mono); font-size: .8rem; font-variant-numeric: tabular-nums; }

/* ============================================================
   Seitenkopf & Aufklapp-Abschnitte
   ============================================================ */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head-actions { display: flex; gap: 8px; }
.btn-ghost {
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: .76rem;
  letter-spacing: .04em;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  transition: all .15s ease;
}
.btn-ghost:hover { border-color: var(--accent-hi); background: rgba(160,107,255,.08); color: var(--text); transform: translateY(-1px); }

.disclosure {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  margin: 10px 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.disclosure > summary {
  cursor: pointer;
  padding: 13px 18px;
  font-size: .89rem;
  font-weight: 600;
  color: var(--text-2);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: background .15s ease, color .15s ease;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1;
  color: var(--accent-hi);
  transition: transform .2s ease;
}
.disclosure[open] > summary { color: var(--text); border-bottom: 1px solid var(--border); }
.disclosure[open] > summary::before { transform: rotate(45deg); }
.disclosure > summary:hover { background: rgba(160,107,255,.06); color: var(--text); }
.disclosure-body { padding: 18px; }
.disclosure-body > :first-child { margin-top: 0; }
.disclosure-body > :last-child { margin-bottom: 0; }
.stat.accent { border-color: var(--border-hi); background: linear-gradient(160deg, rgba(160,107,255,.14) 0%, var(--panel) 100%); }
.stat.accent .stat-num { color: var(--accent-hi); }

/* ============================================================
   Profilseite: Kennzahlen, Abschnitte, Notizen
   ============================================================ */
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.profile-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0 4px;
  box-shadow: var(--shadow);
}
.profile-kpis > div {
  background: var(--panel);
  background-image: linear-gradient(168deg, rgba(255,255,255,.028), transparent 42%);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.kpi-num { font-family: var(--font-display); font-size: 1.22rem; font-weight: 800; letter-spacing: -.02em; color: var(--accent-hi); font-variant-numeric: tabular-nums; }
.kpi-label { font-family: var(--font-mono); font-size: .64rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }

.profile-section { margin-top: 30px; }
.profile-section > h3 { margin-bottom: 10px; }

.note-list { display: flex; flex-direction: column; gap: 7px; }
.note-item {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: .86rem;
  color: var(--text-2);
}
.note-item.flag { border-left: 3px solid var(--muted); }
.note-item.warn { border-left: 3px solid var(--warn); }
.research-card {
  background: linear-gradient(150deg, #171029 0%, var(--panel) 60%);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 20px 50px -28px rgba(160,107,255,.4), inset 0 1px 0 rgba(255,255,255,.04);
}
.research-card > p:first-child { font-size: .92rem; color: var(--text); }
.research-facts { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin: 14px 0; }
.research-facts > div { background: var(--panel); padding: 9px 13px; display: grid; grid-template-columns: 130px 1fr; gap: 12px; font-size: .86rem; align-items: baseline; }
.rf-label { color: var(--wire); font-family: var(--font-mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 500; }
@media (max-width: 700px) { .research-facts > div { grid-template-columns: 1fr; gap: 2px; } }

.note-form { display: flex; gap: 8px; flex-wrap: wrap; }
.note-form input[type=text] { flex: 1; min-width: 220px; }
.inline-details { margin-top: 12px; }
.inline-details summary { cursor: pointer; font-family: var(--font-mono); font-size: .8rem; color: var(--wire); }
.inline-details summary:hover { color: var(--accent-hi); }
.inline-details .deal-form { margin-top: 12px; }
.info-box {
  background: var(--ok-dim);
  border: 1px solid rgba(77,225,232,.35);
  color: var(--wire);
  font-family: var(--font-mono);
  font-size: .78rem;
  margin: 0;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
}

.current-user { display: flex; align-items: center; gap: 9px; padding: 9px 4px 12px; border-top: 1px solid var(--border); margin-bottom: 8px; }
.user-avatar {
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--border-hi);
  color: var(--accent-hi);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: .74rem; font-weight: 800;
}
.user-name { font-size: .84rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.note-src { flex-shrink: 0; text-align: right; max-width: 200px; overflow-wrap: anywhere; }
code { background: var(--panel-3); padding: 1px 6px; border-radius: 4px; font-size: .85em; font-family: var(--font-mono); color: var(--accent-hi); }

/* ============================================================
   Nutzbarkeits-Trichter
   ============================================================ */
.funnel { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 22px; }
.funnel-row {
  display: grid;
  grid-template-columns: 220px 1fr 72px;
  grid-template-areas: "label track num" ". note note";
  align-items: center;
  gap: 4px 14px;
}
.funnel-label { grid-area: label; font-size: .88rem; color: var(--text-2); font-weight: 500; }
.funnel-track { grid-area: track; background: var(--panel-2); border: 1px solid var(--border); border-radius: 100px; height: 22px; overflow: hidden; }
.funnel-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent-deep) 0%, var(--accent) 100%);
  box-shadow: 0 0 16px rgba(160,107,255,.45);
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.funnel-fill.final { background: linear-gradient(90deg, rgba(77,225,232,.45) 0%, var(--wire) 100%); box-shadow: 0 0 16px rgba(77,225,232,.45); }
.funnel-num { grid-area: num; text-align: right; font-family: var(--font-display); font-size: .92rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.funnel-note { grid-area: note; font-size: .77rem; line-height: 1.5; }

@media (max-width: 860px) {
  .funnel-row { grid-template-columns: 1fr 68px; grid-template-areas: "label num" "track track" "note note"; }
}

/* ============================================================
   Karten / Schnellzugriff
   ============================================================ */
.quicklinks { display: flex; gap: 12px; flex-wrap: wrap; }
.card-link {
  background: var(--panel);
  background-image: linear-gradient(168deg, rgba(255,255,255,.028), transparent 42%);
  border: 1px solid var(--border);
  padding: 15px 20px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: .9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: all .18s ease;
}
.card-link:hover {
  border-color: var(--border-hi);
  background: var(--panel-2);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 26px 52px -24px rgba(0,0,0,.75), 0 0 26px -8px rgba(160,107,255,.28);
}

/* ============================================================
   Formularelemente
   ============================================================ */
.filter-bar { display: flex; gap: 9px; margin: 18px 0 14px; }
.filter-bar input { flex: 1; }

input[type=text], input[type=password], input[type=date], select, textarea {
  background: #0e0e1a;
  border: 1px solid var(--border-hi);
  color: var(--text);
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-family: var(--font-mono);
  transition: border-color .15s ease, background .15s ease;
}
textarea { font-family: var(--font-body); }
input[type=text]:hover, select:hover, textarea:hover { border-color: rgba(160,107,255,.5); }
input[type=text]:focus, input[type=password]:focus, input[type=date]:focus, select:focus, textarea:focus {
  border-color: var(--wire);
  background: var(--panel-2);
  outline: none;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
select[multiple] { padding: 6px; }
select[multiple] option { padding: 4px 6px; border-radius: 4px; }

button {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #0a0a13;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .04em;
  font-weight: 500;
  box-shadow: 0 6px 20px -6px rgba(160,107,255,.6);
  transition: all .15s ease;
  white-space: nowrap;
}
button:hover { background: var(--accent-hi); border-color: var(--accent-hi); transform: translateY(-1px); box-shadow: 0 10px 26px -6px rgba(160,107,255,.75); }
button:active { transform: translateY(1px); }

fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0; }
legend { color: var(--wire); font-family: var(--font-mono); font-size: .66rem; font-weight: 500; padding: 0 6px; text-transform: uppercase; letter-spacing: .12em; }

/* ============================================================
   Tabellen
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table th {
  text-align: left;
  color: var(--wire);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: 12px 14px;
  background: #0e0e1a;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { cursor: pointer; transition: background .12s ease; }
.data-table tbody tr:hover { background: rgba(160,107,255,.07); }
.data-table tbody tr.muted { opacity: .5; cursor: default; }
.data-table tbody tr.muted:hover { background: none; }
.data-table td:first-child { font-weight: 500; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); }

/* ============================================================
   Badges, Chips, Punkte
   ============================================================ */
.badge {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--border-hi);
  padding: 3px 10px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .08em;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  line-height: 1.7;
}
.badge.warn { background: var(--warn-dim); border-color: rgba(255,171,107,.35); color: var(--warn); }
.badge.person { background: var(--accent-dim); border-color: var(--border-hi); color: var(--accent-hi); }
.badge.tier-klein  { color: var(--muted); }
.badge.tier-mittel { color: var(--accent-hi); border-color: var(--border-hi); }
.badge.tier-groß   { color: var(--wire); background: var(--ok-dim); border-color: rgba(77,225,232,.35); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--border-hi); }
.dot.ok { background: var(--wire); box-shadow: 0 0 8px var(--wire); }

.co-investor-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 4px; }
.co-investor-chip {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 13px;
  font-size: .83rem;
  color: var(--text-2);
  transition: all .15s ease;
}
.co-investor-chip:hover { border-color: var(--accent); background: var(--panel-3); color: var(--text); }

/* ============================================================
   Seitennavigation
   ============================================================ */
.pagination {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 20px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .8rem;
}
.pagination a { font-weight: 500; }

.back-link { display: inline-block; margin-bottom: 14px; font-family: var(--font-mono); font-size: .78rem; letter-spacing: .06em; color: var(--muted); }
.back-link:hover { color: var(--accent-hi); }

.pill-link {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  margin-left: 10px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-2);
  transition: all .15s ease;
}
.pill-link:hover { border-color: var(--accent); color: var(--accent-hi); }

/* ============================================================
   Profil-Raster
   ============================================================ */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 22px 0;
}
.profile-grid > div {
  background: var(--panel);
  background-image: linear-gradient(168deg, rgba(255,255,255,.028), transparent 42%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  position: relative;
}
.profile-grid > div::after {
  content: "";
  position: absolute;
  bottom: 7px; right: 7px;
  width: 8px; height: 8px;
  border: solid var(--border-hi);
  border-width: 0 1px 1px 0;
  opacity: .8;
}
.profile-grid h3 { margin: 0 0 12px; font-family: var(--font-mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .13em; color: var(--wire); font-weight: 500; }
.profile-grid p { font-size: .88rem; margin-bottom: 7px; }
.profile-grid p:last-child { margin-bottom: 0; }

/* ============================================================
   Hinweisboxen
   ============================================================ */
.notice {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 16px 0;
  font-size: .88rem;
  line-height: 1.6;
  color: var(--text-2);
  box-shadow: var(--shadow);
}
.notice strong { color: var(--text); font-weight: 600; }
.notice.warn { border-left-color: var(--warn); }
.notice p:last-child { margin-bottom: 0; }
.research-block .badge { margin-left: 6px; }
.research-block form { margin-top: 10px; }

/* ============================================================
   Taxonomie-Karten
   ============================================================ */
.tax-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.tax-card {
  background: var(--panel);
  background-image: linear-gradient(168deg, rgba(255,255,255,.028), transparent 42%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.tax-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
  box-shadow: 0 26px 52px -24px rgba(0,0,0,.75), 0 0 26px -8px rgba(160,107,255,.28);
}
.tax-card h3 { margin: 0 0 8px; font-size: .94rem; }
.tax-card p { font-size: .86rem; color: var(--text-2); }
.tax-card.behaviour { border-left: 3px solid var(--accent); }
.tax-card-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.tax-hint { background: #0e0e1a; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .82rem !important; margin-top: 10px; }
.tax-hint strong { color: var(--text); }

.axis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin: 20px 0; }
.axis-card {
  background: var(--panel);
  background-image: linear-gradient(168deg, rgba(255,255,255,.028), transparent 42%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.axis-name { font-family: var(--font-mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .13em; color: var(--wire); font-weight: 500; margin-bottom: 10px; }
.axis-poles { display: flex; align-items: center; gap: 10px; font-size: .89rem; font-weight: 600; color: var(--text); margin-bottom: 10px; flex-wrap: wrap; }
.axis-arrow { color: var(--accent); font-size: 1.1rem; }
.axis-card p { margin: 0; }

/* ============================================================
   Kanban-Pipeline
   ============================================================ */
.kanban { display: flex; gap: 13px; overflow-x: auto; margin-top: 20px; padding-bottom: 10px; }
.kanban-col {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px;
  min-width: 236px;
  flex: 1 0 236px;
  box-shadow: var(--shadow);
}
.kanban-col h4 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: .64rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--wire);
  display: flex;
  justify-content: space-between;
}
.kanban-card {
  display: block;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  margin-top: 8px;
  color: var(--text);
  transition: all .16s ease;
}
.kanban-card:hover { border-color: var(--accent); background: var(--panel-3); transform: translateX(2px); box-shadow: 0 0 20px -6px rgba(160,107,255,.35); }
.kanban-card strong { font-size: .89rem; font-weight: 600; display: block; }

.new-deal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 18px 0;
  box-shadow: var(--shadow);
}
.new-deal summary {
  cursor: pointer;
  font-weight: 600;
  font-size: .9rem;
  color: var(--accent-hi);
  list-style: none;
}
.new-deal summary::-webkit-details-marker { display: none; }
.new-deal summary:hover { color: var(--accent); }
.deal-form { display: flex; flex-direction: column; gap: 13px; margin-top: 18px; max-width: 500px; }
.deal-form label { display: flex; flex-direction: column; gap: 5px; font-family: var(--font-mono); font-size: .66rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.deal-form label input, .deal-form label select, .deal-form label textarea { font-weight: 400; text-transform: none; letter-spacing: 0; }
.deal-form button { align-self: flex-start; margin-top: 4px; }
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 3px 14px 3px 0;
  color: var(--text-2);
  font-size: .85rem;
  cursor: pointer;
}
.checkbox-inline:hover { color: var(--text); }

.stage-bar { display: flex; gap: 6px; margin: 18px 0; flex-wrap: wrap; }
.stage-btn { background: var(--panel-2); border-color: var(--border); color: var(--muted); font-weight: 500; box-shadow: none; }
.stage-btn:hover { background: var(--panel-3); border-color: var(--border-hi); color: var(--text-2); box-shadow: none; }
.stage-btn.active { background: var(--accent); border-color: var(--accent); color: #0a0a13; font-weight: 600; box-shadow: 0 6px 20px -6px rgba(160,107,255,.6); }

.inline-form { display: inline-flex; gap: 7px; align-items: center; }
.inline-form select { padding: 6px 10px; font-size: .82rem; }
.inline-form button { padding: 7px 13px; font-size: .74rem; }

.timeline { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.timeline-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 15px;
  font-size: .87rem;
  color: var(--text-2);
}
.timeline-item strong { color: var(--text); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ============================================================
   Login — Hero-Anmutung wie auf rkx-consulting.de
   ============================================================ */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 55% at 50% 12%, rgba(160,107,255,.16), transparent 70%),
    var(--bg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
/* Leiterbahn-Muster im Hintergrund */
.login-body::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cg fill='none' stroke='%23a06bff' stroke-width='1' opacity='.5'%3E%3Cpath d='M0 24 H36 L48 36 V78 L60 90 H140'/%3E%3Cpath d='M24 0 V32 L36 44 H96 L108 56 V140'/%3E%3Cpath d='M140 100 H108 L96 112 V140'/%3E%3Ccircle cx='48' cy='36' r='2.6' fill='%23a06bff'/%3E%3Ccircle cx='108' cy='56' r='2.6' fill='%23a06bff'/%3E%3Ccircle cx='96' cy='112' r='2.6' fill='%23a06bff'/%3E%3C/g%3E%3C/svg%3E");
  opacity: .22;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 50%, #000, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 50%, #000, transparent 78%);
  pointer-events: none;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 36px 34px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}
/* Blueprint-Eckmarken */
.login-card::before, .login-card::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  border-color: var(--border-hi);
  border-style: solid;
}
.login-card::before { top: 9px; left: 9px; border-width: 1px 0 0 1px; }
.login-card::after { bottom: 9px; right: 9px; border-width: 0 1px 1px 0; }
.login-card .brand { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; letter-spacing: .01em; margin-bottom: 2px; }
.login-card .brand span { font-family: var(--font-mono); color: var(--accent); font-weight: 500; font-size: .78rem; letter-spacing: .08em; }
.login-card p.muted { font-size: .82rem; line-height: 1.55; margin-bottom: 6px; }
.login-card .error {
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: .78rem;
  margin: 0;
  padding: 9px 13px;
  background: rgba(255,122,122,.1);
  border: 1px solid rgba(255,122,122,.25);
  border-radius: var(--radius-sm);
}
.login-card input { padding: 12px 13px; }
.login-card button { padding: 12px; margin-top: 2px; }

/* ============================================================
   Responsiv
   ============================================================ */
@media (max-width: 1100px) {
  .filters-col { width: 190px; padding: 22px 14px; }
  .content { padding: 28px 26px 56px; }
  .tax-bar-row { grid-template-columns: 180px 1fr 42px; }
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center; gap: 16px;
    padding: 12px 16px; border-right: none; border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .sidebar .brand { margin-bottom: 0; }
  .sidebar nav { flex-direction: row; gap: 14px; align-items: center; }
  .nav-group { flex-direction: row; gap: 4px; align-items: center; }
  .nav-group-label { display: none; }
  .sidebar nav a.active::before { display: none; }
  .logout-form { margin-top: 0; margin-left: auto; }
  .logout-form button { width: auto; padding: 8px 14px; }
  .filters-col { width: 100%; max-height: none; position: static; border-right: none; border-bottom: 1px solid var(--border); }
  .content { padding: 22px 18px 48px; }
  .tax-bar-row { grid-template-columns: 1fr 60px; }
  .tax-bar-track { grid-column: 1 / -1; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; }
}

/* ============================================================
   RKX-Design v2 — gleiche Optik wie die Website (Oktober 2026)
   Lila bleibt, wird markanter: tiefere Flächen, weiche Verläufe,
   Pillen-Buttons, ruhige Glows, Leiterbahn-Ecke oben links.
   Identisch in Invesco und im Kundenbereich. Nur Bildschirm —
   die Druckansichten bleiben unberührt.
   ============================================================ */
@media screen {
  :root {
    --bg:          #08070f;
    --panel:       #14122a;
    --panel-2:     #1b1838;
    --panel-3:     #252148;
    --border:      rgba(169,107,255,.2);
    --border-hi:   rgba(169,107,255,.42);
    --text:        #f6f3ff;
    --text-2:      #bdb7d6;
    --muted:       #8a84a8;
    --accent:      #a96bff;
    --accent-hi:   #d3b8ff;
    --accent-deep: #5a3aa0;
    --accent-dim:  rgba(169,107,255,.14);
    --radius:      18px;
    --radius-sm:   12px;
    --surface:     linear-gradient(165deg, rgba(30,25,66,.88), rgba(18,16,40,.92));
    --shadow:      0 18px 44px -26px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.035);
    --shadow-lg:   0 34px 80px -40px rgba(169,107,255,.6);
  }

  body {
    background:
      radial-gradient(900px 620px at 94% -8%, rgba(169,107,255,.15), transparent 62%),
      radial-gradient(760px 560px at 18% 112%, rgba(77,225,232,.05), transparent 62%),
      var(--bg);
    background-attachment: fixed;
  }
  h1 { font-weight: 800; letter-spacing: -.025em; }
  h2 { letter-spacing: -.015em; }
  a:hover { color: #fff; }

  /* ---------- Leiterbahn-Ecke oben links im Inhalt ---------- */
  .content {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='300'%3E%3Cdefs%3E%3ClinearGradient id='f' gradientUnits='userSpaceOnUse' x1='0' y1='0' x2='420' y2='260'%3E%3Cstop offset='0' stop-color='%23a96bff' stop-opacity='.38'/%3E%3Cstop offset='1' stop-color='%23a96bff' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke='url(%23f)' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0 40 H90 L110 60 V120 L126 136 H260'/%3E%3Cpath d='M40 0 V36 L56 52 H170 L186 68 V160'/%3E%3Cpath d='M0 150 H48 L64 166 V230'/%3E%3Cpath d='M210 0 V20 L226 36 H360'/%3E%3C/g%3E%3Cg fill='url(%23f)'%3E%3Ccircle cx='110' cy='60' r='3'/%3E%3Ccircle cx='126' cy='136' r='3'/%3E%3Ccircle cx='56' cy='52' r='3'/%3E%3Ccircle cx='186' cy='68' r='3'/%3E%3Ccircle cx='64' cy='166' r='3'/%3E%3Ccircle cx='226' cy='36' r='3'/%3E%3C/g%3E%3Ccircle cx='170' cy='52' r='3' fill='%234de1e8' opacity='.55'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0 0;
  }

  /* ---------- Seitenleiste ---------- */
  .sidebar {
    background: linear-gradient(180deg, rgba(27,22,60,.95) 0%, rgba(9,8,18,.98) 100%);
    border-right-color: var(--border);
  }
  .sidebar nav a { border-radius: 12px; }
  .sidebar nav a:hover { background: rgba(169,107,255,.1); }
  .sidebar nav a.active {
    background: linear-gradient(135deg, rgba(169,107,255,.28), rgba(169,107,255,.08));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(169,107,255,.32), 0 10px 24px -14px rgba(169,107,255,.85);
  }

  /* ---------- Flächen: weiche Verläufe statt flacher Kästen ---------- */
  .stat, .card-link, .disclosure, .notice, .info-box, .new-deal,
  .profile-kpis > div, .profile-grid > div, .research-facts > div,
  .tax-card, .axis-card, .kanban-col, .kanban-card, .note-item, .timeline-item,
  .mandate-card, .mandate-row, .method-card, .doc-item, .report-card, .run-card,
  .course-card, .lesson-row, .todo-item, .msg, .invoice-meta, .invoice-sum, .notif {
    background: var(--surface);
    border-color: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
  .kanban-card, .note-item, .timeline-item, .doc-item, .lesson-row, .todo-item, .msg, .notif { border-radius: 14px; }
  .stat:hover, .card-link:hover, .mandate-card:hover, .mandate-row:hover, .tax-card:hover,
  .kanban-card:hover, .doc-item:not(.no-link):hover, .lesson-row:hover, .todo-item:hover, .report-card:hover, .course-card:hover {
    background: linear-gradient(165deg, rgba(40,31,86,.92), rgba(20,17,46,.94));
    border-color: var(--border-hi);
    box-shadow: 0 26px 56px -28px rgba(169,107,255,.6), inset 0 1px 0 rgba(255,255,255,.05);
  }
  .notif.anfrage { background: linear-gradient(150deg, rgba(15,40,46,.92), rgba(18,16,40,.92)); }

  /* Kennzahlen wie auf der Website: weiße, kräftige Zahlen, keine Eckmarken */
  .stat::before { display: none; }
  .stat-num { color: #fff; }
  .stat.accent { border-color: var(--border-hi); background: linear-gradient(165deg, rgba(48,33,104,.92), rgba(20,17,46,.94)); }
  .stat.accent .stat-num { color: var(--accent-hi); }
  .mandate-card::after { display: none; }

  /* ---------- Buttons: Pillenform, Verlauf ---------- */
  button {
    border-radius: 999px;
    background: linear-gradient(180deg, #b57dff, #9a55ff);
    border-color: transparent;
    color: #0b0816;
    font-weight: 600;
    padding: 11px 20px;
    box-shadow: 0 10px 28px -12px rgba(169,107,255,.85), inset 0 1px 0 rgba(255,255,255,.3);
  }
  button:hover {
    background: linear-gradient(180deg, #c597ff, #a764ff);
    border-color: transparent;
    box-shadow: 0 14px 34px -12px rgba(169,107,255,1), inset 0 1px 0 rgba(255,255,255,.4);
  }
  .btn-ghost, .pill-link, .tab, .stage-btn, .tpl-chip, .co-investor-chip {
    border-radius: 999px;
  }
  .btn-ghost { border-color: var(--border-hi); background: rgba(169,107,255,.06); box-shadow: none; }
  .btn-ghost:hover { border-color: var(--accent-hi); background: rgba(169,107,255,.14); color: #fff; }
  .logout-form button, .method-card .btn-ghost, .notif-actions .btn-ghost, .lesson-nav .btn-ghost {
    background: transparent; color: var(--text-2); box-shadow: none; border: 1px solid var(--border-hi);
  }
  .logout-form button:hover { color: #fff; background: rgba(169,107,255,.12); }
  .tab.active, .stage-btn.active {
    background: linear-gradient(135deg, rgba(169,107,255,.3), rgba(169,107,255,.1));
    color: #fff; border-color: var(--border-hi);
  }

  /* ---------- Formulare ---------- */
  input[type=text], input[type=password], input[type=date], input[type=email], input[type=number], select, textarea {
    border-radius: 12px;
    background: rgba(13,12,28,.9);
    border-color: var(--border);
  }
  input[type=text]:focus, input[type=password]:focus, input[type=date]:focus, input[type=email]:focus,
  input[type=number]:focus, select:focus, textarea:focus {
    background: rgba(20,18,42,.95);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(169,107,255,.18);
  }

  /* ---------- Tabellen ---------- */
  .data-table { background: var(--surface); border-color: var(--border); border-radius: var(--radius); }
  .data-table th { background: rgba(169,107,255,.08); }
  .data-table tbody tr:hover { background: rgba(169,107,255,.09); }

  /* ---------- Pillen, Badges ---------- */
  .badge, .pill { border-radius: 999px; }

  /* ---------- Anmeldung ---------- */
  .login-body {
    background:
      radial-gradient(ellipse 60% 50% at 50% 100%, rgba(190,150,255,.2), transparent 70%),
      radial-gradient(ellipse 70% 55% at 50% 0%, rgba(169,107,255,.14), transparent 70%),
      var(--bg);
  }
  .login-body::before { opacity: .26; }
  .login-card {
    background: radial-gradient(420px 220px at 80% 0%, rgba(169,107,255,.22), transparent 70%), var(--surface);
    border-radius: 24px;
    border-color: var(--border-hi);
    box-shadow: 0 40px 90px -40px rgba(169,107,255,.75), inset 0 1px 0 rgba(255,255,255,.05);
  }
  .login-card::before, .login-card::after { display: none; }
}
