/* =========================================================================
   MM24 CRM — UI System (Salesforce Lightning-inspiriert)
   ========================================================================= */

:root {
  /* ---------- MM24 Corporate Identity ---------- */
  --brand: #0d9488;           /* MM24 Teal */
  --brand-dark: #0a6e66;
  --brand-hover: #0f8077;
  --brand-subtle: rgba(13,148,136,0.12);
  --brand-border: rgba(13,148,136,0.28);
  --brand-glow: rgba(13,148,136,0.35);
  --accent: #f59e0b;          /* MM24 Orange — für Akzente */
  --accent-subtle: rgba(245,158,11,0.14);

  --bg-page: #f7faf9;         /* dezent teal-gehaucht */
  --bg-card: #ffffff;
  --bg-sidebar: #0b1f25;      /* dunkles Anthrazit mit Teal-Stich */
  --bg-sidebar-hover: #14343e;
  --bg-sidebar-active: #0d9488;
  --bg-topbar: #061215;
  --bg-muted: #f3f6f5;

  --border: #e1e7e5;
  --border-strong: #c9d2cf;

  --text: #0f1a1e;
  --text-muted: #5a6b6f;
  --text-invert: #ffffff;
  --text-link: #0d9488;

  --success: #04844b;
  --success-bg: #dff5ea;
  --warning: #b07c24;
  --warning-bg: #fef0c9;
  --error: #ba0517;
  --error-bg: #fee1e3;
  --info: #0d9488;
  --info-bg: var(--brand-subtle);
  --purple: #8149db;
  --purple-bg: #f3eefb;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 2px 4px rgba(0,0,0,0.08), 0 0 1px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  --radius: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --sidebar-w: 260px;
  --topbar-h: 52px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg-page); color: var(--text);
  font-family: var(--font); font-size: 13px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* =============== MM24 Icon-System =============== */
.ico { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; vertical-align: middle; }
.ico-lg { width: 20px; height: 20px; }
.ico-xl { width: 28px; height: 28px; }
.ico-sm { width: 14px; height: 14px; }
.ico-missing { display: inline-block; width: 16px; text-align: center; opacity: 0.4; }

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }

button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }

/* =============== Layout (Flexbox-Shell — robust, Vollbild) =============== */
:root { --objnav-h: 48px; }

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;        /* Vollhöhe; interner Scroll in .main */
  min-height: 100vh;
  overflow: hidden;     /* verhindert Doppel-Scrollbar */
}
/* Reihenfolge: topbar -> objectnav -> app-body(row: sidebar + main) */
.topbar    { flex: 0 0 auto; }
.objectnav { flex: 0 0 auto; }

/* Body-Zeile: füllt die Resthöhe, enthält Sidebar + Main nebeneinander */
.app-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  min-height: 0;        /* erlaubt Kinder-Scroll in Flexbox */
}

.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
}
.main {
  flex: 1 1 auto;
  min-width: 0;         /* verhindert Überlauf durch breite Inhalte */
  overflow-y: auto;     /* interner Scroll, Topbar/Objectnav bleiben fix */
  overflow-x: hidden;
}

/* Sidebar einklappbar */
.app.sidebar-collapsed .sidebar {
  flex-basis: 0;
  width: 0;
  border-right: none;
  overflow: hidden;
  padding: 0;
}

