/* JobStart – Pipeline, Potenzial, Kontaktverlauf, Kalender, Leads. Scoped to .cj-* */

/* Status pipeline */
.cj-pipe { display: flex; gap: 6px; margin: 0 0 20px; overflow-x: auto; }
.cj-pipe__step { position: relative; flex: 1; min-width: 110px; text-align: center; padding: 11px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--cj-line); font-weight: 700; font-size: 14px; text-decoration: none; color: var(--cj-muted) !important; transition: background .15s, color .15s; }
.cj-pipe__step:hover { background: var(--cj-tint); color: var(--cj-ink) !important; }
.cj-pipe__step.is-current { color: #fff !important; border-color: transparent; }
.cj-pipe--blue.is-current { background: #2563eb; }
.cj-pipe--violet.is-current { background: #7c3aed; }
.cj-pipe--amber.is-current { background: #d97706; }
.cj-pipe--green.is-current { background: #16a34a; }
.cj-pipe--gray.is-current { background: #64748b; }

.cj-pipe { margin-bottom: 8px; }
.cj-pipe__hint { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 20px !important; font-size: 13px; color: var(--cj-muted); }
.cj-pipe__hint .cj-ico { width: 15px; height: 15px; }
.cj-pipe__hint a { color: var(--cj-blue); font-weight: 600; }

/* Small status pills in lists */
.cj-st { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.cj-st--blue { background: #dbeafe; color: #1d4ed8; }
.cj-st--violet { background: #ede9fe; color: #6d28d9; }
.cj-st--amber { background: #fef3c7; color: #b45309; }
.cj-st--green { background: #dcfce7; color: #15803d; }
.cj-st--gray { background: #eef1f6; color: #5b6478; }
.cj-app__main { grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1fr) auto; }
.cj-app__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cj-mini-stars { color: #f59e0b; font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
.cj-mini-stars i { color: #dfe4ee; font-style: normal; }

/* Star rating */
.cj-rate { display: inline-flex; gap: 2px; }
.cj-rate__s { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #cfd6e3 !important; }
.cj-rate__s .cj-ico { width: 20px; height: 20px; }
.cj-rate__s.is-on { color: #f59e0b !important; }
.cj-rate__s.is-on .cj-ico { fill: currentColor; }
.cj-rate:hover .cj-rate__s { color: #f59e0b !important; }
.cj-rate:hover .cj-rate__s .cj-ico { fill: currentColor; }
.cj-rate .cj-rate__s:hover ~ .cj-rate__s { color: #cfd6e3 !important; }
.cj-rate .cj-rate__s:hover ~ .cj-rate__s .cj-ico { fill: none; }
.cj-person__pot { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 4px 0 14px; }
.cj-person__pot small { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--cj-muted); }
.cj-appdetail__left { display: grid; gap: 20px; }

/* CV missing */
.cj-cv__missing { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border-radius: 14px; background: var(--cj-tint); }
.cj-cv__missing b { display: block; word-break: break-all; }
.cj-cv__missing p { margin: 4px 0 12px !important; color: var(--cj-muted); font-size: 14px; }

/* Log form */
.cj-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.cj-seg label { display: block !important; }
.cj-seg input { position: absolute; opacity: 0; pointer-events: none; }
.cj-seg span { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--cj-line); font-weight: 600; font-size: 14px; cursor: pointer; background: #fff; }
.cj-seg input:checked + span { background: var(--cj-navy); border-color: var(--cj-navy); color: #fff; }
.cj-seg input:focus-visible + span { outline: 3px solid rgba(37, 99, 235, .4); }
.cj-seg .cj-ico { width: 16px; height: 16px; }
.cj-logform__termin { display: none; }
.cj-logform:has(input[value=termin]:checked) .cj-logform__termin { display: block; }
.cj-logform:has(input[value=termin]:checked) .cj-logform__outcome,
.cj-logform:has(input[value=notiz]:checked) .cj-logform__outcome { display: none; }
.cj-form__row--3 { grid-template-columns: 1fr 1fr 1.4fr; }
.cj-logform .cj-btn { justify-self: start; }

/* Timeline */
.cj-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.cj-timeline::before { content: ""; position: absolute; left: 17px; top: 8px; bottom: 8px; width: 2px; background: var(--cj-line); }
.cj-tl { position: relative; display: flex; gap: 14px; padding: 8px 0; }
.cj-tl__icon { position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 2px solid var(--cj-line); color: var(--cj-muted); }
.cj-tl__icon .cj-ico { width: 16px; height: 16px; }
.cj-tl--anruf .cj-tl__icon { border-color: #93c5fd; color: #2563eb; }
.cj-tl--email .cj-tl__icon { border-color: #c4b5fd; color: #7c3aed; }
.cj-tl--termin .cj-tl__icon { border-color: #fcd34d; color: #d97706; }
.cj-tl--termin.is-future .cj-tl__icon { background: #fef3c7; }
.cj-tl--status .cj-tl__icon { border-color: #cbd5e1; }
.cj-tl--start .cj-tl__icon { border-color: #86efac; color: #16a34a; }
.cj-tl__body { flex: 1; min-width: 0; padding: 6px 0 10px; border-bottom: 1px solid var(--cj-line); }
.cj-tl:last-child .cj-tl__body { border-bottom: 0; }
.cj-tl__head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cj-tl__head time { font-size: 13px; color: var(--cj-muted); }
.cj-tl__body p { margin: 6px 0 !important; font-size: 15px; }
.cj-tl__termin { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: #fffbeb; }
.cj-tl__termin .cj-ico { width: 16px; height: 16px; color: #d97706; }
.cj-tl__termin a { margin-left: auto; font-size: 13px; color: var(--cj-blue); }
.cj-tl__body small { color: var(--cj-muted); font-size: 12px; }
.cj-tl__del { color: var(--cj-muted) !important; }
.cj-tl__del:hover { color: #dc2626 !important; }

/* Calendar */
.cj-cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; margin-bottom: 20px; align-items: start; }
.cj-cal__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cj-page .cj-cal__head h2 { margin: 0 8px; font-size: 20px; font-weight: 800; min-width: 170px; text-align: center; }
.cj-cal__today { margin-left: auto; }
.cj-cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--cj-line); border-left: 1px solid var(--cj-line); }
.cj-cal__dow { padding: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--cj-muted); border-right: 1px solid var(--cj-line); border-bottom: 1px solid var(--cj-line); background: #fafbfe; }
.cj-cal__day { min-height: 104px; padding: 6px; border-right: 1px solid var(--cj-line); border-bottom: 1px solid var(--cj-line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cj-cal__day.is-other { background: #fafbfe; }
.cj-cal__day.is-other .cj-cal__num { color: #b8c0cf; }
.cj-cal__day.is-weekend { background: #fcfcfe; }
.cj-cal__num { font-size: 13px; font-weight: 700; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cj-cal__day.is-today .cj-cal__num { background: var(--cj-blue); color: #fff; }
.cj-cal__ev { display: block; padding: 3px 6px; border-radius: 6px; background: #fef3c7; color: #92400e !important; font-size: 12px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid #f59e0b; }
.cj-cal__ev:hover { background: #fde68a; }
.cj-agenda ul, .cj-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cj-agenda li, .cj-mini li { display: flex; gap: 12px; align-items: center; }
.cj-agenda a, .cj-mini a { display: flex; flex-direction: column; flex: 1; text-decoration: none; color: var(--cj-ink) !important; min-width: 0; overflow: hidden; }
.cj-agenda { min-width: 0; }
.cj-agenda a:hover strong, .cj-mini a:hover strong { color: var(--cj-blue); }
.cj-agenda small, .cj-mini small { color: var(--cj-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cj-agenda__date { flex: none; width: 48px; height: 52px; border-radius: 12px; background: #fef3c7; color: #b45309; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.cj-agenda__date b { font-size: 19px; line-height: 1; color: #92400e; }
.cj-grid2--even { grid-template-columns: 1fr 1fr; }
.cj-type { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.cj-type .cj-ico { width: 15px; height: 15px; }
.cj-type--anruf { color: #2563eb; }
.cj-type--email { color: #7c3aed; }
.cj-type--termin { color: #d97706; }
.cj-table--plain td small { display: block; }
.cj-side__nav em.is-blue { background: #60a5fa; color: #0b1b3a; }

/* Leads (admin) */
.cj-leads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.cj-lead { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: 16px; background: #fff; border: 1px solid var(--cj-line); text-decoration: none; color: var(--cj-ink) !important; transition: box-shadow .2s, transform .2s; }
.cj-lead:first-child { background: linear-gradient(135deg, #eef2ff, #f5f3ff); border-color: #c7d2fe; }
.cj-lead:hover { box-shadow: var(--cj-shadow); transform: translateY(-2px); }
.cj-lead__rank { position: absolute; top: 16px; right: 18px; font-size: 26px; font-weight: 800; color: #d6dcf0; }
.cj-lead strong { font-size: 17px; margin-top: 8px; }
.cj-lead small { color: var(--cj-muted); }
.cj-lead em { font-size: 13px; color: var(--cj-muted); margin-top: 6px; }
.cj-lead__nums { display: flex; gap: 18px; margin-top: 10px; }
.cj-lead__nums span { display: flex; flex-direction: column; font-size: 12px; color: var(--cj-muted); }
.cj-lead__nums b { font-size: 20px; color: var(--cj-ink); }
.cj-heat { display: inline-block; align-self: flex-start; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.cj-heat--hot { background: #fee2e2; color: #b91c1c; }
.cj-heat--warm { background: #fef3c7; color: #b45309; }
.cj-heat--cold { background: #e0f2fe; color: #0369a1; }
.cj-leadnote { margin-top: 6px; font-size: 13px; }
.cj-leadnote summary { cursor: pointer; color: var(--cj-blue); list-style: none; }
.cj-leadnote summary::-webkit-details-marker { display: none; }
.cj-leadnote form { display: grid; gap: 8px; margin-top: 8px; max-width: 420px; }
.cj-leadnote textarea { width: 100%; padding: 8px 10px; border: 1px solid #d6dce8; border-radius: 9px; font: 400 14px var(--cj-font); }
.cj-leadnote .cj-btn { justify-self: start; }

@media (max-width: 1100px) {
	.cj-cal-wrap, .cj-grid2--even { grid-template-columns: minmax(0, 1fr); }
	.cj-leads { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
	.cj-cal__day { min-height: 64px; padding: 3px; }
	.cj-cal__ev { font-size: 10px; padding: 2px 4px; }
	.cj-cal__ev b { display: none; }
	.cj-form__row--3 { grid-template-columns: 1fr 1fr; }
	.cj-app__meta { display: none; }
	.cj-pipe__step { min-width: 96px; padding: 9px 10px; font-size: 13px; }
}

/* ---------- Step-by-step contact ---------- */
.cj-steps2 { list-style: none; margin: 0 0 4px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; counter-reset: none; }
.cj-steps2 li { position: relative; }
.cj-steps2 input { position: absolute; opacity: 0; pointer-events: none; }
.cj-step2 { display: flex !important; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--cj-line); background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; height: 100%; }
.cj-step2:hover { border-color: #c7d2fe; }
.cj-steps2 input:checked + .cj-step2 { border-color: var(--cj-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.cj-steps2 input:focus-visible + .cj-step2 { outline: 3px solid rgba(37, 99, 235, .4); }
.cj-step2__n { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--cj-tint); color: var(--cj-muted); font-weight: 800; font-size: 13px; }
.cj-step2.is-done .cj-step2__n { background: #16a34a; color: #fff; }
.cj-step2__n .cj-ico { width: 16px; height: 16px; }
.cj-step2__t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cj-step2__t b { display: flex; align-items: center; gap: 5px; font-size: 14px; }
.cj-step2__t b .cj-ico { width: 14px; height: 14px; }
.cj-step2__t small { font-size: 12px; color: var(--cj-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cj-step2.is-done .cj-step2__t small { color: #15803d; }
.cj-panel { display: none; gap: 14px; }
.cj-logform:has(#cj-t-anruf:checked) .cj-panel--anruf, .cj-logform:has(#cj-t-email:checked) .cj-panel--email, .cj-logform:has(#cj-t-termin:checked) .cj-panel--termin, .cj-logform:has(#cj-t-notiz:checked) .cj-panel--notiz { display: grid; }
.cj-logform:has(#cj-t-email:checked) .cj-logform__note, .cj-logform:has(#cj-t-email:checked) .cj-btn--save { display: none; }
.cj-logform .cj-btn--send { display: none; }
.cj-logform:has(#cj-t-email:checked) .cj-btn--send { display: inline-flex; }
.cj-logform__btns { display: flex; gap: 10px; }
.cj-callbox { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: #eff6ff; color: #1d4ed8 !important; text-decoration: none; justify-self: start; }
.cj-callbox span { display: flex; flex-direction: column; line-height: 1.2; }
.cj-callbox small { font-size: 12px; } .cj-callbox b { font-size: 18px; }
.cj-mailhead { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--cj-tint); font-size: 14px; }
.cj-mailhead span { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cj-mailhead small { width: 110px; color: var(--cj-muted); }
.cj-mailhead a { font-size: 13px; color: var(--cj-blue); }
.cj-decide { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Retention ---------- */
.cj-ret { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cj-ret__preset { flex: 1; min-width: 180px; }
.cj-ret__custom { display: none; gap: 6px; }
.cj-ret:has(.cj-ret__preset option[value="custom"]:checked) .cj-ret__custom { display: flex; }
.cj-ret__custom input { width: 90px !important; }
.cj-ret__custom select { width: auto !important; }
.cj-retcard__state { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; margin: 0 0 14px !important; font-size: 14px; }
.cj-retcard__state .cj-ico { width: 18px; height: 18px; flex: none; }
.cj-retcard__state--none { background: var(--cj-tint); color: var(--cj-muted); }
.cj-retcard__state--due { background: #fef2f2; color: #991b1b; }
.cj-retcard__state--keep { background: #f0fdf4; color: #166534; }
.cj-retform__date { display: none; }
.cj-retform:has(input[name=ret_mode][value=date]:checked) .cj-retform__date { display: block; }
.cj-retform__btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.cj-seg--sm span { padding: 7px 12px; font-size: 13px; }
.cj-btn--danger { background: #fff; color: #b91c1c !important; border: 1px solid #fecaca; }
.cj-btn--danger:hover { background: #fef2f2; }
.cj-retlog { margin-top: 6px; font-size: 13px; color: var(--cj-muted); }
.cj-retlog summary { cursor: pointer; color: var(--cj-blue); }
.cj-retlog ul { margin: 8px 0 0; padding-left: 18px; }
@media (max-width: 860px) { .cj-steps2 { grid-template-columns: 1fr 1fr; } }
.cj-tl__more { margin: 0 0 6px; font-size: 14px; }
.cj-tl__more summary { cursor: pointer; color: var(--cj-blue); font-weight: 600; font-size: 13px; }
.cj-tl__more p { padding: 10px 12px; border-radius: 10px; background: var(--cj-tint); }

/* ---------- Calendar: add appointments ---------- */
.cj-cal__day { position: relative; }
.cj-cal__day[data-cj-add] { cursor: pointer; }
.cj-cal__day[data-cj-add]:hover { background: #f5f8ff; }
.cj-cal__day.is-past .cj-cal__num { color: #9aa3b5; }
.cj-cal__plus { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; border: 0; background: var(--cj-blue); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s; padding: 0; }
.cj-cal__plus .cj-ico { width: 14px; height: 14px; }
.cj-cal__day:hover .cj-cal__plus, .cj-cal__plus:focus-visible { opacity: 1; }
.cj-cal__ev { display: flex; align-items: center; gap: 4px; }
.cj-cal__ev .cj-ico { width: 12px; height: 12px; flex: none; }
.cj-cal__ev--telefon { background: #dbeafe; color: #1e40af !important; border-left-color: #2563eb; }
.cj-cal__ev--video { background: #ede9fe; color: #5b21b6 !important; border-left-color: #7c3aed; }
.cj-cal__ev--vorort { background: #fef3c7; color: #92400e !important; border-left-color: #f59e0b; }
.cj-cal__ev--email { background: #dcfce7; color: #166534 !important; border-left-color: #16a34a; }
.cj-cal__ev--sonst { background: #eef1f6; color: #334155 !important; border-left-color: #64748b; }
.cj-cal__legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cj-cal__legend .cj-cal__ev { font-size: 12px; }
.cj-agenda li { align-items: flex-start; }
.cj-agenda__body { display: flex; flex-direction: column; flex: 1; min-width: 0; text-decoration: none; color: var(--cj-ink) !important; }
.cj-agenda__body small { display: flex; align-items: center; gap: 4px; }
.cj-agenda__body small .cj-ico { width: 13px; height: 13px; }
.cj-agenda__acts { display: flex; gap: 2px; }
.cj-agenda__acts a { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--cj-muted) !important; }
.cj-agenda__acts a:hover { background: var(--cj-tint); color: var(--cj-blue) !important; }
.cj-agenda__acts .cj-ico { width: 15px; height: 15px; }

/* Dialog */
.cj-dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 40px 80px -20px rgba(15, 23, 42, .45); color: var(--cj-ink); }
.cj-dialog::backdrop { background: rgba(11, 27, 58, .55); backdrop-filter: blur(2px); }
.cj-dialog .cj-form { padding: 24px 26px; gap: 14px; }
.cj-dialog__head { display: flex; justify-content: space-between; align-items: center; }
.cj-page .cj-dialog__head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.cj-dialog__x { border: 0; background: var(--cj-tint); width: 34px; height: 34px; border-radius: 10px; font-size: 22px; line-height: 1; cursor: pointer; color: var(--cj-muted); }
.cj-dialog__btns { display: flex; justify-content: flex-end; gap: 10px; }
.cj-seg--kinds span { padding: 8px 12px; }
.cj-pick { padding: 6px !important; }
.cj-pick option { padding: 6px 8px; border-radius: 6px; }
.cj-dialog .cj-dialog__title { display: none; }
.cj-dialog.is-own .cj-dialog__title { display: grid; }
.cj-dialog.is-own .cj-dialog__invite, .cj-dialog.no-mail .cj-dialog__invite { display: none !important; }
