/* R&B Pay EVA — Design-System der Website (Poppins, Lila #6027A6, Stripe-Look,
   keine Gradients, weiche Glows, große Radien) */

@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/poppins-400.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/poppins-500.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/poppins-600.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/poppins-700.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/poppins-800.woff2') format('woff2'); }

:root {
  --lila: #6027A6;
  --lila2: #4A148C;
  --ink: #0d0613;
  --bg: #f6f3fb;
  --soft: #efe7f8;
  --line: rgba(96, 39, 166, .14);
  --tsoft: rgba(0, 0, 0, .62);
  --weiss: #ffffff;
  --gruen: #1c7c4a;
  --gruen-soft: #e2f3e9;
  --rot: #b3261e;
  --rot-soft: #fbe9e7;
  --amber: #9a6b00;
  --amber-soft: #fff3d6;
  --blau: #1b5fa8;
  --blau-soft: #e7f0fb;
  --shadow: 0 10px 30px rgba(13, 6, 19, .08);
  --shadow-lg: 0 24px 60px rgba(13, 6, 19, .16);
  --sidebar-w: 244px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--lila) var(--soft); }
body {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--lila); border-radius: 999px; }
::-webkit-scrollbar-track { background: var(--soft); }

button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--lila); text-decoration: none; }
[hidden] { display: none !important; }
svg { flex-shrink: 0; }

h1, h2, h3 { letter-spacing: -.03em; line-height: 1.15; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Login ---------- */

#login-view {
  position: fixed; inset: 0; z-index: 50;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow: hidden;
}
.login-glow {
  position: absolute; border-radius: 50%;
  background: var(--lila); filter: blur(110px); opacity: .4;
  pointer-events: none;
}
.login-glow.g1 { width: 480px; height: 480px; top: -160px; left: -120px; }
.login-glow.g2 { width: 420px; height: 420px; bottom: -180px; right: -100px; opacity: .3; }

.login-card {
  position: relative; z-index: 2;
  background: var(--weiss);
  border-radius: 30px;
  box-shadow: var(--shadow-lg);
  padding: 44px 40px 36px;
  width: 100%; max-width: 420px;
  animation: cardUp .55s cubic-bezier(.22, .8, .3, 1) both;
}
@keyframes cardUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
/* Ganzkörper-Bieber wie im Website-Footer, unten links am Bildschirmrand (CSS-Crop) */
.login-biber {
  position: fixed; left: 0; bottom: 0; z-index: 1;
  width: 210px; height: 300px;
  background: url('biber-full.png') left bottom / auto 100% no-repeat;
  pointer-events: none; user-select: none;
  animation: biberUp .7s cubic-bezier(.22, .8, .3, 1) both;
}
@keyframes biberUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@media (max-width: 720px) { .login-biber { width: 132px; height: 190px; opacity: .9; } }
@media (max-height: 620px) { .login-biber { display: none; } }
.login-logo { height: 34px; display: block; margin: 0 auto 6px; }
.login-sub {
  text-align: center; color: var(--tsoft);
  font-size: 13.5px; margin-bottom: 26px; font-weight: 500;
}
.login-sub strong { color: var(--lila); font-weight: 700; }
.login-card h1 { font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 4px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--tsoft); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  background: var(--bg);
  border-radius: 12px;
  padding: 11px 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--lila);
  box-shadow: 0 0 0 4px rgba(96, 39, 166, .12);
  background: var(--weiss);
}
.field textarea { resize: vertical; min-height: 90px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--lila); color: #fff;
  font-weight: 600; font-size: 14.5px;
  border-radius: 12px; padding: 11px 20px;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { background: var(--lila2); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(96, 39, 166, .3); }