/* =============== Topbar =============== */
.topbar {
  background: var(--bg-topbar);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  min-width: 210px;
}
.brand .brand-logo { background: var(--brand); color: #fff;
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 5px; font-weight: 800; font-size: 12px; letter-spacing: 0.5px; }
.brand .brand-logo-img {
  height: 32px !important; width: 32px !important;
  max-width: 32px !important; max-height: 32px !important;
  min-width: 0 !important; min-height: 0 !important;
  display: block !important; object-fit: contain !important;
  flex-shrink: 0 !important;
  border-radius: 4px;
}
.brand .brand-sub { font-weight: 400; font-size: 11px; color: #a8c1e4; letter-spacing: 0.5px; }

/* Hamburger / Sidebar-Toggle */
.sidebar-toggle {
  flex: 0 0 auto;
  width: 36px; height: 34px;
  padding: 0;
  display: grid; place-items: center;
}
.hamburger-ico { display: flex; flex-direction: column; gap: 3px; width: 18px; }
.hamburger-ico span {
  display: block; height: 2px; width: 100%;
  background: currentColor; border-radius: 2px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.global-search { flex: 1; max-width: 640px; position: relative; }
.global-search input {
  width: 100%; padding: 7px 12px 7px 36px;
  background: rgba(255,255,255,0.95); border: 1px solid transparent;
  border-radius: 4px; color: var(--text); font-size: 13px;
}
.global-search input:focus { outline: none; border-color: var(--brand); background: #fff; }
.global-search::before {
  content: "🔍"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 12px; opacity: 0.55; pointer-events: none;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-btn {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 12px; border-radius: 4px; font-size: 13px;
  display: flex; align-items: center; gap: 6px;
}
.topbar-btn:hover { background: rgba(255,255,255,0.1); }
.topbar-btn.primary { background: var(--brand); border-color: var(--brand); }
.topbar-btn.primary:hover { background: var(--brand-hover); }

.user-menu { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 4px; cursor: default; }
.user-menu:hover { background: rgba(255,255,255,0.1); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-info .name { font-size: 13px; color: #fff; }
.user-info .role { font-size: 10px; color: #a8c1e4; text-transform: uppercase; letter-spacing: 0.5px; }
.user-menu .logout { color: #a8c1e4; font-size: 12px; text-decoration: none; padding: 4px 8px; border-radius: 3px; }
.user-menu .logout:hover { background: rgba(255,255,255,0.15); color: #fff; }

.dev-badge { background: #fef0c9; color: #814400; font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 600; letter-spacing: 0.3px; }

/* =============== Sidebar =============== */
.sidebar {
  background: var(--bg-sidebar); color: #cfd9ec;
  overflow-y: auto;
  padding: 10px 0;
  display: flex; flex-direction: column;
  transition: flex-basis 0.18s ease, width 0.18s ease;
}
.nav-section { margin-bottom: 18px; }
.nav-section-title { padding: 10px 20px 6px; font-size: 10px; font-weight: 700;
  color: #8ea2c0; text-transform: uppercase; letter-spacing: 1.2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 20px;
  color: #e4ebf7; text-decoration: none; font-size: 13px;
  border-left: 3px solid transparent;
  transition: background 0.12s;
}
.nav-item:hover { background: var(--bg-sidebar-hover); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(21,137,238,0.15); color: #fff; border-left-color: var(--brand); font-weight: 500; }
.nav-item .icon { width: 18px; display: grid; place-items: center; opacity: 0.95; font-size: 15px; }
.nav-item .badge {
  margin-left: auto; background: rgba(255,255,255,0.15); color: #fff;
  font-size: 11px; padding: 1px 7px; border-radius: 10px; min-width: 22px; text-align: center;
}
.nav-item.active .badge { background: var(--brand); }

/* =============== Main content (Vollbreite + Vollhöhe) =============== */
.main-inner {
  padding: 18px 24px 32px;
  width: 100%; max-width: none; margin: 0;
  min-height: 100%;
  display: flex; flex-direction: column;
}
/* Direkte Block-Kinder behalten ihr normales Verhalten (kein Schrumpfen) */
.main-inner > * { flex-shrink: 0; }
/* Das Opportunity-Board darf die Resthöhe fuellen */
.main-inner > .kanban:not(.kanban-lead) { flex: 1 1 auto; min-height: 0; }

.page-header {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 14px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.page-header .page-icon {
  width: 40px; height: 40px; border-radius: 6px;
  background: var(--brand-subtle); color: var(--brand);
  display: grid; place-items: center; font-size: 22px;
}
.page-header .page-title { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.page-header .page-title .eyebrow { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; }
.page-header .page-title h1 { font-size: 22px; font-weight: 400; color: var(--text); }
.page-header .page-title h1 b { font-weight: 600; }
.page-header .page-actions { display: flex; gap: 8px; }

/* =============== Subtab Nav (SF-Style) =============== */
.subtabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
  background: var(--bg-card);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0 4px;
}
.subtabs a {
  position: relative;
  padding: 12px 16px;
  color: var(--text-muted); text-decoration: none;
  font-size: 13px; font-weight: 500;
  border-bottom: 3px solid transparent;
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
  transition: color 0.15s;
}
.subtabs a:hover { color: var(--text); text-decoration: none; }
.subtabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.subtabs a .subtab-count {
  font-size: 11px; padding: 1px 7px; border-radius: 10px;
  background: var(--bg-muted); color: var(--text-muted);
  min-width: 22px; text-align: center;
}
.subtabs a.active .subtab-count { background: var(--brand-subtle); color: var(--brand); }
.subtabs a .subtab-icon { font-size: 14px; }

/* =============== Buttons =============== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: all 0.12s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-muted); border-color: var(--border-strong); text-decoration: none; color: var(--text); }
.btn:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.success:hover { background: #03663a; border-color: #03663a; color: #fff; }
.btn.danger { background: var(--error); border-color: var(--error); color: #fff; }
.btn.danger:hover { background: #930314; color: #fff; }
.btn.neutral-strong { background: var(--bg-muted); border-color: var(--border-strong); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn.ghost:hover { background: var(--bg-muted); color: var(--text); border-color: transparent; }
.btn.sm { padding: 3px 10px; font-size: 12px; }
.btn.lg { padding: 8px 18px; font-size: 14px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; border-right-width: 0; }
.btn-group .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.btn-group .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-right-width: 1px; }

/* =============== Cards =============== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600;
}
.card-header h3 { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.card-header .icon { color: var(--brand); }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }
.card-footer { padding: 10px 16px; border-top: 1px solid var(--border); background: var(--bg-muted); font-size: 12px; color: var(--text-muted); }

/* =============== Pills / Status-Badges =============== */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 2px 10px; border-radius: 12px;
  letter-spacing: 0.2px;
}
.pill::before { content: "•"; font-size: 16px; line-height: 0; margin-top: 2px; }
.pill.neu        { background: var(--info-bg);    color: var(--info); }
.pill.termin     { background: var(--success-bg); color: var(--success); }
.pill.quali      { background: var(--success-bg); color: var(--success); }
.pill.ungeeignet { background: var(--warning-bg); color: var(--warning); }
.pill.muell      { background: var(--error-bg);   color: var(--error); }
.pill.emaillist  { background: var(--purple-bg);  color: var(--purple); }
.pill.riva       { background: var(--warning-bg); color: var(--warning); }
.pill.closed     { background: #f3f3f3;           color: var(--text-muted); }

.pill-plain { padding: 2px 8px; font-size: 11px; border-radius: 3px; font-weight: 500;
  background: var(--bg-muted); color: var(--text-muted); border: 1px solid var(--border);
  display: inline-block; }

/* =============== Tables =============== */
.table-wrap { background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
table.data {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
table.data thead th {
  text-align: left; padding: 10px 14px;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.6px;
  white-space: nowrap;
}
table.data tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tbody tr { cursor: pointer; transition: background 0.1s; }
table.data tbody tr:hover { background: #fbfaff; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.name { font-weight: 500; color: var(--text-link); }
table.data td.muted { color: var(--text-muted); }
table.data td.num { font-variant-numeric: tabular-nums; text-align: right; }
table.data .table-pager { padding: 10px 14px; display: flex; justify-content: space-between;
  background: var(--bg-muted); font-size: 12px; color: var(--text-muted); }

/* =============== List-Filter Row =============== */
.list-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.list-toolbar .result-count { font-size: 12px; color: var(--text-muted); margin-right: 12px; }
.list-toolbar .search {
  padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; width: 260px; background: var(--bg-muted);
}
.list-toolbar .search:focus { outline: none; border-color: var(--brand); background: #fff; }
.list-toolbar .spacer { flex: 1; }

/* =============== Detail Page (Highlights + Path + 2-col Layout) =============== */

.highlights {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.highlights .hl-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--brand-subtle); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; font-size: 20px;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border);
}
.highlights .hl-main { min-width: 0; }
.highlights .hl-type { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); }
.highlights .hl-name { font-size: 22px; font-weight: 500; margin-top: 2px; color: var(--text); }
.highlights .hl-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.highlights .hl-meta .meta-key { font-weight: 600; color: var(--text-muted); margin-right: 4px; letter-spacing: 0.2px; text-transform: uppercase; font-size: 10px; }
.highlights .hl-meta .meta-val { color: var(--text); }
.highlights .hl-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Path Indicator (Salesforce Path Component) */
.path {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.path-step {
  flex: 1;
  position: relative;
  padding: 12px 10px 12px 28px;
  background: #fff;
  color: var(--text-muted);
  text-align: center;
  font-size: 12px; font-weight: 500;
  border-right: 1px solid var(--border);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
  margin-right: -12px;
  display: flex; align-items: center; justify-content: center;
  min-height: 38px;
}
.path-step:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); }
.path-step:last-child  { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%); border-right: none; margin-right: 0; }
.path-step.done { background: var(--success); color: #fff; }
.path-step.current { background: var(--brand); color: #fff; font-weight: 700; box-shadow: inset 0 -3px 0 var(--brand-dark); }
.path-step.lost { background: var(--error); color: #fff; }

/* Detail-Grid */
.detail-grid { display: grid; grid-template-columns: 1fr 380px; gap: 14px; }
@media (max-width: 1100px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: none;
}
.detail-tabs a {
  padding: 10px 18px; color: var(--text-muted); text-decoration: none;
  border-bottom: 3px solid transparent; font-size: 13px; font-weight: 500;
}
.detail-tabs a:hover { color: var(--text); text-decoration: none; }
.detail-tabs a.active { color: var(--brand); border-bottom-color: var(--brand); background: var(--bg-muted); }

.detail-body {
  background: var(--bg-card); border: 1px solid var(--border); border-top: none;
  padding: 18px; border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; }
.field-grid.narrow { grid-template-columns: 1fr; }
.field-row { display: flex; flex-direction: column; gap: 4px; }
.field-row label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.field-row .value { padding: 6px 0; font-size: 13px; color: var(--text); border-bottom: 1px dashed transparent; }
.field-row.editable .value { border-bottom-color: var(--border); cursor: text; }
.field-row.editable .value:hover { background: var(--bg-muted); }
.field-row .value.muted { color: var(--text-muted); }

.form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-row label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input[type="date"], input[type="datetime-local"],
textarea, select {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; font-size: 13px; color: var(--text); font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21,137,238,0.15); }
textarea { resize: vertical; min-height: 72px; line-height: 1.5; }

/* =============== Activity Timeline (Chatter-Style) =============== */
.timeline { display: flex; flex-direction: column; gap: 0; padding: 0; }
.timeline-item {
  display: grid; grid-template-columns: 32px 1fr; gap: 12px;
  position: relative;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; padding-bottom: 0; }
.timeline-dot {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-subtle); color: var(--brand);
  display: grid; place-items: center; font-size: 14px;
  flex-shrink: 0;
}
.timeline-dot.call { background: var(--info-bg); color: var(--info); }
.timeline-dot.email { background: var(--purple-bg); color: var(--purple); }
.timeline-dot.status { background: var(--success-bg); color: var(--success); }
.timeline-dot.stage  { background: var(--success-bg); color: var(--success); }
.timeline-dot.note   { background: var(--warning-bg); color: var(--warning); }
.timeline-body { min-width: 0; }
.timeline-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.timeline-header .who { color: var(--text); font-weight: 600; }
.timeline-subject { font-weight: 500; color: var(--text); font-size: 13px; margin-bottom: 2px; }
.timeline-text { color: var(--text-muted); white-space: pre-wrap; font-size: 13px; }

/* =============== Action-Buttons Grid (Lead-Call-Outcomes) =============== */
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.action-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-card); color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.12s; text-align: left;
}
.action-btn:hover { border-color: var(--brand); background: var(--brand-subtle); color: var(--brand); }
.action-btn .action-ico {
  width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center;
  background: var(--brand-subtle); color: var(--brand); font-size: 14px; flex-shrink: 0;
}
.action-btn.success .action-ico { background: var(--success-bg); color: var(--success); }
.action-btn.success:hover { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.action-btn.warning .action-ico { background: var(--warning-bg); color: var(--warning); }
.action-btn.warning:hover { border-color: var(--warning); background: var(--warning-bg); color: var(--warning); }
.action-btn.danger .action-ico { background: var(--error-bg); color: var(--error); }
.action-btn.danger:hover { border-color: var(--error); background: var(--error-bg); color: var(--error); }

/* =============== Kanban =============== */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding: 4px 4px 12px; }
.kanban-col {
  flex: 0 0 280px; background: var(--bg-muted);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  display: flex; flex-direction: column;
}
.kanban-col-header {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card); border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.kanban-col-header h4 { font-size: 12px; color: var(--text); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; }
.kanban-col-header .col-sum { font-size: 11px; color: var(--text-muted); }
.kanban-col-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: calc(100vh - 260px); min-height: 200px; }

/* =============== Kanban SF-Stil (Opportunities-Board, Vollhöhe) =============== */
/* Nur das Opportunity-Board (.kanban ohne .kanban-lead-Modifier). Die Lead-Status-
   Kanban-Variante (.kanban-lead) bleibt unveraendert. */
.kanban:not(.kanban-lead) {
  flex: 1 1 auto;
  align-items: stretch;
  height: 100%;
  min-height: 360px;
  padding: 2px 2px 4px;
}
.kanban:not(.kanban-lead) .kanban-col {
  flex: 0 0 300px;
  background: var(--bg-muted);
  overflow: hidden;        /* fuer abgerundete Ecken unter Chevron-Header */
}

/* Markenblauer Chevron-Spaltenkopf (Optik wie .status-flow / .flow-step) */
.kanban:not(.kanban-lead) .kanban-col-header {
  flex: 0 0 auto;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 0;
  height: 46px;
  padding: 0 14px 0 26px;
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%, 13px 50%);
  align-items: center;
  box-shadow: inset 0 -2px 0 var(--brand-dark);
}
.kanban:not(.kanban-lead) .kanban-col:first-child .kanban-col-header {
  padding-left: 16px;
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%);
}
.kanban:not(.kanban-lead) .kanban-col:last-child .kanban-col-header {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 13px 50%);
}
.kanban:not(.kanban-lead) .kanban-col-header h4 {
  color: #fff; font-size: 12px; display: flex; align-items: center; gap: 6px;
  flex: 1 1 auto; min-width: 0; overflow: hidden;
}
.kanban:not(.kanban-lead) .kanban-col-header .stage-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kanban:not(.kanban-lead) .kanban-col-header .stage-count,
.kanban:not(.kanban-lead) .kanban-col-header .stage-prob { flex: 0 0 auto; }
.kanban:not(.kanban-lead) .kanban-col-header .stage-prob {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.8); letter-spacing: 0;
  text-transform: none;
}
.kanban:not(.kanban-lead) .kanban-col-header .col-sum {
  color: rgba(255,255,255,0.92); font-weight: 500; white-space: nowrap;
}
/* Won-/Abschluss-Spalte hervorheben (gruen statt blau) */
.kanban:not(.kanban-lead) .kanban-col-won .kanban-col-header {
  background: var(--success);
  box-shadow: inset 0 -2px 0 #03663a;
}
.kanban:not(.kanban-lead) .kanban-col-won .kanban-col-header .stage-prob,
.kanban:not(.kanban-lead) .kanban-col-won .kanban-col-header .col-sum { color: rgba(255,255,255,0.92); }

/* Spaltenkoerper fuellt die Resthoehe, scrollt intern */
.kanban:not(.kanban-lead) .kanban-col-body {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
}
.kanban-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; font-size: 13px;
  cursor: pointer; transition: all 0.12s;
  box-shadow: var(--shadow-sm);
}
.kanban-card:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.kanban-card .kc-title { font-weight: 500; color: var(--text-link); }
.kanban-card .kc-amount { font-weight: 600; color: var(--success); font-size: 13px; margin-top: 4px; }
.kanban-card .kc-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; }
.kanban-empty { color: var(--text-muted); font-size: 12px; padding: 20px; text-align: center; }

/* =============== KPI Tiles =============== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-tile {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.kpi-tile .kpi-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.kpi-tile .kpi-value { font-size: 28px; font-weight: 300; color: var(--text); margin-top: 4px; letter-spacing: -0.5px; }
.kpi-tile .kpi-delta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.kpi-tile .kpi-dot {
  width: 8px; height: 8px; border-radius: 50%; position: absolute; top: 14px; right: 14px;
  background: var(--text-muted);
}
.kpi-tile.kpi-green .kpi-dot { background: var(--success); }
.kpi-tile.kpi-yellow .kpi-dot { background: var(--warning); }
.kpi-tile.kpi-red .kpi-dot { background: var(--error); }
.kpi-tile.kpi-green { border-top: 3px solid var(--success); }
.kpi-tile.kpi-yellow { border-top: 3px solid var(--warning); }
.kpi-tile.kpi-red { border-top: 3px solid var(--error); }

/* Startseite (Setter): Abschnitts-Header + Performance-Zeitfenster-Umschalter */
.home-section { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 10px; }
.home-section:first-of-type { margin-top: 4px; }
.home-section h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); font-weight: 700; margin: 0; }
.seg-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.seg-toggle a { padding: 5px 12px; font-size: 12px; color: var(--text-muted); text-decoration: none; background: var(--bg-card); border-right: 1px solid var(--border); }
.seg-toggle a:last-child { border-right: 0; }
.seg-toggle a:hover { background: var(--bg-objectnav, #f3f3f3); }
.seg-toggle a.active { background: var(--brand); color: #fff; font-weight: 600; }

/* Startseite (Setter): Aufgaben-Liste */
.tasks-subhead { padding: 9px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.task-row { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: 0; }
.task-row .t-main { flex: 1; min-width: 0; }
.task-row .t-subject { font-size: 13px; color: var(--text); }
.task-row .t-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.task-row .t-meta a { color: var(--brand); text-decoration: none; }
.task-row .t-due { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.task-row .t-due.overdue { color: var(--error); font-weight: 600; }
.prio { font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; padding: 2px 7px; border-radius: 3px; white-space: nowrap; }
.prio.urgent { background: var(--error-bg); color: var(--error); }
.prio.high   { background: var(--warning-bg); color: var(--warning); }
.prio.normal { background: var(--info-bg); color: var(--info); }
.prio.low    { background: #f3f3f3; color: var(--text-muted); }
.empty-row { padding: 16px; color: var(--text-muted); font-size: 13px; }
details.team-tasks > summary { padding: 9px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); cursor: pointer; border-bottom: 1px solid var(--border); list-style: none; }
details.team-tasks > summary::-webkit-details-marker { display: none; }
details.team-tasks > summary::before { content: "▸ "; }
details.team-tasks[open] > summary::before { content: "▾ "; }

/* Chart containers */
.chart-card .chart-wrap { position: relative; height: 260px; padding: 10px 0; }
.chart-card .chart-wrap canvas { max-height: 260px; }

/* =============== Login =============== */
.login-page {
  display: grid; place-items: center; min-height: 100vh;
  background: linear-gradient(135deg, #0b2a5b 0%, #1589ee 100%);
  padding: 20px;
}
.login-card {
  background: #fff; border-radius: 8px;
  padding: 36px 32px; width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo {
  text-align: center; margin-bottom: 24px;
}
.login-logo .login-brand {
  width: 56px; height: 56px; border-radius: 10px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 20px;
  margin: 0 auto 12px;
}
.login-logo h2 { font-size: 18px; margin-bottom: 2px; font-weight: 600; }
.login-logo p { margin: 0; font-size: 12px; color: var(--text-muted); letter-spacing: 0.5px; text-transform: uppercase; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form input { padding: 10px 12px; font-size: 14px; }
.login-form button { padding: 11px; font-size: 14px; font-weight: 600; border-radius: var(--radius); border: none; background: var(--brand); color: #fff; cursor: pointer; }
.login-form button:hover { background: var(--brand-hover); }
.login-form .alert { background: var(--error-bg); color: var(--error); padding: 10px 12px; border-radius: 4px; font-size: 13px; }
.login-hint { text-align: center; color: var(--text-muted); font-size: 11px; margin-top: 14px; }

/* =============== Helpers =============== */
.muted { color: var(--text-muted); }
.empty {
  padding: 40px 20px; text-align: center; color: var(--text-muted);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.empty .empty-icon { font-size: 36px; opacity: 0.6; }
.empty h4 { font-size: 14px; color: var(--text); margin-bottom: 4px; }

.stat-row { display: flex; gap: 16px; font-size: 13px; color: var(--text-muted); }
.stat-row strong { color: var(--text); font-weight: 600; }

.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }
.flex-row { display: flex; gap: 10px; align-items: center; }
.flex-wrap { display: flex; gap: 8px; flex-wrap: wrap; }
.nowrap { white-space: nowrap; }

/* =============== SF Lightning: Page-Header (Entity + List-View) =============== */
.sf-pageheader {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
}
.sf-pageheader-left { display: flex; gap: 14px; align-items: center; min-width: 0; }
.sf-pageheader-right { display: flex; gap: 6px; }

.entity-avatar {
  width: 44px; height: 44px; border-radius: 8px;
  display: grid; place-items: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), inset 0 -2px 0 rgba(0,0,0,0.08);
}
.entity-avatar .ico { width: 22px; height: 22px; stroke-width: 2; }
.entity-avatar.entity-lead { background: linear-gradient(135deg, #0d9488 0%, #0a6e66 100%); }
.entity-avatar.entity-opp  { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.entity-avatar.entity-user { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.entity-avatar.entity-gf   { background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%); }

.sf-caret-ico { width: 12px; height: 12px; opacity: 0.65; }
.kc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.kc-handle { cursor: pointer; color: var(--text-muted); padding: 0 2px; opacity: 0.55; border-radius: 3px; }
.kc-handle:hover { background: var(--bg-muted); color: var(--brand); opacity: 1; }
.kc-dot { opacity: 0.55; margin: 0 4px; }
.kc-mono { display: flex; align-items: center; gap: 4px; color: var(--text) !important; }
.kc-mono .ico { color: var(--brand); }

.sf-eyebrow { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.3px; text-transform: none; }
.sf-title-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }

.sf-listview-picker { position: relative; }
.sf-listview-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: none;
  font-size: 22px; font-weight: 400; color: var(--text);
  padding: 2px 4px; cursor: pointer; border-radius: 3px;
}
.sf-listview-btn:hover { background: var(--bg-muted); }
.sf-caret { font-size: 10px; color: var(--text-muted); }
.sf-pin { background: transparent; border: none; color: var(--text-muted); font-size: 15px; padding: 4px 8px; cursor: pointer; border-radius: 3px; }
.sf-pin:hover:not(:disabled) { background: var(--bg-muted); color: var(--brand); }
.sf-pin:disabled { cursor: not-allowed; opacity: 0.4; }

.sf-listview-menu, .sf-view-menu {
  position: absolute; top: calc(100% + 4px); left: 0;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  z-index: 200;
  display: none; padding: 6px 0;
}
.sf-listview-menu.open, .sf-view-menu.open { display: block; }
.sf-listview-menu-title { padding: 6px 14px; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.sf-listview-item, .sf-view-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; text-decoration: none; color: var(--text);
  font-size: 13px; cursor: pointer; gap: 12px;
}
.sf-listview-item:hover, .sf-view-item:hover { background: var(--brand-subtle); text-decoration: none; }
.sf-listview-item.active, .sf-view-item.active { background: var(--brand-subtle); color: var(--brand); font-weight: 500; }
.sf-listview-count { font-size: 11px; color: var(--text-muted); background: var(--bg-muted); padding: 1px 8px; border-radius: 10px; }

/* =============== Meta Row (unter Page-Header) =============== */
.sf-meta-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; gap: 12px; flex-wrap: wrap;
}
.sf-meta-left { font-size: 13px; color: var(--text-muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sf-meta-count b { color: var(--text); font-weight: 700; }
.sf-meta-left b { color: var(--text); font-weight: 500; }
.sf-meta-dot { opacity: 0.5; }
.sf-meta-right { display: flex; gap: 6px; align-items: center; }

.sf-list-search {
  padding: 6px 12px 6px 32px; width: 280px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23706e6b' stroke-width='2.5'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") 10px center no-repeat;
  font-size: 13px;
}
.sf-list-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21,137,238,0.15); }
.sf-list-search:disabled { background-color: var(--bg-muted); cursor: not-allowed; }

.sf-view-switcher { position: relative; }
.sf-view-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: 13px; cursor: pointer;
}
.sf-view-btn:hover { background: var(--bg-muted); }
.sf-view-menu { min-width: 200px; }

.sf-icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: 14px; cursor: pointer;
}
.sf-icon-btn:hover:not(:disabled) { background: var(--bg-muted); }
.sf-icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* =============== SF Chevron Status-Flow =============== */
.status-flow {
  display: flex; padding: 0; margin-bottom: 14px;
  background: transparent;
  overflow-x: auto;
  font-size: 13px;
  gap: 0;
}
.status-flow .flow-step {
  flex: 1; min-width: 110px;
  padding: 11px 16px 11px 28px;
  background: #e5e5e5;
  color: #1a1a1a;
  text-decoration: none; text-align: center; font-weight: 500;
  position: relative;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
  margin-right: -12px;
  transition: background 0.15s, color 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap;
}
.status-flow .flow-step:first-child {
  padding-left: 20px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
}
.status-flow .flow-step:last-child {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%);
  margin-right: 0;
}
.status-flow .flow-step:hover { background: #b8e1fe; color: #000; text-decoration: none; }
.status-flow .flow-step.active {
  background: var(--brand); color: #fff;
  box-shadow: inset 0 -2px 0 var(--brand-dark);
}
.status-flow .flow-step .flow-label { font-weight: 600; }
.status-flow .flow-step .flow-count { opacity: 0.85; font-weight: 500; }
.status-flow .flow-step.active .flow-count { opacity: 1; }

/* =============== SF Table Enhancements =============== */
.sf-table { box-shadow: var(--shadow); border-radius: var(--radius-md); }
.sf-table table.data thead th { padding: 8px 14px; font-size: 10px; }
.sf-table input[type="checkbox"] { cursor: pointer; }

/* =============== Chevron-Flow Readonly-Variante (Kanban-View) =============== */
.status-flow-readonly .flow-step {
  cursor: default;
  background: #e5e5e5;
  color: var(--text);
}
.status-flow-readonly .flow-step.active {
  background: var(--brand); color: #fff;
}
.status-flow-readonly .flow-step:hover { background: #e5e5e5; color: var(--text); }
.status-flow-readonly .flow-step.active:hover { background: var(--brand); color: #fff; }

/* =============== Klickbarer Path (Lead-Detail Status-Path) =============== */
.path-clickable { padding: 0; margin: 0 0 14px 0; background: transparent; border: none; box-shadow: none; }
.path-clickable .path-step {
  border: none;
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
  background: #e5e5e5; color: var(--text);
  padding: 13px 16px 13px 28px;
  transition: background 0.15s, color 0.15s;
}
.path-clickable .path-step:first-child { padding-left: 20px; }
.path-clickable .path-step:hover:not(:disabled) { background: var(--brand-subtle); color: var(--brand); }
.path-clickable .path-step:focus { outline: none; }
.path-clickable .path-step:disabled { cursor: default; background: var(--brand); color: #fff; font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--brand-dark); }
.path-clickable .path-step.current { background: var(--brand); color: #fff; font-weight: 700; box-shadow: inset 0 -3px 0 var(--brand-dark); }
.path-clickable .path-step-locked { opacity: 0.55; cursor: not-allowed; background: #e0e0e0; }
.path-clickable .path-step-locked:hover { background: #e0e0e0; color: var(--text-muted); }

/* =============== Call-Card: Prominente Call-Actions + Notiz =============== */
.call-card .card-header { background: linear-gradient(to right, var(--brand-subtle), transparent); }
.call-card .card-header h3 .ico { color: var(--brand); }

.call-note-field {
  border: 2px dashed var(--border); border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--bg-muted);
  cursor: text;
  transition: border-color 0.15s, background 0.15s;
}
.call-note-field:hover { border-color: var(--brand); background: #fff; }
.call-note-field:focus-within { border-color: var(--brand); border-style: solid; background: #fff; box-shadow: 0 0 0 3px var(--brand-subtle); }
.call-note-field label {
  display: flex; gap: 6px; align-items: center;
  color: var(--text-muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600;
  margin-bottom: 4px;
}
.call-note-field label .ico { color: var(--brand); }
.call-note-field textarea {
  width: 100%; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 14px; line-height: 1.5; color: var(--text);
  resize: vertical; padding: 0;
}
.call-note-field textarea:focus { box-shadow: none; }

.call-actions-primary {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
@media (max-width: 900px) { .call-actions-primary { grid-template-columns: 1fr; } }

.call-action {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: #fff; border: 2px solid var(--border); border-radius: var(--radius-md);
  color: var(--text); font-family: inherit; text-align: left;
  cursor: pointer; transition: all 0.12s;
}
.call-action:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.call-action .ca-ico {
  width: 40px; height: 40px; border-radius: 8px;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--bg-muted); color: var(--text-muted);
}
.call-action .ca-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.call-action .ca-title { font-weight: 600; font-size: 14px; }
.call-action .ca-sub { font-size: 11px; color: var(--text-muted); }

.call-action-neutral:hover  { border-color: var(--brand);   background: var(--brand-subtle); }
.call-action-neutral:hover .ca-ico { background: var(--brand); color: #fff; }

.call-action-success:hover  { border-color: var(--success); background: var(--success-bg); }
.call-action-success:hover .ca-ico { background: var(--success); color: #fff; }
.call-action-success .ca-ico { background: var(--success-bg); color: var(--success); }

.call-action-warning:hover  { border-color: var(--warning); background: var(--warning-bg); }
.call-action-warning:hover .ca-ico { background: var(--warning); color: #fff; }
.call-action-warning .ca-ico { background: var(--warning-bg); color: var(--warning); }

/* =============== Kanban Drag-and-Drop Visuals =============== */
.kanban-card { cursor: grab; user-select: none; }
.kanban-card:active { cursor: grabbing; }
.kanban-card .kc-title, .kanban-card .kc-handle { cursor: default; }
.kanban-card.kanban-drag-chosen { box-shadow: 0 6px 18px rgba(13,148,136,0.35); border-color: var(--brand); }
.kanban-card.kanban-drag-active { opacity: 0.95; transform: rotate(1.5deg); }
.kanban-card.kanban-drag-ghost {
  opacity: 0.3; background: var(--brand-subtle); border: 2px dashed var(--brand);
}
.kanban-card.kanban-card-loading { pointer-events: none; position: relative; }
.kanban-card.kanban-card-loading::after {
  content: ""; position: absolute; inset: 0; background: rgba(255,255,255,0.5);
  border-radius: inherit;
  backdrop-filter: blur(1px);
}
.kanban-dropzone { min-height: 60px; border-radius: 4px; transition: background 0.15s; }
.kanban-dropzone.drop-ready { background: rgba(13,148,136,0.04); outline: 2px dashed rgba(13,148,136,0.25); outline-offset: -6px; }

/* =============== Notification-Bell =============== */
.notif-wrap { position: relative; }
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--error); color: #fff;
  border-radius: 9px; font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--bg-topbar);
}
.notif-btn.has-unread .ico {
  animation: notif-pulse 1.8s infinite;
  color: var(--accent);
}
@keyframes notif-pulse {
  0%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(-12deg); }
  20%, 40% { transform: rotate(12deg); }
  50%      { transform: rotate(0); }
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 380px; max-height: 70vh; overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  z-index: 200;
  animation: mm-scale-in 0.15s ease;
}
.notif-header {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; font-size: 14px;
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.notif-body { padding: 4px 0; }
.notif-item {
  display: block; padding: 12px 16px;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--border);
  color: var(--text); text-decoration: none;
  transition: background 0.1s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-muted); text-decoration: none; color: var(--text); }
.notif-item.unread { background: var(--brand-subtle); }
.notif-item.unread:hover { background: rgba(13,148,136,0.18); }
.notif-item.notif-urgent { border-left-color: var(--error); }
.notif-item.notif-warn   { border-left-color: var(--warning); }
.notif-item.notif-ok     { border-left-color: var(--success); }
.notif-item.notif-info   { border-left-color: var(--brand); }
.notif-item .notif-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.notif-item .notif-text  { font-size: 12px; color: var(--text-muted); line-height: 1.4; margin-bottom: 4px; }
.notif-item .notif-meta  { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* =============== Upsell-Chip (Produkt-Auswahl im Modal) =============== */
.upsell-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1.5px solid var(--border); border-radius: 6px;
  background: #fff; cursor: pointer;
  transition: all 0.12s;
  font-size: 12px;
  user-select: none;
}
.upsell-chip:hover { border-color: var(--accent); background: var(--accent-subtle); }
.upsell-chip input[type="checkbox"] {
  width: 14px; height: 14px; accent-color: var(--accent); cursor: pointer;
}
.upsell-chip-tag { font-weight: 700; color: var(--accent); letter-spacing: 0.3px; }
.upsell-chip-label { color: var(--text-muted); }
.upsell-chip:has(input:checked) {
  border-color: var(--accent); background: var(--accent-subtle);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}
.upsell-chip:has(input:checked) .upsell-chip-label { color: var(--text); }

/* =============== Confirm-Modal =============== */
.mm-modal-root { position: fixed; inset: 0; z-index: 1000; display: none; }
.mm-modal-root.open { display: block; }
.mm-modal-overlay {
  position: absolute; inset: 0;
  background: rgba(11,31,37,0.55);
  backdrop-filter: blur(3px);
  animation: mm-fade-in 0.15s ease;
}
.mm-modal-card {
  position: relative;
  margin: 5vh auto; width: 440px; max-width: calc(100vw - 32px);
  max-height: 90vh;
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  animation: mm-scale-in 0.18s cubic-bezier(0.2, 0, 0.2, 1.1);
  display: flex; flex-direction: column;
}
@keyframes mm-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes mm-scale-in { from { opacity: 0; transform: translateY(-8px) scale(0.97); } to { opacity: 1; transform: none; } }

.mm-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.mm-modal-header h3 { font-size: 16px; font-weight: 600; color: var(--text); }
.mm-modal-close {
  background: transparent; border: none; font-size: 20px; color: var(--text-muted);
  width: 28px; height: 28px; border-radius: 4px; cursor: pointer;
  display: grid; place-items: center;
}
.mm-modal-close:hover { background: var(--bg-muted); color: var(--text); }

.mm-modal-body { padding: 20px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.mm-modal-message { font-size: 14px; color: var(--text); line-height: 1.55; }
.mm-modal-message b { color: var(--brand); }
.mm-modal-side {
  margin-top: 12px; padding: 10px 12px;
  background: var(--brand-subtle); border-left: 3px solid var(--brand);
  border-radius: 4px;
  font-size: 12px; color: var(--brand-dark); line-height: 1.5;
}
.mm-modal-note { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.mm-modal-note textarea { width: 100%; min-height: 60px; text-transform: none; font-weight: 400; letter-spacing: normal; color: var(--text); font-size: 13px; }

.mm-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
  display: flex; justify-content: flex-end; gap: 8px;
  flex-shrink: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
/* Wenn ein <form> direkt im Modal-Card ist: Flex-Weiterreichung */
.mm-modal-card > form {
  display: flex; flex-direction: column;
  flex: 1 1 auto; min-height: 0;
  overflow: hidden;
}
.mm-modal-footer .btn.danger { background: var(--error); border-color: var(--error); color: #fff; }
.mm-modal-footer .btn.danger:hover { background: #930314; }

/* =============== Toast Notifications =============== */
.toast-container {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 500; pointer-events: none;
}
.toast {
  min-width: 280px; max-width: 440px;
  background: #fff; border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px; color: var(--text);
  box-shadow: var(--shadow-lg);
  transform: translateX(20px); opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: auto;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.toast-success { border-left-color: var(--brand); }
.toast.toast-error { border-left-color: var(--error); }
.toast .toast-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.toast b { color: var(--brand); }

/* =============== Kanban-Lead (Status-basiert) =============== */
.kanban-wrap { overflow-x: auto; }
.kanban-lead { min-width: 100%; }
.kanban-lead .kanban-col { flex: 0 0 240px; }
.kanban-lead .lead-card .kc-title { font-size: 14px; }
.kanban-lead .lead-card .kc-mono { font-family: "SF Mono", "Menlo", "Consolas", monospace; font-size: 12px; color: var(--text); }
.kanban-lead .kanban-col-header h4 { font-size: 12px; }
.kanban-col-neu .kanban-col-header { background: var(--info-bg); color: var(--info); }
.kanban-col-termin .kanban-col-header { background: var(--success-bg); color: var(--success); }
.kanban-col-quali .kanban-col-header { background: var(--success-bg); color: var(--success); }
.kanban-col-ungeeignet .kanban-col-header { background: var(--warning-bg); color: var(--warning); }
.kanban-col-muell .kanban-col-header { background: var(--error-bg); color: var(--error); }
.kanban-col-emaillist .kanban-col-header { background: var(--purple-bg); color: var(--purple); }
.kanban-col-riva .kanban-col-header { background: var(--warning-bg); color: var(--warning); }

/* Responsive */
@media (max-width: 900px) {
  /* Auf schmalen Screens: Sidebar unter die Objectnav, Body stapelt vertikal */
  .app { height: auto; min-height: 100vh; overflow: visible; }
  .app-body { flex-direction: column; }
  .sidebar { flex: 0 0 auto; width: 100%; max-height: 40vh; }
  .app.sidebar-collapsed .sidebar { max-height: 0; }
  .main { overflow-y: visible; }
  .detail-grid { grid-template-columns: 1fr; }
  .global-search { display: none; }
  .brand { min-width: auto; }
  .objectnav { overflow-x: auto; }
}

/* ================= Object-Nav (Top-Tabs, SF-Stil) — dunkles Marken-CI, unter Topbar ================= */
/* Ton zwischen Topbar (#061215) und Sidebar (#0b1f25), etwas heller zur Abgrenzung. */
:root { --bg-objectnav: #0c2229; }
.objectnav {
  flex: 0 0 var(--objnav-h);
  width: 100%;
  height: var(--objnav-h);
  display: flex; align-items: stretch; gap: 2px;
  background: var(--bg-objectnav);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  overflow-x: auto;
  z-index: 90;
}
.objectnav a {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  padding: 0 18px; height: var(--objnav-h);
  font-size: 14px; font-weight: 500; color: #cfd9ec;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.objectnav a .icon { display: inline-flex; align-items: center; }
.objectnav a .ico { width: 18px; height: 18px; }
.objectnav a:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
  text-decoration: none;
}
.objectnav a.active {
  color: #fff;
  background: rgba(13,148,136,0.16);
  border-bottom-color: var(--brand);
  font-weight: 700;
}

/* ================= Record-Type-Reiter (volle Breite, prominent wie SF) ================= */
.rt-tabs {
  display: flex; gap: 0; flex-wrap: wrap;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: 2px solid var(--border);
  margin: 0 0 14px 0;
  padding: 0 4px;
  box-shadow: var(--shadow-sm);
}
.rt-tab {
  position: relative;
  padding: 12px 18px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
  border-bottom: 3px solid transparent; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
  text-transform: uppercase; letter-spacing: 0.4px;
  transition: color 0.12s, background 0.12s;
}
.rt-tab:hover { background: var(--bg-muted); color: var(--text); text-decoration: none; }
.rt-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }
.rt-count {
  display: inline-block; min-width: 20px; padding: 1px 7px;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  background: var(--bg-muted); border-radius: 10px; text-align: center;
  letter-spacing: 0;
}
.rt-tab.active .rt-count { background: var(--brand-subtle); color: var(--brand); }

/* ================= View-Toggle (Flowchart / Karteikarten) ================= */
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.vt-btn {
  padding: 7px 13px; font-size: 13px; color: var(--text); text-decoration: none;
  background: #fff; border: none;
}
.vt-btn + .vt-btn { border-left: 1px solid var(--border); }
.vt-btn:hover { background: var(--bg-muted); }
.vt-btn.active { background: var(--brand); color: #fff; font-weight: 600; }

/* ================= Kanban-Ergänzungen ================= */
.kanban-col-won .kanban-col-header { background: var(--success-bg); color: var(--success); }
.kanban-col-header .stage-prob { font-size: 10px; font-weight: 600; color: var(--text-muted); }
.kanban-hint { font-size: 12px; color: var(--text-muted); margin: 8px 4px 0; }

/* ================= Karteikarten-Ansicht ================= */
.opp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.opp-card {
  display: block; padding: 14px 16px; background: var(--bg-card, #fff);
  border: 1px solid var(--border); border-left: 4px solid var(--brand);
  border-radius: var(--radius-md); text-decoration: none; color: var(--text);
  box-shadow: var(--shadow-sm); transition: box-shadow .12s, transform .12s;
}
.opp-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.opp-card-won { border-left-color: var(--success); }
.opp-card .oc-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.opp-card .oc-name { font-weight: 600; color: var(--text-link); }
.opp-card .oc-stage { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.opp-card .oc-amount { font-weight: 700; color: var(--success); margin-top: 6px; }
.opp-card .oc-prob { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.opp-card .oc-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ================= Toast ================= */
.mm-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 12px 20px; border-radius: var(--radius-md); color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25); z-index: 500; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; max-width: 80vw;
}
.mm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.mm-toast.ok { background: var(--success); }
.mm-toast.err { background: var(--error); }

/* ================= Mini-Dialog (Neue Opportunity) ================= */
.mm-dialog { border: none; border-radius: var(--radius-lg, 10px); padding: 0; box-shadow: 0 24px 60px rgba(0,0,0,0.3); max-width: 420px; width: 92%; }
.mm-dialog::backdrop { background: rgba(0,0,0,0.4); }
.mm-dialog form { padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.mm-dialog h3 { margin: 0 0 4px; }
.mm-dialog label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.mm-dialog input, .mm-dialog select { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }
.mm-dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* ================= Path-Gate-Marker (Opp-Detail) ================= */
.flow-step.gate-blocked::after { content: " 🔒"; font-size: 11px; }
.gate-card .gate-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.gate-card .gate-row:last-child { border-bottom: none; }
.gate-card .gate-row label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }

/* Klickbarer Path: done / locked Zustaende (Opp-Detail) */
.status-flow.path-clickable { border: none; box-shadow: none; }
.status-flow .flow-step.done-step { background: var(--success); color: #fff; }
.status-flow .flow-step.done-step:hover { background: var(--success); color: #fff; }
.status-flow .flow-step:disabled { opacity: 0.65; cursor: not-allowed; background: #e0e0e0; color: var(--text-muted); }
.status-flow .flow-step:disabled:hover { background: #e0e0e0; color: var(--text-muted); }
