:root {
  --accent: #1a56db;
  --accent-dark: #1344b0;
  --accent-bg: #eff6ff;
  --dark: #1a1a1a;
  --mid: #555;
  --light: #f7f7f7;
  --border: #e0e0e0;
  --white: #ffffff;
  --green: #15803d;
  --green-bg: #dcfce7;
  --orange: #d97706;
  --orange-bg: #fef3c7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --radius: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --header-h: 56px;
  --summary-h: 72px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif; font-size: 14px; color: var(--dark); background: var(--light); }

/* HEADER */
header { position: fixed; top: 0; left: 0; right: 0; height: var(--header-h); background: var(--white); border-bottom: 1px solid var(--border); display: flex; align-items: center; z-index: 100; }
.header-inner { padding: 0 1.5rem; width: 100%; display: flex; align-items: center; gap: 1.5rem; }
.logo-area { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: inherit; flex-shrink: 0; }
.kr-logo-svg { height: 30px; width: auto; display: block; }
.crm-badge { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--accent); background: var(--accent-bg); padding: 2px 7px; border-radius: 4px; }
.logo-divider { width: 1px; height: 24px; background: var(--border); }
.page-title { font-size: 13px; color: var(--mid); font-weight: 500; }
nav { display: flex; gap: .25rem; margin-left: 1rem; }
nav a { text-decoration: none; color: var(--mid); font-size: 13px; font-weight: 500; padding: .4rem .8rem; border-radius: var(--radius); transition: all .15s; }
nav a:hover { background: var(--light); color: var(--dark); }
nav a.active { background: var(--accent-bg); color: var(--accent); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem; border-radius: var(--radius); border: none; font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--mid); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--light); color: var(--dark); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-icon { padding: .35rem; background: transparent; border: none; cursor: pointer; border-radius: var(--radius); color: var(--mid); transition: all .15s; }
.btn-icon:hover { background: var(--light); }
.btn-icon.edit:hover { color: var(--accent); background: var(--accent-bg); }
.btn-icon.del:hover { color: var(--red); background: #fff0f0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* SUMMARY BAR */
.summary-bar {
  position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 90;
  background: var(--white); border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 1.5rem; padding: .75rem 1.5rem;
  overflow-x: auto; min-height: var(--summary-h);
}
.summary-bar::-webkit-scrollbar { display: none; }
.sum-item { display: flex; flex-direction: column; gap: .1rem; flex-shrink: 0; }
.sum-label { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--mid); font-weight: 500; }
.sum-val { font-size: 15px; font-weight: 700; }
.sum-divider { width: 1px; align-self: stretch; background: var(--border); flex-shrink: 0; }
.sum-periods { display: flex; gap: .5rem; margin-top: .2rem; flex-wrap: nowrap; }
.sum-period { font-size: 10px; color: var(--mid); white-space: nowrap; cursor: default; }
.sum-period b { font-weight: 600; color: var(--dark); }
.sum-item.clickable { cursor: pointer; border-radius: var(--radius); padding: 3px 6px; margin: -3px -6px; transition: background .15s; }
.sum-item.clickable:hover { background: var(--light); }
.sum-item.clickable .sum-label::after { content: ' ↗'; font-size: 9px; opacity: .5; }

/* REVENUE DETAIL MODAL */
.rev-modal { max-width: 500px; }
.rdq-section { padding: .9rem 1.5rem; border-bottom: 1px solid var(--border); }
.rdq-section.rdq-curr-q { background: #fafbff; }
.rdq-q-header { display: flex; align-items: baseline; gap: .4rem; margin-bottom: .55rem; }
.rdq-q-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--mid); }
.rdq-q-range { font-size: 11px; color: var(--mid); font-weight: 400; }
.rdq-q-total { margin-left: auto; font-size: 14px; font-weight: 700; }
.rdq-month-row { display: grid; grid-template-columns: 88px 1fr 90px; align-items: center; gap: .6rem; padding: .2rem 0; }
.rdq-tag-row   { display: grid; grid-template-columns: 160px 1fr 90px; align-items: center; gap: .6rem; padding: .25rem 0; }
.rdq-month-name { font-size: 12px; color: var(--mid); }
.rdq-month-name.is-curr { color: var(--accent); font-weight: 600; }
.rdq-bar-wrap { height: 5px; background: #eee; border-radius: 99px; overflow: hidden; }
.rdq-bar { height: 100%; border-radius: 99px; }
.rdq-month-val { font-size: 12px; font-weight: 600; text-align: right; white-space: nowrap; }
.rdq-month-val.zero { color: var(--mid); font-weight: 400; }
.rdq-year-row { padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.rdq-year-label { font-size: 13px; font-weight: 600; }
.rdq-year-val { font-size: 18px; font-weight: 700; }

/* SEARCH BAR */
.search-bar {
  position: fixed; top: calc(var(--header-h) + var(--summary-h)); left: 0; right: 0; z-index: 89;
  background: var(--light); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .75rem; padding: .6rem 1.5rem;
}
.search-wrap { position: relative; min-width: 220px; max-width: 340px; }
.search-icon { position: absolute; left: 1px; top: 1px; bottom: 1px; width: 32px; display: flex; align-items: center; justify-content: center; background: var(--light); border-right: 1px solid var(--border); border-radius: var(--radius) 0 0 var(--radius); color: var(--mid); pointer-events: none; }
.search-bar input, .search-bar select, .search-bar .btn { height: 34px; box-sizing: border-box; font-size: 13px; }
.search-bar input.search-input { width: 100%; padding: 0 .75rem 0 42px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); outline: none; transition: border-color .15s; font-size: 13px; }
.search-bar input.search-input:focus { border-color: var(--accent); }
.filter-select { padding: 0 .75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); color: var(--dark); cursor: pointer; outline: none; }

/* KANBAN */
.kanban-scroll-area {
  position: fixed;
  top: calc(var(--header-h) + var(--summary-h) + 45px);
  left: 0; right: 0; bottom: 0;
  overflow-x: auto; overflow-y: hidden;
  padding: 1.25rem 1.5rem;
  display: flex;
}
.kanban-board { display: flex; gap: 1rem; height: 100%; align-items: flex-start; min-width: max-content; }

