:root {
  --side: #0f172a; --side-2: #1e293b; --side-text: #cbd5e1; --side-muted: #64748b;
  --bg: #0f172a; --panel: #ffffff; --soft: #f6f7f9; --line: #e5e7eb; --line-2: #eef0f3;
  --text: #111827; --muted: #6b7280; --accent: #2563eb; --accent-soft: #eff6ff;
  --ok: #16a34a; --warn: #d97706; --err: #dc2626;
  --r: 8px; --shadow: 0 10px 30px rgba(15, 23, 42, .18);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 13.5px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
h3 { font-size: 15px; margin: 0; }
p { margin: 0 0 10px; }
.icon { flex: none; vertical-align: -3px; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 6px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Start und Anmeldung */
.boot, .login { height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #e2e8f0; }
.logo-big { width: 56px; height: 56px; border-radius: 14px; background: #fff; color: var(--side); font-size: 34px; font-weight: 800; display: grid; place-items: center; }
.login-card { width: 340px; background: #fff; color: var(--text); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.login-card .logo-big { background: var(--side); color: #fff; }
.form-err { color: var(--err); font-size: 12.5px; }

/* Rahmen */
.shell { display: flex; height: 100vh; }
.side { width: 216px; flex: none; display: flex; flex-direction: column; color: var(--side-text); padding: 10px 8px; }
.side-head { display: flex; align-items: center; gap: 9px; padding: 6px 8px 14px; color: #fff; }
.logo { width: 24px; height: 24px; border-radius: 6px; background: #fff; color: var(--side); font-weight: 800; display: grid; place-items: center; }
.side nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 7px; color: var(--side-text); }
.nav:hover { background: rgba(255, 255, 255, .06); }
.nav.on { background: var(--side-2); color: #fff; }
.nav-sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 8px 6px; }
.badge { background: var(--accent); color: #fff; border-radius: 9px; padding: 0 7px; font-size: 11.5px; font-weight: 600; }
.side-foot { display: flex; flex-direction: column; gap: 6px; }
.sync { background: none; border: 0; color: var(--side-muted); display: flex; align-items: center; gap: 7px; padding: 4px 9px; font-size: 12px; }
.sync .dot { background: var(--ok); }
.sync.warn { color: #fbbf24; } .sync.warn .dot { background: #fbbf24; }
.me { display: flex; align-items: center; gap: 8px; padding: 6px 8px; color: #fff; }
.me .icon-btn { color: var(--side-muted); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0 8px 8px 0; }
.top { height: 48px; flex: none; display: flex; align-items: center; justify-content: center; }
.panel { flex: 1; min-height: 0; background: var(--panel); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }

/* Suche */
.search { position: relative; width: min(520px, 60%); display: flex; align-items: center; gap: 8px; background: var(--side-2); color: var(--side-text); border-radius: 8px; padding: 0 10px; height: 32px; }
.search input { flex: 1; background: none; border: 0; outline: 0; color: #fff; font: inherit; }
.search input::placeholder { color: var(--side-muted); }
.search kbd { font: 11px ui-monospace, monospace; background: rgba(255, 255, 255, .1); border-radius: 4px; padding: 1px 6px; }
.search-pop { position: absolute; top: 38px; left: 0; right: 0; background: #fff; color: var(--text); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 50; }
.search-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; }
.search-row .grow { overflow: hidden; text-overflow: ellipsis; }
.search-row.sel { background: var(--accent-soft); }

/* Bausteine */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 700; flex: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill-btn { background: none; border: 0; padding: 0; display: inline-flex; align-items: center; gap: 2px; }
.tag { display: inline-block; border-radius: 5px; padding: 1px 7px; font-size: 11.5px; font-weight: 600; background: var(--soft); color: var(--muted); white-space: nowrap; }
.tag.draft { background: #fef3c7; color: #92400e; } .tag.ok { background: #dcfce7; color: #166534; }
.tag.error { background: #fee2e2; color: #991b1b; margin-left: 6px; } .tag.outbox, .tag.scheduled { background: #dbeafe; color: #1e40af; }
.count { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line); background: #fff; border-radius: 7px; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--soft); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; } .btn.primary:hover { background: #1d4ed8; }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.danger-ghost { border-color: transparent; color: var(--err); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.icon-btn { background: none; border: 0; width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 6px; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--soft); color: var(--text); }
.icon-btn:disabled { opacity: .3; }
.link { background: none; border: 0; padding: 0; color: var(--accent); }
.link:hover { text-decoration: underline; }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.chip:hover { background: var(--soft); }
.input { height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; font: inherit; color: inherit; background: #fff; outline: 0; min-width: 0; width: 100%; }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.input.mini { height: 28px; width: 170px; font-size: 12.5px; }
.input.flat { border: 0; box-shadow: none; padding: 0; height: 30px; }
select.input { padding-right: 4px; }
.input-icon { position: relative; flex: 1; max-width: 380px; } .input-icon .icon { position: absolute; left: 9px; top: 8px; color: var(--muted); } .input-icon .input { padding-left: 30px; }
.fld { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; flex: 1; } .fld > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.fld-row { display: flex; gap: 12px; } .fld-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.check-label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.chips-edit { display: flex; flex-wrap: wrap; gap: 5px; } .chip-opt { border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 12px; cursor: pointer; } .chip-opt input { display: none; } .chip-opt.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); } .empty.small { padding: 14px; }
.hint { color: var(--muted); font-size: 12px; margin-left: auto; }
.note-bar { margin: 0 20px 10px; padding: 8px 12px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; color: #92400e; font-size: 12.5px; }

/* Menü, Dialog, Meldungen */
.menu-wrap { position: relative; display: inline-flex; }
.menu { position: absolute; top: calc(100% + 4px); left: 0; min-width: 190px; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); padding: 5px; z-index: 40; }
.menu.right { left: auto; right: 0; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0; padding: 7px 9px; border-radius: 6px; white-space: nowrap; }
.menu-item:hover, .menu-item.active { background: var(--soft); } .menu-item.danger { color: var(--err); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.modal-back { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: start center; padding-top: 8vh; z-index: 100; overflow: auto; }
.modal { width: min(520px, 94vw); background: #fff; border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 40px; } .modal.wide { width: min(760px, 94vw); }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-2); } .modal-head h3 { flex: 1; }
.modal-body { padding: 16px 18px 6px; } .modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line-2); }
.pick-list { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; } .pick { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 7px 10px; } .pick.on { border-color: var(--accent); background: var(--accent-soft); }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 200; }
.toast { background: #111827; color: #fff; padding: 9px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 70vw; } .toast.err { background: var(--err); }

/* Ansichten und Tabellen */
.view { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.view-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px 12px; flex: none; } .view-head select.input { width: auto; max-width: 220px; }
.filters { display: flex; align-items: center; gap: 8px; padding: 0 20px 12px; flex: none; flex-wrap: wrap; } .filters select.input { width: auto; max-width: 210px; }
.seg { display: inline-flex; background: var(--soft); border-radius: 8px; padding: 2px; } .seg-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 6px; color: var(--muted); font-weight: 500; } .seg-btn.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); flex: none; } .tabs.pad { padding: 0 20px; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; color: var(--muted); font-weight: 500; margin-bottom: -1px; } .tab.on { color: var(--text); border-bottom-color: var(--accent); }
.table { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line-2); } .table.scroll { overflow: auto; display: block; }
.vlist { flex: 1; min-height: 0; overflow: auto; }
.tr { display: flex; align-items: center; height: 38px; padding: 0 20px; gap: 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; color: inherit; }
.tr:hover { background: #fafbfc; } .tr.head { height: 34px; cursor: default; background: var(--soft); flex: none; font-size: 12px; color: var(--muted); font-weight: 600; } .tr.head:hover { background: var(--soft); }
.th, .td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; } .th { cursor: pointer; display: flex; align-items: center; gap: 3px; } .th.grow, .td.grow { flex: 1 1 auto; }
.c-name { width: 260px; } .c-wide { width: 340px; } .c-status { width: 130px; } .c-contact { flex: 1 1 160px !important; min-width: 120px; } .c-src { width: 150px; } .c-date { width: 92px; color: var(--muted); } .c-val { width: 110px; font-variant-numeric: tabular-nums; } .c-due { width: 100px; text-align: right; } .c-user { width: 130px; }
.inbox-row { height: 44px; } .inbox-row .row-actions { display: none; gap: 4px; } .inbox-row:hover .row-actions { display: flex; } .inbox-row:hover .c-due { display: none; }
.check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #cbd5e1; background: #fff; display: grid; place-items: center; color: transparent; flex: none; padding: 0; } .check:hover { border-color: var(--ok); color: var(--ok); background: #f0fdf4; }
.due-today { color: var(--warn); font-weight: 600; } .due-late { color: var(--err); font-weight: 600; }

/* Lead-Seite */
.crumb { display: flex; align-items: center; gap: 7px; padding: 9px 20px; border-bottom: 1px solid var(--line-2); color: var(--muted); flex: none; } .crumb a:hover { color: var(--text); } .crumb span:nth-of-type(1) { color: var(--text); }
.lead-head { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); flex: none; }
.lead-name { font-size: 19px; font-weight: 700; letter-spacing: -.01em; } input.lead-name { height: 34px; }
.lead-sub { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.actions { display: flex; gap: 6px; }
.lead-cols { flex: 1; min-height: 0; display: flex; }
.lead-left { width: 372px; flex: none; overflow: auto; padding: 14px; background: #fbfbfc; border-right: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 12px; }
.lead-right { flex: 1; min-width: 0; overflow: auto; padding: 0 20px 40px; }
.lead-right .tabs { position: sticky; top: 0; background: #fff; z-index: 5; margin: 0 -20px 14px; padding: 4px 20px 0; }
.sec { background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.sec-head { display: flex; align-items: center; gap: 7px; padding: 7px 8px 7px 11px; background: var(--soft); border-bottom: 1px solid var(--line-2); border-radius: var(--r) var(--r) 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: #374151; }
.sec-empty { padding: 10px 12px; color: var(--muted); font-size: 12.5px; }
.about-row { display: flex; gap: 9px; padding: 7px 11px; align-items: flex-start; } .about-row > .icon { margin-top: 3px; color: var(--muted); } .about-row .inline { flex: 1; }
.inline { cursor: text; border-radius: 5px; padding: 1px 4px; margin: -1px -4px; min-height: 20px; overflow-wrap: anywhere; white-space: pre-wrap; } .inline:hover { background: var(--soft); } .inline.ph { color: #9ca3af; }
.task { display: flex; align-items: flex-start; gap: 9px; padding: 8px 11px; border-bottom: 1px solid var(--line-2); cursor: pointer; } .task:last-child { border-bottom: 0; } .task .check { margin-top: 1px; }
.opp { margin: 8px; padding: 8px 10px; border: 1px solid var(--line); border-left: 3px solid; border-radius: 7px; cursor: pointer; } .opp:hover { background: var(--soft); }
.contact { padding: 8px 11px; border-bottom: 1px solid var(--line-2); } .contact:last-child { border-bottom: 0; } .contact b { cursor: pointer; }
.hov { opacity: 0; } *:hover > .hov, .card-head:hover .hov, .row:hover .hov { opacity: 1; }
.kv { display: flex; flex-direction: column; } .kv > div { display: flex; gap: 10px; padding: 5px 11px; align-items: flex-start; } .kv > div > .muted { width: 128px; flex: none; } .kv > div > span:last-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.field-edit { display: flex; gap: 4px; align-items: flex-start; flex: 1; }

/* Verlauf */
.timeline { display: flex; flex-direction: column; gap: 10px; position: relative; }
.item { display: flex; gap: 10px; align-items: flex-start; }
.item-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--muted); flex: none; }
.item-ico.sm { width: 22px; height: 22px; } .item-ico.mail { background: #dbeafe; color: #1d4ed8; } .item-ico.note { background: #fef3c7; color: #92400e; } .item-ico.custom { background: #ede9fe; color: #6d28d9; } .item-ico.task { background: #ffedd5; color: #c2410c; } .item-ico.draft { background: #fef3c7; color: #92400e; }
.card { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.card-head { display: flex; align-items: center; gap: 6px; padding: 8px 12px; } .card-body { padding: 2px 12px 11px; }
.when { color: var(--muted); font-size: 12px; white-space: nowrap; margin-left: 6px; }
.item.log { align-items: center; } .log-line { flex: 1; display: flex; align-items: center; gap: 4px; color: #374151; min-width: 0; }
.msg { border-top: 1px solid var(--line-2); } .msg-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; } .msg-head:hover { background: #fafbfc; }
.msg-who { color: var(--muted); white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; flex: none; } .msg.open .msg-who { color: var(--text); font-weight: 600; }
.msg-prev { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .msg.open .msg-prev { color: var(--muted); }
.icon.in { color: var(--ok); }
.msg-body { padding: 4px 12px 12px 34px; } .msg-actions { display: flex; gap: 6px; margin-top: 10px; }
.mail-frame { width: 100%; border: 0; min-height: 60px; display: block; } .mail-text { white-space: pre-wrap; font: inherit; margin: 0; }
.attach { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rich { overflow-wrap: anywhere; } .rich p, .rich div { margin: 0; } .rich ul, .rich ol { margin: 4px 0; padding-left: 20px; } .rich a { color: var(--accent); } .rich img { max-width: 100%; height: auto; } .rich blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
.more { display: flex; justify-content: center; padding: 16px; }

/* Editoren */
.composer { border: 1px solid var(--accent); border-radius: var(--r); margin-bottom: 14px; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); background: #fff; }
.composer-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); }
.composer-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line-2); }
.mail-row { display: flex; align-items: center; gap: 10px; padding: 0 12px; border-bottom: 1px solid var(--line-2); } .mail-row > span { width: 52px; color: var(--muted); font-size: 12.5px; flex: none; }
.rich-bar { display: flex; gap: 2px; padding: 4px 8px; border-bottom: 1px solid var(--line-2); } .rich-bar button { width: 28px; height: 26px; border: 0; background: none; border-radius: 5px; display: grid; place-items: center; } .rich-bar button:hover { background: var(--soft); }
.rich-area { padding: 10px 12px; outline: 0; } .rich-area:empty::before { content: attr(data-placeholder); color: #9ca3af; }
.tpl-body { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 10px 0 14px; }

/* Pipeline */
.board { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 0 20px 16px; overflow-x: auto; }
.col { flex: 1 1 0; min-width: 250px; display: flex; flex-direction: column; background: var(--soft); border-radius: 10px; min-height: 0; } .col.over { outline: 2px dashed var(--accent); }
.col.narrow { flex: 0 0 200px; min-width: 200px; background: none; gap: 12px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 3px solid; border-radius: 10px 10px 0 0; }
.col-body { flex: 1; overflow: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 6px; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: grab; display: flex; flex-direction: column; gap: 2px; } .kcard:hover { border-color: #cbd5e1; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); } .kcard.dragging { opacity: .4; }
.dropzone { flex: 1; border: 2px dashed; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 12px; } .dropzone.over { background: var(--soft); }

@media (max-width: 1100px) { .lead-left { width: 300px; } .side { width: 60px; } .side-head b, .nav span, .me .grow, .sync { display: none; } .c-src { display: none; } }
