/* Kideon CRM: klickbare Pipeline im Hero (/ und /crm/).
   Nachbau der Pipeline der Demo-Kanzlei „Mertens & Weigel" (erfundene Daten).
   Breite Rahmen: feste Designgröße 1280 × 800, per transform skaliert.
   Schmale Rahmen: nur die Pipeline, Spalten seitlich wischen. */

.cd { position: relative; overflow: hidden; background: #f7f6f3; color: #0f2137; font-family: 'DM Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; text-align: left; line-height: 1.4; }
.cd * { box-sizing: border-box; margin: 0; padding: 0; }
.cd.is-wide { aspect-ratio: 16 / 10; }
.cd-app { position: absolute; left: 0; top: 0; width: 1280px; height: 800px; display: grid; grid-template-columns: 208px 1fr; transform-origin: 0 0; }
.cd.is-narrow .cd-app { position: relative; width: auto; height: auto; display: block; transform: none !important; }

/* Seitenleiste */
.cd-side { background: #0f2137; color: rgba(244,241,236,.72); display: flex; flex-direction: column; padding: 14px 10px; font-size: 13px; }
.cd-brand { display: flex; align-items: center; gap: 9px; padding: 2px 4px 14px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 10px; }
.cd-brand i { width: 30px; height: 30px; border-radius: 8px; background: #c49a6c; color: #0f2137; display: grid; place-items: center; font-style: normal; font-family: 'Instrument Serif', Georgia, serif; font-size: 18px; }
.cd-brand b { display: block; color: #f4f1ec; font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-size: 15px; }
.cd-brand b small { font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: .12em; color: #c49a6c; margin-left: 4px; }
.cd-brand span { font-size: 11px; color: rgba(244,241,236,.6); }
.cd-sec { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; letter-spacing: .16em; text-transform: uppercase; color: rgba(244,241,236,.42); padding: 10px 8px 6px; }
.cd-nav { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border-radius: 7px; border: 1px solid transparent; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background-color .2s, color .2s; }
.cd-nav svg { width: 15px; height: 15px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cd-nav:hover { background: rgba(255,255,255,.05); color: #f4f1ec; }
.cd-nav.is { background: rgba(255,255,255,.08); border-color: rgba(196,154,108,.5); color: #f4f1ec; }
.cd-nav:focus-visible { outline: 2px solid #c49a6c; outline-offset: 1px; }
.cd-nav[disabled] { cursor: default; opacity: .55; }
.cd-nav[disabled]:hover { background: none; color: inherit; }
.cd-user { margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 10px 6px 2px; border-top: 1px solid rgba(255,255,255,.08); }
.cd-user i { width: 28px; height: 28px; border-radius: 50%; background: #1a3352; color: #f4f1ec; display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 600; }
.cd-user b { display: block; color: #f4f1ec; font-size: 12px; font-weight: 600; }
.cd-user span { font-size: 10.5px; color: rgba(244,241,236,.55); }

/* Hauptbereich */
.cd-main { position: relative; overflow: hidden; }
.cd-view { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .35s cubic-bezier(.2,.7,.2,1), visibility 0s .35s; }
.cd-view.is { opacity: 1; visibility: visible; transition: opacity .35s cubic-bezier(.2,.7,.2,1); }
.cd-view img { width: 100%; height: 100%; object-fit: cover; object-position: left top; display: block; }
.cd.is-narrow .cd-view { position: relative; inset: auto; }
.cd.is-narrow .cd-view:not(.cd-pipe) { display: none; }

.cd-pipe { padding: 20px 20px 0; }
.cd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cd-head h4 { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-size: 28px; line-height: 1.05; letter-spacing: -.01em; }
.cd-head p { font-size: 12px; color: #4d5f73; margin-top: 3px; }
.cd-tog { display: flex; border: 1px solid #e5e2dc; border-radius: 9px; padding: 3px; background: #fff; font-size: 11px; }
.cd-tog span { padding: 4px 9px; border-radius: 6px; color: #4d5f73; }
.cd-tog span:first-child { background: #0f2137; color: #fff; }
.cd-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0 16px; }
.cd-kpi { background: #fff; border: 1px solid #e5e2dc; border-radius: 11px; padding: 10px 12px; }
.cd-kpi small { display: block; font-family: 'JetBrains Mono', monospace; font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase; color: #7a8a9a; }
.cd-kpi b { display: block; font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-size: 24px; margin: 3px 0 1px; font-variant-numeric: tabular-nums; transition: color .4s; }
.cd-kpi b.flash { color: #8a6536; }
.cd-kpi span { font-size: 10.5px; color: #7a8a9a; }

.cd-board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; align-items: start; }
.cd-col { min-height: 470px; border-radius: 10px; padding: 0 0 8px; transition: background-color .2s, box-shadow .2s; }
.cd-col.over { background: rgba(196,154,108,.12); box-shadow: inset 0 0 0 1.5px rgba(196,154,108,.6); }
.cd-col h5 { display: flex; justify-content: space-between; font-family: 'JetBrains Mono', monospace; font-weight: 500; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: #4d5f73; padding: 4px 4px 7px; border-bottom: 1px solid #e5e2dc; margin-bottom: 8px; }
.cd-col h5 em { font-style: normal; color: #7a8a9a; }
.cd-cards { display: grid; gap: 7px; min-height: 40px; }

.cd-card { position: relative; background: #fff; border: 1px solid #e5e2dc; border-radius: 9px; padding: 9px 10px; box-shadow: 0 1px 2px rgba(15,33,55,.05); cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; transition: box-shadow .2s, border-color .2s; }
.cd-card:hover { border-color: #d9d5cc; box-shadow: 0 4px 12px rgba(15,33,55,.08); }
.cd-card:focus-visible { outline: 2px solid #c49a6c; outline-offset: 1px; }
.cd-card b { display: block; font-size: 11.5px; font-weight: 600; line-height: 1.3; }
.cd-card small { display: block; font-family: 'JetBrains Mono', monospace; font-size: 8.5px; letter-spacing: .06em; color: #7a8a9a; margin: 3px 0 6px; }
.cd-card .v { display: flex; align-items: baseline; justify-content: space-between; font-family: 'Instrument Serif', Georgia, serif; font-size: 17px; }
.cd-card .v span { font-family: 'DM Sans', sans-serif; font-size: 9.5px; color: #7a8a9a; }
.cd-card .m { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-family: 'JetBrains Mono', monospace; font-size: 8.5px; color: #7a8a9a; }
.cd-pill { display: inline-block; padding: 2px 7px; border-radius: 999px; font-family: 'DM Sans', sans-serif; font-size: 9.5px; font-weight: 600; }
.cd-pill.ok { background: rgba(74,122,77,.12); color: #3f6a42; }
.cd-pill.chk { background: rgba(192,138,43,.14); color: #8f6418; }
.cd-pill.no { background: rgba(201,74,61,.12); color: #a83c31; }
.cd-card.ghost { position: absolute; z-index: 30; pointer-events: none; cursor: grabbing; box-shadow: 0 18px 40px -10px rgba(15,33,55,.35); transform: rotate(-2deg); }
.cd-card.lift { opacity: .35; }

.cd-hint { position: absolute; right: 14px; bottom: 14px; z-index: 40; display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; background: #0f2137; color: #f4f1ec; font-size: 12px; box-shadow: 0 10px 24px -8px rgba(15,33,55,.5); transition: opacity .4s, transform .4s; pointer-events: none; }
.cd-hint i { width: 7px; height: 7px; border-radius: 50%; background: #c49a6c; }
.cd-hint.gone { opacity: 0; transform: translateY(-6px); }
.cd-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Schmal: Spalten wischen */
.cd.is-narrow .cd-side { display: none; }
.cd.is-narrow .cd-pipe { padding: 14px 0 14px 14px; }
.cd.is-narrow .cd-head { padding-right: 14px; }
.cd.is-narrow .cd-head h4 { font-size: 22px; }
.cd.is-narrow .cd-tog { display: none; }
.cd.is-narrow .cd-kpis { grid-template-columns: repeat(2, 1fr); padding-right: 14px; margin: 12px 0; }
.cd.is-narrow .cd-board { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding-right: 14px; scrollbar-width: none; }
.cd.is-narrow .cd-board::-webkit-scrollbar { display: none; }
.cd.is-narrow .cd-col { flex: 0 0 72%; scroll-snap-align: start; min-height: 0; }
.cd.is-narrow .cd-card { cursor: default; touch-action: auto; }
.cd.is-narrow .cd-hint { bottom: 12px; right: 12px; font-size: 11px; }
.cd.is-narrow .cd-kpi { padding: 8px 10px; }
.cd.is-narrow .cd-kpi b { font-size: 20px; }
.cd.is-narrow .cd-kpi span { display: none; }

@media (prefers-reduced-motion: reduce) {
  .cd-view, .cd-view.is, .cd-kpi b, .cd-nav, .cd-hint, .cd-col { transition: none; }
}