.btn:disabled { opacity: .6; pointer-events: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--soft); color: var(--lila); }
.btn.ghost:hover { background: var(--line); box-shadow: none; }
.btn.danger { background: var(--rot-soft); color: var(--rot); }
.btn.danger:hover { background: var(--rot); color: #fff; box-shadow: none; }
.btn.mini { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn.icon { padding: 8px; border-radius: 10px; }

.login-error {
  background: var(--rot-soft); color: var(--rot);
  border-radius: 12px; padding: 10px 14px;
  font-size: 13.5px; font-weight: 500; margin-bottom: 14px;
}
.login-foot { text-align: center; margin-top: 18px; font-size: 12px; color: var(--tsoft); }

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

#app-view { min-height: 100vh; }

#sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--ink);
  color: #fff;
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
  z-index: 30;
}
.side-logo { height: 26px; margin: 2px 10px 6px; filter: brightness(0) invert(1); align-self: flex-start; }
.side-sub { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.45); margin: 0 10px 22px; font-weight: 600; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  color: rgba(255, 255, 255, .72);
  font-weight: 500; font-size: 14.5px;
  padding: 11px 12px; border-radius: 12px;
  transition: background .15s, color .15s;
  text-align: left; width: 100%;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active { background: var(--lila); color: #fff; font-weight: 600; }
.nav-item .badge-n {
  margin-left: auto;
  background: var(--rot); color: #fff;
  font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 1px 7px;
}
.side-user {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-top: 14px; margin-top: 14px;
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--lila); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; overflow: hidden; flex-shrink: 0;
}
.avatar.has-img { background: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.big { width: 84px; height: 84px; border-radius: 22px; font-size: 30px; }
.side-user .who { flex: 1; min-width: 0; }
.side-user .who b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who span { font-size: 11.5px; color: rgba(255, 255, 255, .5); }
.side-user button { color: rgba(255, 255, 255, .6); padding: 8px; border-radius: 10px; }
.side-user button:hover { background: rgba(255, 255, 255, .08); color: #fff; }

#content { margin-left: var(--sidebar-w); padding: 26px 34px 60px; max-width: 1240px; }

#topbar {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px; flex-wrap: wrap;
}
#topbar h1 { font-size: 26px; font-weight: 800; flex: 1; }
#topbar .sub { width: 100%; color: var(--tsoft); font-size: 13.5px; margin-top: -6px; }

/* ---------- Karten & Bausteine ---------- */

.card {
  background: var(--weiss);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 20px 22px;
  border: 1px solid rgba(96, 39, 166, .06);
}
.card + .card, .section + .section { margin-top: 18px; }
.card h2 {
  font-size: 15.5px; font-weight: 700;
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 14px;
}
.card h2 .count { color: var(--tsoft); font-weight: 600; font-size: 13px; }
.card h2 svg { color: var(--lila); }

.kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 18px;
}
.kpi {
  background: var(--weiss); border-radius: 18px;
  box-shadow: var(--shadow); border: 1px solid rgba(96, 39, 166, .06);
  padding: 16px 18px;
}
.kpi .n { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.kpi .l { font-size: 12.5px; color: var(--tsoft); font-weight: 500; margin-top: 2px; }
.kpi .x { font-size: 11.5px; color: var(--lila); font-weight: 600; margin-top: 2px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  border-radius: 999px; padding: 3px 10px;
  background: var(--soft); color: var(--lila);
  white-space: nowrap;
}
.chip.gruen { background: var(--gruen-soft); color: var(--gruen); }
.chip.rot { background: var(--rot-soft); color: var(--rot); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.blau { background: var(--blau-soft); color: var(--blau); }
.chip.ink { background: var(--ink); color: #fff; }

/* Zeilen-Listen (Wiedervorlagen, Leads, Anlässe …) */
.row-list { display: flex; flex-direction: column; }
.rowi {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line);
}
.rowi:last-child { border-bottom: 0; }
.rowi .grow { flex: 1; min-width: 0; }
.rowi .t { font-weight: 600; font-size: 14px; }
.rowi .t a { color: inherit; }
.rowi .t a:hover { color: var(--lila); }
.rowi .s { font-size: 12.5px; color: var(--tsoft); margin-top: 1px; }
.rowi .datechip {
  font-size: 12px; font-weight: 700; color: var(--lila);
  background: var(--soft); border-radius: 10px;
  padding: 6px 10px; text-align: center; min-width: 62px;
}
.rowi.late .datechip { background: var(--rot-soft); color: var(--rot); }
.rowi .acts { display: flex; gap: 6px; }
.rowi .acts button {
  padding: 7px; border-radius: 10px; color: var(--tsoft);
  transition: background .15s, color .15s;
}
.rowi .acts button:hover { background: var(--soft); color: var(--lila); }
.rowi .acts button.ok:hover { background: var(--gruen-soft); color: var(--gruen); }
.rowi .acts button.del:hover { background: var(--rot-soft); color: var(--rot); }

.empty {
  text-align: center; color: var(--tsoft);
  padding: 26px 10px; font-size: 13.5px;
}
.empty svg { display: block; margin: 0 auto 8px; color: var(--line); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

/* ---------- Tabellen ---------- */

.tablewrap { overflow-x: auto; }
table.liste { width: 100%; border-collapse: collapse; }
table.liste th {
  text-align: left; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--tsoft); padding: 8px 10px;
  border-bottom: 1.5px solid var(--line);
  white-space: nowrap;
}
table.liste td { padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
table.liste tr:last-child td { border-bottom: 0; }
table.liste tbody tr { cursor: pointer; transition: background .12s; }
table.liste tbody tr:hover { background: var(--bg); }
td .prim { font-weight: 600; }
td .sec { font-size: 12.5px; color: var(--tsoft); }

/* ---------- Filterleiste ---------- */

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--weiss); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 9px 13px; flex: 1; min-width: 200px; max-width: 380px;
}
.search:focus-within { border-color: var(--lila); box-shadow: 0 0 0 4px rgba(96, 39, 166, .12); }
.search input { border: 0; outline: none; background: none; width: 100%; }
.search svg { color: var(--tsoft); }
.filters select {
  background: var(--weiss); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 9px 12px; outline: none;
}

/* ---------- Kunden-Detail ---------- */

.k-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.k-head .k-title { flex: 1; min-width: 240px; }
.k-head h1 { font-size: 24px; font-weight: 800; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.k-head .meta { color: var(--tsoft); font-size: 13.5px; margin-top: 5px; display: flex; gap: 14px; flex-wrap: wrap; }
.k-head .meta span { display: inline-flex; align-items: center; gap: 5px; }

.actionbar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.actionbar .btn.ghost { font-size: 13px; padding: 9px 13px; }

.info-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.info-it { background: var(--bg); border-radius: 14px; padding: 11px 14px; }
.info-it .l { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--tsoft); }
.info-it .v { font-weight: 600; font-size: 14px; margin-top: 3px; word-break: break-word; }
.info-it .v a { color: var(--lila); }
.info-it.gold { background: var(--amber-soft); }
.info-it.gold .v { color: var(--amber); }

.notes { white-space: pre-wrap; color: var(--ink); font-size: 14px; line-height: 1.55; }

/* Timeline */
.timeline { display: flex; flex-direction: column; }
.tl-it { display: flex; gap: 13px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.tl-it:last-child { border-bottom: 0; }
.tl-ic {
  width: 34px; height: 34px; border-radius: 11px;
  background: var(--soft); color: var(--lila);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tl-it.win .tl-ic { background: var(--gruen-soft); color: var(--gruen); }
.tl-body { flex: 1; min-width: 0; }
.tl-body .h { font-size: 13.5px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tl-body .h .when { font-weight: 500; color: var(--tsoft); font-size: 12px; margin-left: auto; }
.tl-body .tx { font-size: 13.5px; color: var(--tsoft); margin-top: 2px; white-space: pre-wrap; }

/* ---------- Pipeline (Kanban) ---------- */

.kanban {
  display: flex; gap: 14px; align-items: flex-start;
  overflow-x: auto; padding-bottom: 14px;
}
.kcol {
  background: var(--soft); border-radius: 18px;
  padding: 12px; min-width: 236px; width: 236px; flex-shrink: 0;
}
.kcol h3 {
  font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--lila2); padding: 2px 6px 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.kcol h3 .n { background: var(--weiss); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; }
.kcol.drag-over { outline: 2px dashed var(--lila); outline-offset: -4px; }
.kcards { display: flex; flex-direction: column; gap: 8px; min-height: 30px; }
.kcard {
  background: var(--weiss); border-radius: 14px;
  padding: 11px 13px; box-shadow: var(--shadow);
  cursor: grab; border: 1px solid rgba(96, 39, 166, .06);
  transition: transform .12s, box-shadow .12s;
}
.kcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kcard.dragging { opacity: .45; }
.kcard .f { font-weight: 600; font-size: 13.5px; }
.kcard .m { font-size: 12px; color: var(--tsoft); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Auswertung ---------- */

.bar-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.bar-row .bl { width: 150px; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.bar-row .bt { flex: 1; background: var(--bg); border-radius: 999px; height: 22px; overflow: hidden; }
.bar-row .bf { background: var(--lila); height: 100%; border-radius: 999px; min-width: 2px; }
.bar-row.gruen .bf { background: var(--gruen); }
.bar-row.rot .bf { background: var(--rot); }
.bar-row .bn { width: 46px; text-align: right; font-size: 13px; font-weight: 700; flex-shrink: 0; }

/* ---------- Modal & Toast ---------- */

#modal-root .overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(13, 6, 19, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  animation: fadeIn .18s both;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: var(--weiss); border-radius: 24px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 620px;
  max-height: calc(100vh - 40px); overflow-y: auto;
  padding: 30px 32px 24px;
  animation: cardUp .3s cubic-bezier(.22, .8, .3, 1) both;
}
.modal.small { max-width: 440px; }
/* Große Formulare (Kunde anlegen) auf dem PC breiter und luftiger */
.modal.big { max-width: 820px; padding: 34px 38px 26px; }
.modal.big .form-grid { gap: 4px 22px; }
.modal.big .field { margin-bottom: 16px; }
.hint { font-size: 11.5px; color: var(--lila); font-weight: 600; margin-top: 5px; }
.modal h2 { font-size: 19px; font-weight: 800; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.modal h2 svg { color: var(--lila); }
.modal .m-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-sect {
  grid-column: 1 / -1;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--lila); border-top: 1px solid var(--line);
  padding-top: 14px; margin: 6px 0 10px;
}
.form-err { background: var(--rot-soft); color: var(--rot); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 12px; }
.quickpick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.quickpick button {
  background: var(--soft); color: var(--lila);
  font-size: 12px; font-weight: 600;
  border-radius: 999px; padding: 4px 11px;
}
.quickpick button:hover, .quickpick button.on { background: var(--lila); color: #fff; }

#toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink); color: #fff;
  border-radius: 14px; padding: 12px 20px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: cardUp .25s both;
  display: flex; align-items: center; gap: 9px;
}
.toast svg { color: #9ef0bf; }
.toast.err svg { color: #ffb3ab; }

/* ---------- Mobile ---------- */

#bottomnav { display: none; }
#mobiletop { display: none; }

@media (max-width: 900px) {
  #sidebar { display: none; }
  #content { margin-left: 0; padding: 14px 14px 96px; }
  #topbar h1 { font-size: 21px; }

  #mobiletop {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 25;
    background: var(--ink); color: #fff;
    margin: -14px -14px 16px; padding: 13px 16px;
  }
  #mobiletop img { height: 20px; filter: brightness(0) invert(1); }
  #mobiletop .mt-sub { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.5); font-weight: 600; margin-left: auto; }

  #bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: var(--ink);
    padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  #bottomnav button {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: rgba(255, 255, 255, .6); font-size: 10px; font-weight: 600;
    padding: 7px 10px; border-radius: 12px; position: relative; min-width: 58px;
  }
  #bottomnav button.active { color: #fff; background: var(--lila); }
  #bottomnav .badge-n {
    position: absolute; top: 2px; right: 8px;
    background: var(--rot); color: #fff;
    font-size: 9.5px; font-weight: 700;
    border-radius: 999px; padding: 0 5px; min-width: 15px; line-height: 15px;
  }

  .kpi-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .n { font-size: 21px; }
  .grid2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { padding: 20px 18px 16px; border-radius: 20px; }
  #modal-root .overlay { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 22px 22px 0 0; max-height: 92vh; }
  .card { padding: 16px; border-radius: 16px; }
  .rowi .acts button { padding: 9px; }
  .kcol { min-width: 218px; width: 218px; }
  .login-card { padding: 34px 22px 26px; }
}

/* Mehr-Menü (mobiles Sheet) */
.sheet { display: flex; flex-direction: column; gap: 4px; }
.sheet button {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 12px; border-radius: 12px;
  font-weight: 600; font-size: 15px; text-align: left;
}
.sheet button:hover { background: var(--soft); color: var(--lila); }
.sheet button svg { color: var(--lila); }
.sheet button.out { color: var(--rot); }
.sheet button.out svg { color: var(--rot); }

/* ================= Modus-Umschalter (NOVA ↔ Analytic) ================= */
.side-brand { display: flex; flex-direction: column; }
.mode-switch {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 16px; padding: 10px 12px; margin-bottom: 20px;
  transition: background .16s, border-color .16s;
}
.mode-switch:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255,255,255,.16); }
.mode-switch .ms-logo { background: #fff; border-radius: 9px; padding: 5px 7px; display: flex; }
.mode-switch .ms-logo img { height: 15px; display: block; }
.mode-switch .ms-names { flex: 1; display: flex; flex-direction: column; line-height: 1.05; }
.mode-switch .ms-name { font-size: 15px; font-weight: 700; color: rgba(255, 255, 255, .38); transition: color .16s; }
.mode-switch .ms-name.on { color: #fff; }
.mode-switch .ms-name[data-mode="analytic"] { font-size: 11.5px; font-weight: 600; }
.mode-switch .ms-name[data-mode="analytic"].on { color: #d9b8ff; }
.mode-switch .ms-arrow { width: 22px; height: 22px; border-radius: 7px; background: var(--lila); position: relative; flex-shrink: 0; }
.mode-switch .ms-arrow::before, .mode-switch .ms-arrow::after {
  content: ''; position: absolute; left: 50%; width: 8px; height: 2px; background: #fff; border-radius: 2px;
}
.mode-switch .ms-arrow::before { top: 8px; transform: translateX(-50%) rotate(35deg); }
.mode-switch .ms-arrow::after { top: 12px; transform: translateX(-50%) rotate(-35deg); }
body.is-analytic #sidebar { background: #17102a; }

.mt-mode {
  margin-left: auto; background: var(--lila); color: #fff;
  font-size: 12px; font-weight: 700; border-radius: 999px; padding: 5px 12px;
}

/* ================= Pipeline (neu, ohne Slider) ================= */
.pipe-overview {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px;
}
.pipe-stat { text-align: center; cursor: pointer; border-radius: 12px; padding: 8px 4px; transition: background .14s; }
.pipe-stat:hover { background: var(--bg); }
.pipe-stat .pn { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.pipe-stat .pl { font-size: 11.5px; color: var(--tsoft); font-weight: 600; margin: 1px 0 7px; }
.pipe-stat .pbar { background: var(--bg); border-radius: 999px; height: 5px; overflow: hidden; }
.pipe-stat .pbar i { display: block; height: 100%; background: var(--lila); border-radius: 999px; }

.pipe-stage .pipe-head { cursor: pointer; user-select: none; margin-bottom: 12px; }
.pipe-stage .pipe-head .chev { transition: transform .18s; display: inline-flex; transform: rotate(90deg); color: var(--lila); }
.pipe-stage.collapsed .pipe-head { margin-bottom: 0; }
.pipe-stage.collapsed .pipe-head .chev { transform: rotate(0deg); }
.pipe-stage.collapsed .pipe-body { display: none; }
.pipe-body { display: flex; flex-direction: column; }
.pipe-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 6px; border-bottom: 1px solid var(--line); cursor: pointer;
  transition: background .12s;
}
.pipe-row:last-child { border-bottom: 0; }
.pipe-row:hover { background: var(--bg); }
.pipe-row .grow { flex: 1; min-width: 0; }
.pipe-row .t { font-weight: 600; font-size: 14px; }
.pipe-row .t .muted { font-weight: 500; color: var(--tsoft); }
.pipe-row .s { font-size: 12.5px; color: var(--tsoft); margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pipe-move { display: flex; gap: 6px; flex-shrink: 0; }
.pipe-move .btn.mini { padding: 7px 11px; }

/* ================= Analytics-Modus ================= */
.demo-banner {
  display: flex; align-items: center; gap: 9px;
  background: var(--amber-soft); color: var(--amber);
  border-radius: 14px; padding: 11px 16px; font-size: 13px; font-weight: 600;
  margin-bottom: 18px;
}
.kpi-row.an { margin-bottom: 14px; }
.an-kpi .head { display: flex; justify-content: space-between; align-items: flex-start; }
.an-kpi .l { color: var(--tsoft); font-weight: 600; font-size: 12.5px; }
.an-kpi .n { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; }
.an-kpi .x { font-size: 12.5px; font-weight: 600; margin-top: 5px; color: var(--tsoft); }
.an-kpi .x.up { color: var(--gruen); }
.an-kpi .x.down { color: var(--rot); }
.an-ic { width: 34px; height: 34px; border-radius: 11px; background: var(--soft); color: var(--lila); display: flex; align-items: center; justify-content: center; }
.grid.an-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
.grid.an-2 > .card:only-child { grid-column: 1 / -1; }
.chart { width: 100%; height: auto; display: block; }
.an-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; font-weight: 600; color: var(--tsoft); }
.an-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 7px; vertical-align: middle; }

/* ================= Funnel + Donut (Auswertung/Analytics) ================= */
.funnel { display: flex; flex-direction: column; gap: 8px; }
.fn-row { display: flex; align-items: center; gap: 12px; }
.fn-bar {
  background: var(--lila); color: #fff; border-radius: 10px;
  min-width: 62px; padding: 9px 12px; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; transition: width .5s cubic-bezier(.4,0,.2,1);
}
.fn-row.win .fn-bar { background: var(--gruen); }
.fn-n { font-weight: 800; font-size: 15px; width: 40px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-svg { width: 150px; height: 150px; flex-shrink: 0; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; font-weight: 600; }
.donut-legend i { width: 11px; height: 11px; border-radius: 4px; display: inline-block; margin-right: 8px; vertical-align: middle; }
.donut-legend b { margin-left: 4px; }

/* ================= Profil (Einstellungen) ================= */
.profile-row { display: flex; gap: 16px; align-items: center; }
.profile-name { font-size: 18px; font-weight: 800; }
.profile-user { font-size: 13px; color: var(--tsoft); margin-top: 2px; }
.profile-btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ================= Schnellsuche ================= */
.qs-wrap { display: flex; flex-direction: column; }
.search.qs-input { max-width: none; margin-bottom: 6px; }
.search.qs-input input { font-size: 16px; }
#qs-res { max-height: 340px; overflow-y: auto; }
.qs-hint { font-size: 11.5px; color: var(--tsoft); margin-top: 8px; text-align: center; }

@media (max-width: 900px) {
  .pipe-overview { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .pipe-stat .pn { font-size: 20px; }
  .grid.an-2 { grid-template-columns: 1fr; }
  .kpi-row.an { grid-template-columns: 1fr 1fr; }
}