/* COLUMN */
.kanban-col {
  width: 280px; flex-shrink: 0; display: flex; flex-direction: column; height: 100%;
  background: #ebebeb; border-radius: 10px; overflow: hidden;
}
.col-header {
  padding: .8rem 1rem .6rem; display: flex; flex-direction: column; gap: .3rem; flex-shrink: 0;
}
.col-header-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.col-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-meta { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.col-count { font-size: 12px; color: var(--mid); background: rgba(0,0,0,.08); border-radius: 99px; padding: .1rem .5rem; font-weight: 500; }
.col-total { font-size: 11px; color: var(--mid); font-weight: 500; }
.col-add { padding: .2rem; color: var(--mid); background: transparent; border: none; cursor: pointer; border-radius: var(--radius); transition: all .15s; display: flex; }
.col-add:hover { background: rgba(0,0,0,.1); color: var(--dark); }
.col-prob {
  font-size: 11px; font-weight: 600; color: #fff; background: rgba(0,0,0,.22);
  border-radius: 99px; padding: .1rem .45rem; cursor: pointer; transition: background .15s;
  white-space: nowrap; user-select: none;
}
.col-prob:hover { background: rgba(0,0,0,.38); }
.col-weighted { font-size: 10px; color: var(--mid); }

.col-cards {
  flex: 1; overflow-y: auto; padding: 0 .6rem .6rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.col-cards::-webkit-scrollbar { width: 4px; }
.col-cards::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 4px; }

/* CARD */
.deal-card {
  background: var(--white); border-radius: 8px; padding: .85rem 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.1); cursor: pointer;
  transition: box-shadow .15s, transform .1s;
  border-left: 3px solid transparent; position: relative;
}
.deal-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.15); transform: translateY(-1px); }
.deal-card.dragging { opacity: .5; }
.deal-card[draggable=true]:active { cursor: grabbing; }
.deal-card.drag-over-top    { box-shadow: 0 -3px 0 0 var(--accent), 0 1px 3px rgba(0,0,0,.1) !important; margin-top: 3px; }
.deal-card.drag-over-bottom { box-shadow: 0  3px 0 0 var(--accent), 0 1px 3px rgba(0,0,0,.1) !important; margin-bottom: 3px; }

.card-titel { font-size: 13px; font-weight: 600; margin-bottom: .4rem; line-height: 1.3; }
.card-angebotsnr { font-size: 10px; font-family: monospace; color: var(--mid); letter-spacing: .03em; margin-bottom: .15rem; opacity: .8; }
.card-wert { font-size: 15px; font-weight: 700; color: var(--accent); margin-bottom: .15rem; }
.card-expected { font-size: 11px; color: var(--mid); margin-bottom: .4rem; }
.card-meta { display: flex; flex-direction: column; gap: .25rem; }
.card-meta-row { display: flex; align-items: center; gap: .4rem; font-size: 11px; color: var(--mid); }
.card-meta-row.company { color: var(--dark); font-weight: 600; }
.card-meta-row svg { flex-shrink: 0; }
.card-badge { font-size: 10px; font-weight: 600; padding: .15rem .45rem; border-radius: 99px; }
.card-actions { position: absolute; top: .6rem; right: .6rem; display: none; gap: .2rem; }
.deal-card:hover .card-actions { display: flex; }
.card-arrows { display: none; align-items: center; justify-content: center; gap: 2px; margin-top: .35rem; padding-top: .3rem; border-top: 1px solid var(--border); }
.deal-card:hover .card-arrows { display: flex; }
.card-arrows .arr { width: 22px; height: 20px; border: none; border-radius: 4px; background: var(--light); color: var(--mid); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: all .12s; }
.card-arrows .arr:hover { background: var(--accent); color: #fff; }
.card-arrows .arr svg { width: 11px; height: 11px; }

/* Deadline colors */
.deadline-ok { color: var(--mid); }
.deadline-soon { color: #d97706; font-weight: 500; }
.deadline-overdue { color: var(--red); font-weight: 500; }

/* Column accent colors */
.col-in-erstellung .col-header { border-top: 3px solid #94a3b8; }
.col-abgegeben     .col-header { border-top: 3px solid #06b6d4; }
.col-in-klaerung   .col-header { border-top: 3px solid #3b82f6; }
.col-gewonnen      .col-header { border-top: 3px solid #22c55e; }
.col-abgeschlossen .col-header { border-top: 3px solid #0d9488; }
.col-verloren      .col-header { border-top: 3px solid #ef4444; }
.col-anfrage       .col-header { border-top: 3px solid #f97316; }

.col-in-erstellung .deal-card { border-left-color: #94a3b8; }
.col-abgegeben     .deal-card { border-left-color: #06b6d4; }
.col-in-klaerung   .deal-card { border-left-color: #3b82f6; }
.col-gewonnen      .deal-card { border-left-color: #22c55e; }
.col-abgeschlossen .deal-card { border-left-color: #0d9488; }
.col-verloren      .deal-card { border-left-color: #ef4444; }
.col-anfrage       .deal-card { border-left-color: #f97316; }

/* Drop zone */
.col-cards.drag-over { background: rgba(26,86,219,.06); border-radius: 6px; }

/* LOADING */
.col-loading { padding: 1rem; text-align: center; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* MODAL */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200; align-items: flex-start; justify-content: center; padding: 3rem 1rem 1rem; overflow-y: auto; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--white); border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.2); width: 100%; max-width: 600px; display: flex; flex-direction: column; animation: modalIn .15s ease-out; margin: auto; }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(-8px); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-body { padding: 1.5rem; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: .75rem; padding: 1rem 1.5rem; border-top: 1px solid var(--border); flex-shrink: 0; }


.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field.full { grid-column: 1 / -1; }
label { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--mid); }
input[type=text], input[type=number], input[type=date], textarea, select.form-select {
  padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: inherit; outline: none; transition: border-color .15s;
  background: var(--white); color: var(--dark); width: 100%;
}
input:focus, textarea:focus, select.form-select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }
.field-error { font-size: 12px; color: var(--red); display: none; }
.field-error.visible { display: block; }

.wert-input-wrap { position: relative; }
.wert-currency { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); color: var(--mid); font-size: 13px; pointer-events: none; }
.wert-input-wrap input { padding-right: 2rem; }

/* STATUS SELECTOR */
.status-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.status-pill {
  padding: .35rem .75rem; border-radius: 99px; border: 2px solid var(--border);
  font-size: 12px; font-weight: 500; cursor: pointer; transition: all .15s; background: var(--white);
}
.status-pill:hover { border-color: var(--accent); }
.status-pill.active { color: #fff; border-color: transparent; }
.pill-in-erstellung.active { background: #94a3b8; border-color: #94a3b8; }
.pill-abgegeben.active     { background: #06b6d4; border-color: #06b6d4; }
.pill-in-klaerung.active   { background: #3b82f6; border-color: #3b82f6; }
.pill-gewonnen.active      { background: #22c55e; border-color: #22c55e; }
.pill-abgeschlossen.active { background: #0d9488; border-color: #0d9488; }
.pill-verloren.active      { background: #ef4444; border-color: #ef4444; }
.pill-anfrage.active       { background: #f97316; border-color: #f97316; }

/* VERLUSTGRUND */
#verlustgrund-field { display: none; }
#verlustgrund-field.visible { display: flex; animation: fadeSlideIn .18s ease-out; }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.verlustgrund-label-req { color: var(--red); margin-left: .15rem; }
#verlust-popup-grund:focus { border-color: var(--accent); outline: none; }

/* TÄTIGKEITEN TAGS */
.tag-picker { display: flex; flex-wrap: wrap; gap: .4rem; min-height: 30px; }
.tag-pill-btn { padding: .28rem .7rem; border-radius: 99px; border: 2px solid; font-size: 12px; font-weight: 500; cursor: pointer; transition: all .15s; background: transparent; font-family: inherit; line-height: 1.3; }
.tag-pill-btn.selected { color: #fff !important; }
.tag-pill-btn:not(.selected):hover { opacity: .72; }
.card-tags { display: flex; flex-wrap: wrap; gap: .2rem; margin-bottom: .3rem; }
.card-tag { font-size: 10px; font-weight: 600; padding: .1rem .38rem; border-radius: 99px; color: #fff; line-height: 1.4; }
/* Tag management */
.tag-mgmt-list { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.tag-mgmt-item { display: flex; align-items: center; gap: .6rem; padding: .4rem .65rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); }
.tag-mgmt-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tag-mgmt-name { flex: 1; font-size: 13px; font-weight: 500; }
.tag-add-row { display: flex; gap: .5rem; }
.tag-add-input { flex: 1; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; font-family: inherit; outline: none; transition: border-color .15s; }
.tag-add-input:focus { border-color: var(--accent); }
/* Tätigkeit filter active */
#filter-taetigkeit.has-value { border-color: var(--accent); color: var(--accent); font-weight: 500; }
.card-verlustgrund { font-size: 11px; color: #b91c1c; font-style: italic; margin: .2rem 0 .35rem; padding-left: .5rem; border-left: 2px solid #ef4444; line-height: 1.35; }

/* USER WIDGET */
.user-widget { position: relative; }
.user-btn { display: flex; align-items: center; gap: .45rem; padding: .3rem .6rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--white); cursor: pointer; font-size: 13px; font-weight: 500; color: var(--dark); transition: all .15s; font-family: inherit; }
.user-btn:hover { background: var(--light); }
.user-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.user-name-display { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 200px; z-index: 150; padding: .3rem 0; }
.user-menu.open { display: block; }
.user-menu a { display: flex; align-items: center; gap: .6rem; padding: .5rem 1rem; font-size: 13px; color: var(--dark); cursor: pointer; text-decoration: none; transition: background .1s; }
.user-menu a:hover { background: var(--light); }
.user-menu-divider { height: 1px; background: var(--border); margin: .3rem 0; }

/* PROFILE MODAL */
.pw-section { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 1rem; margin-top: .25rem; }
.pw-section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--mid); margin-bottom: .75rem; }
.pw-wrap-inline { position: relative; }
.pw-wrap-inline input { padding-right: 2.5rem; }
.pw-toggle-inline { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--mid); padding: .2rem; border-radius: 4px; }
.pw-toggle-inline:hover { color: var(--dark); }
.field-hint { font-size: 11px; color: var(--mid); }

/* CONFIRM */
.confirm-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 300; align-items: center; justify-content: center; padding: 1rem; }
.confirm-backdrop.open { display: flex; }
.confirm-box { background: var(--white); border-radius: 10px; padding: 1.5rem; max-width: 380px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.2); text-align: center; }
.confirm-box h3 { font-size: 16px; margin-bottom: .5rem; }
.confirm-box p { color: var(--mid); font-size: 13px; margin-bottom: 1.5rem; }
.confirm-actions { display: flex; gap: .75rem; justify-content: center; }

/* TOAST */
#toast { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 400; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toast-item { background: var(--dark); color: #fff; padding: .65rem 1.1rem; border-radius: var(--radius); font-size: 13px; animation: toastIn .2s ease-out; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.toast-item.success { background: #15803d; }
.toast-item.error { background: #b91c1c; }
.toast-item.out { animation: toastOut .2s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* GROUP BLOCKS */
.group-block { display: flex; flex-direction: column; gap: .35rem; }
.group-card {
  background: var(--accent-bg); border-radius: 8px; padding: .85rem 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); cursor: pointer; user-select: none;
  transition: box-shadow .15s; border-left: 3px solid var(--accent); position: relative;
}
.group-card:hover { box-shadow: 0 4px 12px rgba(26,86,219,.18); }
.group-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .45rem; }
.group-label { display: inline-flex; align-items: center; gap: .2rem; background: var(--accent); color: #fff; border-radius: 99px; font-size: 9px; font-weight: 700; padding: .1rem .45rem; letter-spacing: .05em; text-transform: uppercase; }
.group-toggle-area { display: flex; align-items: center; gap: .3rem; }
.group-toggle-icon { color: var(--accent); font-size: 12px; line-height: 1; font-weight: 700; }
.group-card-title { font-size: 13px; font-weight: 600; color: var(--dark); margin-bottom: .3rem; line-height: 1.3; }
.group-card-wert { font-size: 15px; font-weight: 700; color: var(--accent); margin-bottom: .15rem; }
.group-card-meta { font-size: 11px; color: var(--mid); display: flex; align-items: center; gap: .3rem; }
/* Child list – eingerückt mit vertikaler Verbindungslinie */
.group-card-list { display: flex; flex-direction: column; gap: .35rem; padding-left: .8rem; border-left: 2px solid var(--accent); margin-left: .55rem; }
.group-card-list .deal-card { border-radius: 6px; }
.group-name-badge { display: inline-block; font-size: 9px; font-weight: 700; background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent); border-radius: 3px; padding: .05rem .3rem; letter-spacing: .03em; margin-left: .25rem; vertical-align: middle; }

/* ---- ACTIVITIES SECTION (Deal Modal) ---- */
.activities-section {
  margin-top: 1.2rem; border-top: 1px solid var(--border); padding-top: 1rem;
}

/* Änderungshistorie */
.changelog-section {
  margin-top: 1.2rem; border-top: 1px solid var(--border); padding-top: 1rem;
}
.changelog-section-title {
  display: flex; align-items: center; gap: .4rem; font-size: 13px; font-weight: 600;
  color: var(--dark); margin-bottom: .6rem; cursor: pointer; user-select: none;
}
.changelog-section-title svg { color: var(--mid); flex-shrink: 0; }
.changelog-toggle-hint { font-size: 11px; font-weight: 400; color: var(--mid); margin-left: auto; }

/* Benachrichtigung */
.notify-section { margin-top: 1.2rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.notify-section-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.notify-section-head svg { color: var(--mid); flex-shrink: 0; }
.notify-section-head span { font-size: 13px; font-weight: 600; flex: 1; }
.notify-toggle-wrap { margin-left: auto; display: flex; align-items: center; gap: .4rem; font-size: 12px; color: var(--mid); }
.notify-toggle { position: relative; display: inline-block; width: 32px; height: 18px; }
.notify-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.notify-slider { position: absolute; inset: 0; background: var(--border); border-radius: 99px; transition: background .15s; cursor: pointer; }
.notify-slider::after { content: ''; position: absolute; width: 12px; height: 12px; background: #fff; border-radius: 50%; left: 3px; top: 3px; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.notify-toggle input:checked + .notify-slider { background: var(--accent); }
.notify-toggle input:checked + .notify-slider::after { transform: translateX(14px); }
.notify-body { }
.notify-group-bar { display: flex; align-items: center; gap: .5rem; margin-bottom: .65rem; flex-wrap: wrap; }
.notify-group-bar label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mid); }
.notify-group-bar select { padding: .3rem .55rem; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: 12px; font-family: inherit; outline: none; background: var(--white); flex: 1; min-width: 0; }
.notify-group-bar select:focus { border-color: var(--accent); }
.notify-all-btns { display: flex; gap: .25rem; }
.notify-all-btns button { padding: .2rem .5rem; font-size: 11px; border: 1px solid var(--border); background: var(--white); border-radius: var(--radius); cursor: pointer; color: var(--mid); }
.notify-all-btns button:hover { background: var(--light); color: var(--dark); }
.notify-members { display: flex; flex-direction: column; gap: .35rem; max-height: 180px; overflow-y: auto; margin-bottom: .6rem; }
.notify-member { display: flex; align-items: center; gap: .55rem; padding: .35rem .5rem; border-radius: var(--radius); cursor: pointer; transition: background .1s; }
.notify-member:hover { background: var(--light); }
.notify-member input[type=checkbox] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; flex-shrink: 0; }
.notify-member-avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notify-member-info { flex: 1; min-width: 0; }
.notify-member-name { font-size: 12px; font-weight: 500; }
.notify-member-email { font-size: 11px; color: var(--mid); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notify-empty { font-size: 12px; color: var(--mid); text-align: center; padding: .5rem; }
.notify-extra-row { display: flex; flex-direction: column; gap: .25rem; }
.notify-extra-row label { font-size: 11px; color: var(--mid); font-weight: 500; }
.notify-extra-row input { padding: .35rem .6rem; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: 12px; font-family: inherit; outline: none; }
.notify-extra-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(26,86,219,.1); }
.notify-count { font-size: 11px; color: var(--accent); font-weight: 600; background: var(--accent-bg); padding: 1px 6px; border-radius: 99px; }

/* Compose-Mail-Sheet */
.compose-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 600; align-items: flex-end; justify-content: center; padding: 0; }
.compose-backdrop.open { display: flex; }
.compose-sheet {
  background: var(--white); border-radius: 14px 14px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.18);
  width: 100%; max-width: 560px; padding: 0;
  animation: sheetUp .22s ease-out;
  max-height: 90vh; overflow-y: auto;
}
@keyframes sheetUp { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.compose-header { padding: 1.1rem 1.5rem .75rem; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: .75rem; }
.compose-header-info { flex: 1; min-width: 0; }
.compose-header-title { font-size: 15px; font-weight: 700; }
.compose-header-deal { font-size: 12px; color: var(--mid); margin-top: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compose-close { background: none; border: none; cursor: pointer; color: var(--mid); padding: .2rem; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.compose-close:hover { background: var(--light); color: var(--dark); }
.compose-body { padding: 1.1rem 1.5rem; display: flex; flex-direction: column; gap: .9rem; }
.compose-field { display: flex; flex-direction: column; gap: .3rem; }
.compose-field label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mid); }
.compose-field input, .compose-field textarea {
  padding: .55rem .75rem; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 13px; font-family: inherit; outline: none; transition: border-color .15s; resize: none;
}
.compose-field input:focus, .compose-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,86,219,.1); }
.compose-rcpt-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.compose-rcpt-row select { flex: 1; min-width: 0; padding: .5rem .65rem; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: 13px; font-family: inherit; outline: none; background: var(--white); }
.compose-rcpt-row select:focus { border-color: var(--accent); }
.compose-rcpt-pills { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.compose-rcpt-pill { display: inline-flex; align-items: center; gap: .3rem; font-size: 11px; background: var(--accent-bg); color: var(--accent-dark); padding: .2rem .55rem .2rem .45rem; border-radius: 99px; font-weight: 500; }
.compose-rcpt-pill button { background: none; border: none; cursor: pointer; color: var(--accent); display: flex; padding: 0; line-height: 1; font-size: 13px; }
.compose-rcpt-pill button:hover { color: var(--red); }
.compose-footer { padding: .9rem 1.5rem 1.25rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.compose-footer-hint { font-size: 12px; color: var(--mid); }
.compose-deal-preview { background: var(--accent-bg); border: 1px solid #bfdbfe; border-radius: 8px; padding: .7rem 1rem; font-size: 12px; }
.compose-deal-preview-title { font-weight: 600; color: var(--dark); margin-bottom: .2rem; }
.compose-deal-preview-meta { color: var(--mid); }
.changelog-list { display: flex; flex-direction: column; gap: .4rem; max-height: 240px; overflow-y: auto; }
.changelog-entry {
  font-size: 12px; border-left: 2px solid var(--border); padding: .3rem .6rem;
  display: flex; flex-direction: column; gap: .15rem;
}
.changelog-meta {
  display: flex; align-items: center; gap: .4rem; color: var(--mid);
}
.changelog-user { font-weight: 600; color: var(--dark); }
.changelog-ts { color: var(--mid); }
.changelog-changes { display: flex; flex-direction: column; gap: .1rem; margin-top: .1rem; }
.changelog-change {
  display: flex; align-items: baseline; gap: .3rem; flex-wrap: wrap; color: var(--dark);
}
.changelog-field { font-weight: 600; min-width: 80px; color: var(--accent); }
.changelog-arrow { color: var(--mid); }
.changelog-val { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.changelog-val.new { color: #16a34a; }
.changelog-val.old { color: var(--mid); text-decoration: line-through; }
.changelog-created { color: #16a34a; font-weight: 600; font-size: 11px; }
.changelog-empty { font-size: 12px; color: var(--mid); text-align: center; padding: .8rem 0; }
.act-section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem;
}
.act-section-title {
  display: flex; align-items: center; gap: .4rem; font-size: 13px; font-weight: 600; color: var(--dark);
}
.act-count-badge {
  background: var(--accent-bg); color: var(--accent); font-size: 11px; font-weight: 600;
  padding: .1rem .4rem; border-radius: 99px; min-width: 18px; text-align: center;
}
.act-filter-tabs {
  display: flex; gap: 2px; background: #f1f5f9; border-radius: 4px; padding: 1px;
}
.act-filter-tab {
  font-size: 11px; padding: .15rem .5rem; border-radius: 3px; border: none;
  background: transparent; cursor: pointer; color: var(--mid); font-weight: 500;
  transition: all .15s;
}
.act-filter-tab.active { background: var(--white); color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }

/* Timeline items */
.act-timeline { display: flex; flex-direction: column; gap: .3rem; max-height: 260px; overflow-y: auto; padding-right: .2rem; }
.act-item {
  display: flex; align-items: center; gap: .5rem; padding: .45rem .5rem;
  border-radius: 6px; background: var(--white); border: 1px solid var(--border);
  transition: all .15s; cursor: default; font-size: 13px;
}
.act-item:hover { border-color: var(--accent); box-shadow: 0 1px 4px rgba(26,86,219,.1); }
.act-item.done { opacity: .55; }
.act-item.done .act-title { text-decoration: line-through; }
.act-checkbox {
  width: 18px; height: 18px; border-radius: 4px; border: 2px solid #cbd5e1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  flex-shrink: 0; transition: all .15s;
}
.act-checkbox:hover { border-color: var(--accent); }
.act-checkbox.checked { background: var(--accent); border-color: var(--accent); }
.act-icon { flex-shrink: 0; display: inline-flex; align-items: center; color: var(--mid); }
.act-title { flex: 1; font-size: 12px; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-deadline-badge {
  font-size: 10px; font-weight: 600; padding: .1rem .35rem; border-radius: 3px;
  white-space: nowrap; flex-shrink: 0;
}
.act-deadline-badge.overdue { background: var(--red-bg); color: var(--red); }
.act-deadline-badge.today { background: var(--orange-bg); color: var(--orange); }
.act-deadline-badge.upcoming { background: #f1f5f9; color: var(--mid); }
.act-deadline-badge.done { background: var(--green-bg); color: var(--green); }
.act-zustaendig { font-size: 10px; color: var(--mid); flex-shrink: 0; max-width: 60px; overflow: hidden; text-overflow: ellipsis; }
.act-delete {
  flex-shrink: 0; width: 18px; height: 18px; padding: 0; border: none; background: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: #cbd5e1; border-radius: 4px; transition: all .15s; line-height: 1;
}
.act-delete:hover { color: var(--red); background: var(--red-bg); }
.act-delete:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Quick-Add */
.act-add-btn {
  display: inline-flex; align-items: center; gap: .3rem; font-size: 12px;
  color: var(--accent); cursor: pointer; border: none; background: none;
  padding: .3rem 0; margin-top: .3rem; font-weight: 500;
}
.act-add-btn:hover { text-decoration: underline; }
.quick-add-form {
  margin-top: .4rem; padding: .6rem; border: 1px solid var(--border); border-radius: 6px;
  background: #fafbfc; display: none;
}
.quick-add-form.open { display: block; }
.quick-add-types {
  display: flex; gap: .25rem; margin-bottom: .4rem;
}
.quick-add-type-pill {
  font-size: 12px; padding: .2rem .5rem; border-radius: 99px; border: 1px solid var(--border);
  background: var(--white); cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; gap: .25rem;
}
.quick-add-type-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.quick-add-row {
  display: flex; gap: .3rem; align-items: center; flex-wrap: wrap;
}
.quick-add-row input, .quick-add-row select {
  font-size: 12px; padding: .3rem .45rem; border: 1px solid var(--border); border-radius: 4px;
  background: var(--white);
}
.quick-add-row input[type="text"] { flex: 1; min-width: 120px; }
.quick-add-row input[type="date"] { width: 120px; }
.quick-add-row select { width: 90px; }
.quick-add-actions {
  display: flex; gap: .3rem; flex-shrink: 0;
}

/* ===== ÄNDERUNGSPROTOKOLL PANEL ===== */
.protokoll-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35);
  z-index: 900; backdrop-filter: blur(2px);
}
.protokoll-backdrop.open { display: block; }
.protokoll-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: 460px; max-width: 100vw;
  background: var(--white); display: flex; flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,.15);
}
.protokoll-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.protokoll-header-title {
  display: flex; align-items: center; gap: .5rem;
  font-size: 15px; font-weight: 700; color: var(--dark);
}
.protokoll-header-title svg { color: var(--accent); }
.protokoll-close {
  background: none; border: none; cursor: pointer; color: var(--mid);
  padding: .3rem; border-radius: 4px; display: flex; align-items: center;
}
.protokoll-close:hover { background: var(--bg); color: var(--dark); }
.protokoll-filters {
  display: flex; flex-direction: column; gap: .5rem; padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.protokoll-period-row { display: flex; gap: 4px; flex-wrap: wrap; }
.protokoll-deal-row {
  display: flex; align-items: center; gap: .5rem;
}
.protokoll-deal-row label {
  font-size: 11px; font-weight: 600; color: var(--mid); white-space: nowrap;
}
.protokoll-deal-select {
  flex: 1; font-size: 12px; padding: .28rem .5rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--white); color: var(--dark); cursor: pointer;
  min-width: 0;
}
.protokoll-deal-select:focus { outline: none; border-color: var(--accent); }
.protokoll-period-btn {
  font-size: 12px; font-weight: 500; padding: .3rem .7rem; border-radius: 99px;
  border: 1px solid var(--border); background: var(--white); cursor: pointer;
  color: var(--mid); transition: all .15s;
}
.protokoll-period-btn:hover { border-color: var(--accent); color: var(--accent); }
.protokoll-period-btn.active {
  background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600;
}
.protokoll-body { flex: 1; overflow-y: auto; padding: 0 1.25rem 1.25rem; }
.protokoll-day-header {
  font-size: 11px; font-weight: 700; color: var(--mid); text-transform: uppercase;
  letter-spacing: .06em; padding: 1rem 0 .4rem; position: sticky; top: 0;
  background: var(--white); z-index: 1;
}
.protokoll-entry {
  padding: .65rem 0; border-bottom: 1px solid var(--border);
}
.protokoll-entry:last-child { border-bottom: none; }
.protokoll-entry-meta {
  display: flex; align-items: center; gap: .45rem; margin-bottom: .3rem;
}
.proto-avatar {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent-bg);
  color: var(--accent); font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.proto-user { font-size: 12px; font-weight: 600; color: var(--dark); }
.proto-time { font-size: 11px; color: var(--mid); margin-left: auto; }
.protokoll-entry-deal {
  font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer;
  display: inline-flex; align-items: center; gap: .3rem; margin-bottom: .25rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.protokoll-entry-deal:hover { text-decoration: underline; }
.protokoll-entry-changes { display: flex; flex-direction: column; gap: .15rem; }
.protokoll-change-row {
  display: flex; align-items: baseline; gap: .3rem; flex-wrap: wrap; font-size: 12px;
}
.protokoll-change-row.created { color: #16a34a; font-weight: 600; }
.pcr-field { font-weight: 600; color: var(--dark); min-width: 80px; }
.pcr-old { color: var(--mid); text-decoration: line-through; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcr-arrow { color: var(--mid); flex-shrink: 0; }
.pcr-new { color: #16a34a; font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.protokoll-empty { font-size: 13px; color: var(--mid); text-align: center; padding: 2.5rem 0; }
.protokoll-count { font-size: 11px; color: var(--mid); padding: .5rem 0 0; text-align: right; }
@media (max-width: 600px) { .protokoll-panel { width: 100vw; } }

/* Blocking overlay for mandatory next-step */
.ns-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 500; backdrop-filter: blur(2px); }
.ns-overlay.show { display: block; }
/* Next-step suggestion banner */
.next-step-banner {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .45rem .6rem; margin-bottom: .5rem;
  display: none; box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.next-step-banner.show { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.next-step-banner.blocking {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 501; max-width: 440px; width: calc(100% - 2rem);
  padding: .85rem 1rem; border: 2px solid #6366f1;
  box-shadow: 0 20px 60px rgba(0,0,0,.25); margin: 0;
}
.ns-tag { display: inline-flex; align-items: center; gap: .25rem; font-size: 10px; font-weight: 700; color: #6366f1; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; flex-shrink: 0; }
.ns-tag svg { width: 12px; height: 12px; }
.ns-sep { width: 1px; height: 16px; background: var(--border); flex-shrink: 0; }
.ns-chip {
  display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .5rem;
  border: 1px solid var(--border); border-radius: 99px; font-size: 11px; font-weight: 500;
  background: var(--light); cursor: pointer; transition: all .15s; white-space: nowrap; color: var(--dark);
}
.ns-chip:hover { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.ns-chip .ns-icon { display: inline-flex; color: var(--mid); }
.ns-chip:hover .ns-icon { color: var(--accent); }
.ns-chip .ns-sub { font-size: 10px; color: var(--mid); font-weight: 400; }
.ns-plus {
  display: inline-flex; align-items: center; gap: .2rem; padding: .2rem .45rem;
  border: 1px dashed var(--border); border-radius: 99px; font-size: 11px;
  color: var(--mid); cursor: pointer; transition: all .15s; white-space: nowrap; background: none;
}
.ns-plus:hover { border-color: var(--accent); color: var(--accent); }
.ns-close { background: none; border: none; padding: .15rem; cursor: pointer; color: var(--mid); margin-left: auto; flex-shrink: 0; line-height: 0; }
.ns-close:hover { color: var(--dark); }
.ns-close svg { width: 14px; height: 14px; }
.ns-custom-row {
  display: none; width: 100%; padding-top: .3rem; margin-top: .1rem;
  border-top: 1px solid var(--border);
}
.ns-custom-row.show { display: flex; align-items: center; gap: .3rem; }
.ns-custom-row select { font-size: 11px; padding: .2rem .3rem; border: 1px solid var(--border); border-radius: 4px; background: var(--white); }
.ns-custom-row input[type="text"] { flex: 1; font-size: 11px; padding: .2rem .4rem; border: 1px solid var(--border); border-radius: 4px; min-width: 80px; }
.ns-custom-row input[type="date"] { font-size: 11px; padding: .2rem .3rem; border: 1px solid var(--border); border-radius: 4px; width: 105px; }
.ns-custom-row .ns-go { font-size: 10px; font-weight: 600; padding: .2rem .45rem; border-radius: 4px; background: var(--accent); color: #fff; border: none; cursor: pointer; white-space: nowrap; }
.ns-custom-row .ns-go:hover { opacity: .85; }

/* Card next-step indicator */
.card-next-step {
  display: flex; align-items: center; gap: .3rem; font-size: 10px;
  margin-top: .35rem; padding-top: .35rem; border-top: 1px dashed var(--border);
}
.card-next-step .cns-icon { flex-shrink: 0; display: inline-flex; align-items: center; color: var(--mid); }
.card-next-step .cns-icon svg { width: 11px; height: 11px; }
.card-next-step .cns-text { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--mid); }
.card-next-step .cns-date { font-weight: 600; flex-shrink: 0; }
.card-next-step .cns-edit { display: inline-flex; visibility: hidden; margin-left: auto; flex-shrink: 0; color: var(--mid); cursor: pointer; padding: 1px; border-radius: 3px; line-height: 0; }
.card-next-step .cns-edit:hover { color: var(--accent); }
.card-next-step:hover .cns-edit { visibility: visible; }
.card-next-step .cns-person { flex-shrink: 0; font-weight: 700; }
.card-next-step .cns-others { flex-shrink: 0; color: var(--mid); }
.card-next-step .cns-olink { cursor: pointer; font-weight: 700; }
.card-next-step .cns-olink:hover { text-decoration: underline; color: var(--accent); }
.card-next-step.overdue .cns-date,
.card-next-step.overdue .cns-text,
.card-next-step.overdue .cns-icon { color: var(--red); }
.card-next-step.today .cns-date,
.card-next-step.today .cns-text,
.card-next-step.today .cns-icon { color: var(--orange); }
.card-next-step.upcoming .cns-date,
.card-next-step.upcoming .cns-text,
.card-next-step.upcoming .cns-icon { color: var(--green); }
.act-empty { font-size: 12px; color: var(--mid); text-align: center; padding: 1rem 0; }

/* Card Activity Popover */
.card-act-popover-overlay { position: fixed; inset: 0; z-index: 499; background: transparent; }
.card-act-popover {
  position: fixed; z-index: 500; background: var(--white); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.18); padding: .7rem; width: 310px;
}
.card-act-popover-header {
  display: flex; align-items: center; gap: .4rem; margin-bottom: .5rem;
  font-size: 12px; font-weight: 600; color: var(--dark);
}
.card-act-popover-header .cap-deal { color: var(--accent); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- MOBILE NAV ---- */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: .35rem; border-radius: var(--radius); color: var(--mid); flex-shrink: 0; }
.hamburger:hover { background: var(--light); color: var(--dark); }
.mobile-menu { display: none; position: fixed; top: var(--header-h); left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 99; padding: .5rem; }
.mobile-menu.open { display: block; }
.mobile-menu a { display: flex; align-items: center; gap: .6rem; padding: .65rem .85rem; text-decoration: none; color: var(--dark); font-size: 14px; font-weight: 500; border-radius: var(--radius); transition: background .1s; }
.mobile-menu a:hover { background: var(--light); }
.mobile-menu a.active { background: var(--accent-bg); color: var(--accent); }
.mobile-menu .mm-divider { height: 1px; background: var(--border); margin: .35rem 0; }
.mobile-menu .mm-action { color: var(--accent); font-weight: 600; }
@media (max-width: 768px) {
  .hamburger { display: flex; align-items: center; justify-content: center; }
  nav { display: none !important; }
  .header-right .btn, .header-actions .btn { display: none !important; }
  .header-inner { gap: .75rem; padding: 0 .75rem; }
  .logo-divider, .page-title { display: none; }
}

/* ===== PDF IMPORT MODAL ===== */
.drop-zone {
  border: 2px dashed var(--border); border-radius: 8px; padding: 2.5rem 1.5rem;
  text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--accent); background: var(--accent-bg); }
.drop-zone .dz-icon { color: var(--mid); margin-bottom: .75rem; display: flex; justify-content: center; }
.drop-zone .dz-label { font-size: 14px; font-weight: 600; color: var(--dark); margin-bottom: .35rem; }
.drop-zone .dz-sub { font-size: 12px; color: var(--mid); }
.import-progress { display: none; text-align: center; padding: 2rem 1rem; }
.import-progress.show { display: block; }
.import-progress .imp-spinner { display: flex; justify-content: center; margin-bottom: .75rem; }
.import-progress .imp-label { font-size: 13px; color: var(--mid); }
.import-result { display: none; }
.import-result.show { display: block; }
.ir-deal { background: var(--light); border-radius: 8px; padding: .9rem 1rem; }
.ir-deal-titel { font-weight: 600; font-size: 14px; color: var(--dark); margin-bottom: .35rem; }
.ir-deal-meta { font-size: 12px; color: var(--mid); display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .3rem; }
/* PDF badge on cards */
.card-pdf-badge {
  display: inline-flex; align-items: center; gap: .2rem; font-size: 10px;
  color: var(--accent); font-weight: 600; padding: .1rem .3rem; border-radius: 3px;
  background: var(--accent-bg); margin-left: .35rem; cursor: pointer; vertical-align: middle;
  line-height: 1.4; white-space: nowrap;
}
.card-pdf-badge:hover { opacity: .75; }
/* PDF link in deal modal */
.modal-pdf-link {
  display: flex; align-items: center; gap: .5rem; padding: .55rem .85rem;
  background: var(--accent-bg); border: 1px solid var(--accent);
  border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--accent);
  cursor: pointer; text-decoration: none; transition: opacity .15s;
}
.modal-pdf-link:hover { opacity: .8; }

/* ===== PRINT / PDF REPORT ===== */
#print-report { display: none; }
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body > *:not(#print-report) { display: none !important; }
  #print-report {
    display: block !important; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 11px; color: #1a1a1a; padding: 0; margin: 0;
  }
  .rpt-header { display: flex; justify-content: space-between; align-items: flex-end;
    border-bottom: 2px solid #1a56db; padding-bottom: .6rem; margin-bottom: 1.2rem; }
  .rpt-logo { font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
  .rpt-logo span { color: #1a56db; }
  .rpt-meta { text-align: right; font-size: 10px; color: #555; line-height: 1.6; }
  .rpt-title { font-size: 14px; font-weight: 700; margin-bottom: 1rem; }
  .rpt-section { margin-bottom: 1.4rem; }
  .rpt-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: #555; margin-bottom: .4rem; border-bottom: 1px solid #e0e0e0; padding-bottom: .2rem; }
  .rpt-table { width: 100%; border-collapse: collapse; font-size: 10px; }
  .rpt-table th { background: #f0f4f8; text-align: left; padding: .3rem .5rem;
    font-weight: 600; font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
  .rpt-table td { padding: .3rem .5rem; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
  .rpt-table tr:last-child td { border-bottom: none; }
  .rpt-table .num { text-align: right; font-variant-numeric: tabular-nums; }
  .rpt-table .bold { font-weight: 700; }
  .rpt-table .muted { color: #888; }
  .rpt-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; flex-shrink: 0; }
  .rpt-badge { display: inline-block; padding: .1rem .35rem; border-radius: 3px; font-size: 9px; font-weight: 600; margin: 1px; }
  .rpt-footer { margin-top: 2rem; padding-top: .5rem; border-top: 1px solid #e0e0e0;
    font-size: 9px; color: #aaa; display: flex; justify-content: space-between; }
  .rpt-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-bottom: 1.4rem; }
  .rpt-kpi { border: 1px solid #e0e0e0; border-radius: 4px; padding: .5rem .7rem; }
  .rpt-kpi-label { font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: #555; margin-bottom: .2rem; }
  .rpt-kpi-val { font-size: 15px; font-weight: 700; }
  @page { margin: 1.5cm 1.5cm 1.5cm 1.5cm; size: A4; }
}

/* ===================================================================
   Ergänzungen wzb-crm (Vorlage oben = WERZ/Demo-CSS, unverändert übernommen)
   CSP erlaubt keine Inline-Styles in HTML → alles über Klassen bzw. CSS-Variablen.
   =================================================================== */
[hidden] { display: none !important; }
/* Phasenfarben kommen aus den Stammdaten (--phase-farbe per styleMap) statt fester Klassen */
.kanban-col .col-header { border-top: 3px solid var(--phase-farbe, #94a3b8); }
.kanban-col .deal-card { border-left-color: var(--phase-farbe, #94a3b8); }
.status-pill.active { background: var(--phase-farbe, var(--accent)); border-color: var(--phase-farbe, var(--accent)); }
.col-leer { text-align: center; color: var(--mid); font-size: 12px; padding: 1.5rem .5rem; }
.header-btn-klein { font-size: 11px; padding: .35rem .6rem; display: flex; align-items: center; gap: .3rem; }
.modal.breit { max-width: 720px; }
.feld-hinweis { font-size: 11px; color: var(--mid); }
.abschnitt { margin-top: 1.2rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.abschnitt-titel { display: flex; align-items: center; gap: .4rem; font-size: 13px; font-weight: 600; margin-bottom: .6rem; cursor: pointer; user-select: none; }
.abschnitt-titel .rechts { margin-left: auto; font-size: 11px; font-weight: 400; color: var(--mid); }
.datei-liste { display: flex; flex-direction: column; gap: .3rem; }
.datei-liste a { display: inline-flex; align-items: center; gap: .4rem; font-size: 12px; color: var(--accent); text-decoration: none; }
.datei-liste a:hover { text-decoration: underline; }
.akt-neu { display: flex; gap: .5rem; margin-top: .5rem; }
.akt-neu input[type=text] { flex: 1; }
.akt-neu select, .akt-neu input[type=date] { width: auto; }
.prot-eintrag { font-size: 12px; padding: .4rem .6rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); }
.prot-kopf { display: flex; gap: .5rem; color: var(--mid); font-size: 11px; margin-bottom: .15rem; }
.prot-kopf b { color: var(--dark); }
.neu-unternehmen { margin-top: .4rem; }
.import-zone { border: 2px dashed var(--border); border-radius: 10px; padding: 2rem 1rem; text-align: center; color: var(--mid); cursor: pointer; transition: all .15s; }
.import-zone:hover, .import-zone.drag { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.import-zone input { display: none; }
.check-inline { display: flex; align-items: center; gap: .5rem; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--dark); font-weight: 400; }
.zf-ja-nein { accent-color: var(--accent); width: 15px; height: 15px; }
.col-prob.nur-lesen { cursor: default; }
.col-prob.nur-lesen:hover { background: rgba(0,0,0,.22); }
.deal-card.drop-davor { box-shadow: 0 -3px 0 0 var(--accent), 0 1px 3px rgba(0,0,0,.1) !important; }
.deal-card.drop-danach { box-shadow: 0 3px 0 0 var(--accent), 0 1px 3px rgba(0,0,0,.1) !important; }
.user-menu a.rot { color: var(--red); }
.nav-bald { opacity: .45; pointer-events: none; }

/* ---- Tabellen-Seiten (Vorlage: WERZ unternehmen.html / kontakte.html / benutzer.html) ---- */
main { padding: calc(var(--header-h) + 1.5rem) 1.5rem 2rem; }
.stat-bar { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.stat { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1.2rem; display: flex; flex-direction: column; gap: .15rem; min-width: 120px; }
.stat-num { font-size: 22px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--mid); font-weight: 500; }
.toolbar { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar .search-wrap { flex: 1; min-width: 200px; max-width: 400px; }
.toolbar input, .toolbar select { height: 34px; box-sizing: border-box; font-size: 13px; }
.toolbar input.search-input { width: 100%; padding: 0 .75rem 0 42px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); outline: none; transition: border-color .15s; font-size: 13px; }
.toolbar input.search-input:focus { border-color: var(--accent); }
.toolbar .filter-select { padding: 0 .75rem; }
.result-count { margin-left: auto; font-size: 12px; color: var(--mid); white-space: nowrap; }
.table-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--light); padding: .65rem 1rem; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--mid); border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; cursor: pointer; }
th:hover { color: var(--dark); }
th.sorted { color: var(--accent); }
th .sort-icon { display: inline-block; margin-left: .3rem; opacity: .5; }
th.sorted .sort-icon { opacity: 1; }
th.ohne-sort { cursor: default; }
td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafafa; }
tbody tr.klickbar { cursor: pointer; }
.td-name { font-weight: 500; }
.td-actions { text-align: right; white-space: nowrap; }
.td-mid { color: var(--mid); }
.td-link { color: var(--accent); text-decoration: none; }
.td-link:hover { text-decoration: underline; }
.empty-row td { text-align: center; color: var(--mid); padding: 3rem; font-style: italic; }
.badge { display: inline-block; padding: .2rem .55rem; border-radius: 99px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge-blue { background: var(--accent-bg); color: var(--accent); }
.badge-gray { background: var(--light); color: var(--mid); border: 1px solid var(--border); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-violet { background: #f3e8ff; color: #7c3aed; }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-liste { display: flex; flex-wrap: wrap; gap: .25rem; }
.btn-sm { padding: .3rem .7rem; font-size: 12px; }
input[type=email], input[type=url], input[type=tel], input[type=password] {
  padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: inherit; outline: none; transition: border-color .15s;
  background: var(--white); color: var(--dark); width: 100%;
}
.aktion-menue { position: relative; display: inline-block; }
.aktion-liste { position: absolute; right: 0; top: calc(100% + 4px); background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 220px; z-index: 50; padding: .3rem 0; text-align: left; }
.aktion-liste button { display: block; width: 100%; text-align: left; background: none; border: none; padding: .5rem 1rem; font-size: 13px; cursor: pointer; font-family: inherit; color: var(--dark); }
.aktion-liste button:hover { background: var(--light); }
.aktion-liste button.rot { color: var(--red); }
.modal.schmal { max-width: 460px; }
.pw-zeile { display: flex; gap: .5rem; }
.pw-zeile input { flex: 1; }
.hinweis-box { font-size: 12px; color: var(--mid); background: var(--light); border-radius: var(--radius); padding: .6rem .8rem; line-height: 1.45; }
/* Aufgeklapptes Aktionen-Menü darf aus der Tabelle herausragen */
.table-card.menue-offen, .table-card.menue-offen .table-wrap { overflow: visible; }
.filter-select.has-value { border-color: var(--accent); color: var(--accent); font-weight: 500; }
.akt-neu { flex-wrap: wrap; }
.akt-neu select[name=zustaendig] { max-width: 150px; }
.rev-modal .modal-header .filter-select { margin-left: auto; margin-right: .5rem; height: 30px; }
.toggle-btn.active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }
.td-check { width: 36px; }
.td-check .act-checkbox { display: inline-flex; }
.typ-badge { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--mid); }
.faellig-ueber { color: var(--red); font-weight: 600; }
.faellig-heute { color: var(--orange); font-weight: 600; }
tr.erledigt td { opacity: .5; }
tr.erledigt .td-name { text-decoration: line-through; }
.phase-punkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .35rem; background: var(--phase-farbe, #94a3b8); }
/* Stammdaten */
.sd-abschnitt { margin-bottom: 2rem; }
.sd-abschnitt h2 { font-size: 15px; font-weight: 700; margin-bottom: .25rem; }
.sd-abschnitt .sd-hinweis { font-size: 12px; color: var(--mid); margin-bottom: .75rem; max-width: 820px; line-height: 1.45; }
.sd-tabelle td { padding: .45rem .75rem; }
.sd-tabelle input[type=text], .sd-tabelle input[type=number], .sd-tabelle select { padding: .35rem .5rem; font-size: 13px; }
.sd-tabelle input[type=number] { width: 80px; }
.sd-tabelle input[type=color], .wort-chip input[type=color] { width: 32px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; }
.sd-neu { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; padding: .75rem; border-top: 1px solid var(--border); background: var(--light); }
.sd-neu input[type=text] { width: auto; flex: 1; min-width: 160px; padding: .4rem .6rem; font-size: 13px; }
.sd-neu select { width: auto; padding: .4rem .6rem; font-size: 13px; }
.sd-reihe { display: inline-flex; flex-direction: column; gap: 1px; }
.sd-reihe button { border: none; background: var(--light); border-radius: 3px; cursor: pointer; padding: 0 .3rem; line-height: 1.1; color: var(--mid); }
.sd-reihe button:hover:not(:disabled) { background: var(--accent); color: #fff; }
.sd-reihe button:disabled { opacity: .3; cursor: default; }
.wort-gruppe { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .75rem; }
.wort-gruppe-kopf { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
.wort-gruppe-kopf input[type=text] { max-width: 260px; padding: .35rem .5rem; font-size: 13px; font-weight: 600; }
.wort-liste { display: flex; flex-wrap: wrap; gap: .5rem; padding: .75rem; }
.wort-chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--border); border-radius: 99px; padding: .2rem .35rem .2rem .25rem; background: var(--white); }
.wort-chip input[type=color] { width: 22px; height: 22px; border-radius: 50%; overflow: hidden; }
.wort-chip input[type=text] { border: none; padding: .1rem .2rem; font-size: 12px; width: 9rem; }
.wort-chip button { border: none; background: none; cursor: pointer; color: var(--mid); padding: 0 .2rem; font-size: 14px; line-height: 1; }
.wort-chip button:hover { color: var(--red); }
.sd-schluessel { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--mid); }
.sd-neu input[type=number] { width: 80px; flex: none; padding: .4rem .5rem; font-size: 13px; }
.sd-neu input[type=color] { width: 36px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; flex: none; }
.sd-tabelle td input[type=text] { min-width: 160px; }

/* Paket 3 (03.11.2026): Summenleiste wie Krieger-Fassung, Zusatzfelder auf der Karte, Aktivitäten */
.sum-val.sum-gewichtet { color: #7c3aed; }
.sum-val.sum-gewonnen { color: #0d9488; }
.sum-val.sum-gesamt { color: var(--accent); }
.sum-klein { font-size: 11px; font-weight: 500; color: var(--mid); }
.card-badge.card-zusatz { background: #fef3c7; color: #92400e; }
.act-kontakt { color: var(--mid); font-weight: 400; }
.ns-custom-row.show { display: flex; flex-wrap: wrap; gap: .35rem; width: 100%; margin-top: .35rem; }
tr.gruppen-kopf td { background: var(--light); font-size: 12px; padding-top: .55rem; padding-bottom: .55rem; }
.deal-panel-info { display: grid; gap: .35rem; font-size: 13px; padding: .75rem 1rem; }
.deal-panel-info .td-mid { display: inline-block; min-width: 120px; }
.deal-panel-aktionen { display: flex; gap: .5rem; padding: 1rem; }
.vorschlag-zeile { display: flex; align-items: center; gap: .5rem; margin: 0 0 .75rem; flex-wrap: wrap; }
.vorschlag-zeile .next-step-banner { flex: 1; }
.compose-empfaenger { display: flex; flex-direction: column; gap: .3rem; }
.compose-titel { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mid); }
/* Empfängerzeilen sind <label> (Klick auf die Zeile setzt das Häkchen) – nicht wie Feldbeschriftungen formatieren */
label.notify-member { text-transform: none; letter-spacing: normal; font-size: 12px; font-weight: 400; color: var(--dark); }

/* Anhänge an Deals (17.11.2026) */
.datei-zeile { display: flex; align-items: center; gap: .5rem; }
.datei-zeile .btn-icon { padding: .2rem; }
.datei-info { font-size: 11px; color: var(--mid); }
.anhang-zeile { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.abschnitt.anhaenge.ziehen { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: var(--radius); }
.sd-anhaenge { padding: 1rem; display: flex; flex-direction: column; gap: .9rem; max-width: 820px; }
.sd-feld { display: flex; flex-direction: column; gap: .35rem; font-size: 13px; font-weight: 600; }
.sd-feld input[type="number"] { width: 7rem; }
.sd-check { display: flex; align-items: center; gap: .45rem; font-size: 13px; font-weight: 400; cursor: pointer; }
