/* Automatic follow-up prioritization */
:root {
  --bg: #fff;
  --sidebar: #fbfcfd;
  --line: #dfe3ea;
  --line-soft: #edf0f4;
  --text: #292d36;
  --muted: #6f7583;
  --blue: #0588ae;
  --blue-dark: #006f91;
  --blue-soft: #e5f5f8;
  --danger: #c52f57;
  --radius: 8px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  color: var(--text); background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; }
button { border: 0; background: none; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(5,136,174,.22); outline-offset: 1px;
}
input, select, textarea {
  width: 100%; color: var(--text); background: #fff;
  border: 1px solid #cfd5df; border-radius: 7px; outline: none;
}

/* Login */
.login-screen {
  height: 100%; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(145deg, #f4fbfc, #fff 48%, #eff7ff);
}
.login-card {
  width: min(360px, 100%); display: flex; flex-direction: column; gap: 15px;
  padding: 36px 30px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 18px 60px rgba(30,50,70,.12);
}
.brand { color: var(--blue); font-size: 34px; font-weight: 800; text-align: center; letter-spacing: -.8px; }
.login-sub { color: var(--muted); font-size: 13px; text-align: center; margin-top: -8px; }
.login-card input { padding: 13px; text-align: center; font-size: 21px; letter-spacing: 8px; }
.login-card button, .btn-primary {
  padding: 12px 17px; color: #fff; background: var(--blue); border-radius: 7px; font-weight: 700;
}
.login-card button:hover, .btn-primary:hover { background: var(--blue-dark); }
.err { min-height: 18px; color: var(--danger); font-size: 13px; text-align: center; }

/* Shell */
.app { height: 100%; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: calc(22px + var(--safe-top)) 14px 16px;
  background: var(--sidebar); border-right: 1px solid var(--line); overflow-y: auto;
}
.workspace-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.workspace-head > div { display: flex; flex-direction: column; gap: 2px; }
.workspace-head strong { font-size: 14px; }
.eyebrow { color: var(--muted); font-size: 12px; }
.icon-btn { min-width: 34px; height: 34px; border-radius: 7px; color: var(--muted); font-weight: 700; }
.icon-btn:hover { background: #f0f2f5; color: var(--text); }
.workspace-switch {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px;
  background: #fff; border: 1px solid #cfd5df; border-radius: 7px; text-align: left; font-weight: 600;
}
.workspace-logo {
  display: grid; place-items: center; width: 29px; height: 29px; color: #fff;
  background: linear-gradient(135deg, #5ec9f0, #0789ae); border-radius: 8px; font-weight: 800;
}
.chevron { margin-left: auto; font-size: 18px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.sidebar-nav button, .sidebar-bottom button {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 11px;
  border-radius: 7px; color: #656b78; text-align: left; font-size: 14px;
}
.sidebar-nav button > span:first-child, .sidebar-bottom button > span:first-child {
  width: 19px; text-align: center; color: #777e8d; font-size: 17px;
}
.sidebar-nav button:hover, .sidebar-bottom button:hover { background: #f0f3f5; }
.sidebar-nav button.active { color: #25323a; background: #dff2f5; font-weight: 650; }
.sidebar-nav button.active > span:first-child { color: var(--blue); }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.content-shell { min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

/* Header */
.page-header { flex: none; padding: calc(18px + var(--safe-top)) 28px 0; border-bottom: 1px solid var(--line); }
.title-row { display: flex; align-items: center; justify-content: space-between; min-height: 42px; gap: 20px; }
.title-row h1 { font-size: 25px; letter-spacing: -.5px; }
.title-chevron { color: var(--muted); font-size: 18px; }
.header-actions { display: flex; align-items: center; gap: 7px; }
.text-action { padding: 8px 9px; border-radius: 6px; color: #3e434d; font-size: 14px; white-space: nowrap; }
.text-action:hover { background: #f4f5f7; }
.tabs { display: flex; align-items: end; gap: 16px; margin-top: 11px; overflow-x: auto; }
.tabs button { flex: none; padding: 10px 8px 12px; color: #464b55; border-bottom: 3px solid transparent; font-size: 14px; }
.tabs button.active { color: #20242a; border-color: var(--blue); font-weight: 650; }
.tabs .tab-add { font-size: 20px; }
.archive-tab-count { display: inline-grid; min-width: 20px; height: 20px; margin-left: 4px; place-items: center; padding: 0 5px; color: #fff; background: #697386; border-radius: 10px; font-size: 10px; }

/* Workspace */
.lead-workspace { flex: 1; min-height: 0; overflow: auto; padding: 16px 28px 28px; }
.capture-workspace { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 28px 40px; background: #f5f7fa; }
.capture-card { width: min(900px, 100%); margin: 0 auto; overflow: hidden; background: #fff; border: 1px solid #dce2ea; border-radius: 12px; box-shadow: 0 12px 34px rgba(31,45,61,.08); }
.capture-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 28px; background: linear-gradient(135deg, #f0fbfd, #fff 70%); border-bottom: 1px solid #e3e8ef; }
.capture-head span:not(.capture-badge) { color: #0786a7; font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.capture-head h2 { margin-top: 4px; font-size: 25px; letter-spacing: -.35px; }
.capture-head p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.capture-badge { flex: none; padding: 7px 10px; color: #087892; background: #dff5f8; border: 1px solid #bce6ec; border-radius: 7px; font-size: 11px; font-weight: 800; }
.capture-form { padding: 23px 28px 26px; }
.capture-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 18px; }
.capture-grid label { display: flex; flex-direction: column; gap: 6px; color: #535b68; font-size: 12px; font-weight: 700; }
.capture-grid input, .capture-grid select, .capture-grid textarea { min-height: 42px; padding: 10px 11px; font-size: 13px; }
.capture-grid textarea { min-height: 90px; resize: vertical; line-height: 1.4; }
.capture-wide { grid-column: 1 / -1; }
.capture-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #e7ebf0; }
.capture-actions button { min-width: 130px; }
.capture-actions button:disabled { cursor: wait; opacity: .65; }
.archive-selected-btn { padding: 9px 11px; color: #73510b; background: #fff4d5; border: 1px solid #ead59a; border-radius: 7px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.archive-selected-btn:disabled { cursor: default; opacity: .42; }
.archive-workspace { flex: 1; min-height: 0; overflow: auto; padding: 24px 28px 40px; background: #f5f7fa; }
.archive-card { width: min(1180px, 100%); margin: 0 auto; overflow: hidden; background: #fff; border: 1px solid #dce2ea; border-radius: 12px; box-shadow: 0 12px 34px rgba(31,45,61,.07); }
.archive-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 25px; background: linear-gradient(135deg, #f8f5ec, #fff 70%); border-bottom: 1px solid #e3e8ef; }
.archive-head > div > span { color: #8a691f; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.archive-head h2 { margin-top: 4px; font-size: 25px; }
.archive-head p { max-width: 670px; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.archive-head > strong { padding: 8px 11px; color: #6d5318; background: #fff3cc; border-radius: 7px; white-space: nowrap; }
.archive-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 20px; border-bottom: 1px solid #e5e9ef; }
.archive-search { display: flex; align-items: center; gap: 7px; width: min(420px, 100%); }
.archive-search span { color: var(--muted); font-size: 22px; }
.archive-search input { padding: 9px 11px; }
.archive-toolbar .btn-primary { padding: 9px 13px; font-size: 12px; }
.archive-toolbar .btn-primary:disabled { cursor: default; opacity: .45; }
.archive-table-wrap { width: 100%; overflow-x: auto; }
.archive-table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 12px; }
.archive-table th { padding: 10px 12px; color: #626b78; background: #f8f9fb; border-bottom: 1px solid #dde2e9; text-align: left; }
.archive-table td { padding: 11px 12px; border-bottom: 1px solid #e8ebf0; vertical-align: middle; }
.archive-table th:first-child, .archive-table td:first-child { width: 42px; text-align: center; }
.archive-table td strong, .archive-table td small { display: block; }
.archive-table td small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.archive-table a { color: #0788b5; font-weight: 650; }
.restore-one { padding: 7px 9px; color: #087a58; background: #e2f7ed; border: 1px solid #bde8d5; border-radius: 6px; font-size: 11px; font-weight: 750; }
.archive-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 70px 20px; color: var(--muted); }
.archive-empty strong { color: #404651; font-size: 17px; }
.toolbar { display: flex; align-items: center; gap: 9px; min-width: 900px; margin-bottom: 25px; }
.new-lead-btn {
  display: flex; align-items: center; gap: 16px; padding: 10px 13px; color: #fff;
  background: var(--blue); border-radius: 6px; font-weight: 650; font-size: 14px;
}
.new-lead-btn:hover { background: var(--blue-dark); }
.search-control { display: flex; align-items: center; gap: 6px; width: 165px; padding: 0 8px; }
.search-control span { color: var(--muted); font-size: 22px; }
.search-control input { border: 0; padding: 8px 2px; background: transparent; }
.tool-button { padding: 9px 8px; border-radius: 6px; white-space: nowrap; font-size: 14px; }
.tool-button:hover { background: #f3f5f7; }
.filter-toggle { padding: 9px 11px; color: #3f4855; background: #fff; border: 1px solid #d4dae3; border-radius: 7px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.filter-toggle[aria-expanded="true"] { color: #067b9b; background: #eaf7f9; border-color: #a8dce5; }
.filter-panel { width: min(760px, 100%); margin: -12px 0 12px; padding: 15px 16px 11px; background: #fff; border: 1px solid #d8dee7; border-radius: 10px; box-shadow: 0 12px 32px rgba(31,45,61,.12); }
.filter-panel form { display: grid; grid-template-columns: 230px minmax(260px, 1fr) auto; align-items: end; gap: 12px; }
.filter-panel label { display: flex; flex-direction: column; gap: 5px; color: #596270; font-size: 10px; font-weight: 750; }
.filter-panel select, .filter-panel input { min-height: 38px; padding: 8px 9px; color: #333a44; font-size: 12px; }
.filter-date-range { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.filter-actions { display: flex; gap: 7px; }
.filter-actions button { min-height: 38px; padding: 8px 11px; white-space: nowrap; font-size: 11px; }
.filter-panel > p { margin-top: 8px; color: var(--muted); font-size: 10px; }
.filter-summary { display: flex; align-items: center; justify-content: space-between; min-height: 30px; margin: -5px 0 12px; color: var(--muted); font-size: 11px; }
.active-filter { display: inline-flex; align-items: center; gap: 8px; padding: 5px 7px 5px 10px; color: #087391; background: #e4f5f8; border: 1px solid #bee6ec; border-radius: 18px; font-weight: 700; }
.active-filter button { display: grid; width: 19px; height: 19px; place-items: center; color: #087391; background: rgba(255,255,255,.75); border-radius: 50%; font-size: 15px; line-height: 1; }
#filter-result-count { margin-left: auto; font-weight: 650; white-space: nowrap; }
.tool-select { display: flex; align-items: center; gap: 4px; }
.tool-select select { width: auto; min-width: 124px; border: 0; padding: 9px 24px 9px 5px; background: #fff; font-size: 14px; }
.lead-group { min-width: 900px; }
.group-title { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; padding-left: 10px; }
.group-title h2 { color: #0086be; font-size: 21px; font-weight: 700; letter-spacing: -.2px; }
.group-toggle { color: #087cac; font-size: 20px; }
.lead-total { color: var(--muted); font-size: 12px; }
.groups-board { display: flex; flex-direction: column; gap: 46px; }
.groups-board .lead-group { min-width: 0; }
.groups-board .group-title h2 { color: var(--group-color); }
.groups-board .board { border-left-color: var(--group-color); }
.groups-board .appointment-group { padding: 12px; background: #fffaf1; border: 1px solid #f4dfb6; border-radius: 10px; }
.groups-board .appointment-group .group-title { margin-bottom: 8px; }

/* Table */
.board { border-left: 6px solid #0795c6; border-radius: 8px 0 0 8px; }
.table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-left: 0; }
.lead-table { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: fixed; background: #fff; }
.lead-table th, .lead-table td {
  height: 54px; padding: 7px 13px; border-right: 1px solid #d5dbe5; border-bottom: 1px solid #d5dbe5;
  overflow: hidden; font-size: 14px; vertical-align: middle;
}
.lead-table th { height: 49px; background: #fff; font-size: 15px; font-weight: 500; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.lead-table tr:last-child td { border-bottom: 0; }
.lead-table tbody tr { transition: background .12s; cursor: pointer; }
.lead-table tbody tr:hover td:not(.status-cell) { background: #f8fbfc; }
.check-cell { width: 42px; text-align: center; padding: 0 !important; }
.check-cell input { width: 16px; height: 16px; accent-color: var(--blue); }
.lead-table th[data-column] { position: relative; }
.column-resizer {
  position: absolute; top: 0; right: -5px; z-index: 4; width: 10px; height: 100%;
  cursor: col-resize; touch-action: none;
}
.column-resizer::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px;
  background: #1597c2; opacity: 0; transition: opacity .12s;
}
.lead-table th:hover .column-resizer::after, .column-resizer:hover::after,
.resizing-column .column-resizer::after { opacity: 1; }
.resizing-column, .resizing-column * { cursor: col-resize !important; user-select: none !important; }
.lead-cell { position: relative; padding: 7px 58px 7px 40px !important; }
.lead-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; width: 100%; }
.lead-copy strong, .lead-copy small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lead-copy strong { font-size: 15px; font-weight: 500; }
.lead-copy small { color: var(--muted); font-size: 11px; }
.row-detail { position: absolute; top: 50%; right: 8px; width: 42px; height: 42px; transform: translateY(-50%); color: #676d79; border: 1px solid transparent; border-radius: 6px; font-size: 30px; line-height: 1; }
.row-detail:hover { border-color: var(--line); background: #fff; }
.status-cell { padding: 0 !important; background: var(--status-color); }
.status-trigger {
  width: 100%; height: 53px; padding: 0 30px 0 12px; color: #fff; background: transparent;
  border: 0; border-radius: 0; text-align: center; text-align-last: center; font-size: 15px; font-weight: 500; cursor: pointer;
}
.status-trigger::after {
  content: ""; position: absolute; top: 0; right: 0; width: 0; height: 0;
  border-top: 13px solid rgba(255,255,255,.35); border-left: 13px solid transparent;
}
.status-trigger:hover { filter: brightness(1.04); }
.status-trigger[aria-expanded="true"] { box-shadow: inset 0 0 0 2px #008fc4; }
.status-cell { position: relative; }

.status-popover {
  --arrow-left: 50%; position: fixed; z-index: 100; width: min(250px, calc(100vw - 20px));
  max-height: min(620px, calc(100vh - 20px)); overflow-y: auto; padding: 15px 16px 0; background: #fff; border: 1px solid #edf0f3; border-radius: 10px;
  box-shadow: 0 11px 34px rgba(30,35,45,.24); animation: statusPop .13s ease-out;
}
@keyframes statusPop { from { opacity: 0; transform: translateY(5px) scale(.985); } }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; padding-bottom: 13px; }
.status-choice, .status-placeholder {
  display: grid; place-items: center; min-height: 34px; border-radius: 3px;
}
.status-choice {
  padding: 5px 7px; color: #fff; background: var(--choice-color); font-size: 12px; font-weight: 500;
  line-height: 1.15; text-align: center; transition: filter .12s, transform .08s;
}
.status-choice:hover, .status-choice:focus-visible { filter: brightness(1.07); transform: translateY(-1px); }
.status-choice:active { transform: translateY(0); }
.status-placeholder { background: #c4c4c4; }
.status-menu-action {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: calc(100% + 32px);
  min-height: 40px; margin-left: -16px; padding: 7px 12px; border-top: 1px solid #e2e5ea;
  color: #343840; background: #fff; border-radius: 0 0 10px 10px; font-size: 12px;
}
.status-menu-action:hover { background: #f7f8fa; }
.status-menu-action span { font-size: 17px; }
.status-editor { display: flex; flex-direction: column; gap: 9px; width: calc(100% + 32px); margin-left: -16px; padding: 12px 16px; background: #f8f9fb; border-top: 1px solid #e2e5ea; }
.status-name-input { width: 100%; padding: 8px 9px; background: #fff; font-size: 12px; }
.status-color-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.status-color { cursor: pointer; }
.status-color input { position: absolute; opacity: 0; pointer-events: none; }
.status-color span { display: block; width: 100%; aspect-ratio: 1; background: var(--swatch); border: 2px solid #fff; border-radius: 5px; box-shadow: 0 0 0 1px #d7dce3; }
.status-color input:checked + span { box-shadow: 0 0 0 3px #20242b; }
.status-create-btn { padding: 8px; color: #fff; background: #078daf; border-radius: 5px; font-size: 12px; font-weight: 700; }
.status-popover-arrow {
  position: absolute; left: var(--arrow-left); top: -10px; transform: translateX(-50%);
  width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-bottom: 11px solid #fff;
  filter: drop-shadow(0 -1px 0 #e5e7eb);
}
.status-popover.opens-up .status-popover-arrow {
  top: auto; bottom: -10px; border-bottom: 0; border-top: 11px solid #fff;
  filter: drop-shadow(0 1px 0 #e5e7eb);
}
.comment-cell { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #535862; }
.address-cell { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #535862; }
.lead-table a { display: inline-block; max-width: 100%; overflow: hidden; color: #0788bf; text-decoration: none; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.lead-table a:hover { text-decoration: underline; }
.lead-table td:not(.lead-cell):not(.status-cell):not(.contact-research-cell):not(.source-cell) { text-overflow: ellipsis; white-space: nowrap; }
.contact-research-cell, .contact-research-cell * { min-width: 0; overflow-wrap: anywhere; }
.research-result { max-height: 46px; overflow: hidden; }
.lead-table td > span:not(.flag), .lead-table td > div { max-width: 100%; }
.flag { margin-right: 8px; font-size: 18px; }
.contact-research-cell { padding: 7px 9px !important; }
.research-start { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.research-start > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-research-btn { flex: 0 0 auto; padding: 6px 9px; color: #087f5b; background: #e9fbf3; border: 1px solid #9ee2c5; border-radius: 5px; font-size: 11px; font-weight: 700; }
.ai-research-btn:hover { background: #d9f7e9; }
.ai-research-btn:disabled { color: #67727a; background: #eef1f4; border-color: #d6dbe1; }
.research-result { display: flex; flex-direction: column; gap: 3px; font-size: 11px; line-height: 1.25; }
.research-result strong { color: #078a57; font-size: 12px; }
.research-result span { white-space: normal; }
.research-result.not-found { color: #737982; }
.followup { color: #a16106; white-space: nowrap; }
.followup.overdue { color: var(--danger); font-weight: 650; }
.lead-table tr.followup-red td:not(.status-cell):not(.source-cell) { background: #ffe4e7 !important; }
.lead-table tr.followup-orange td:not(.status-cell):not(.source-cell) { background: #fff0d8 !important; }
.lead-table tr.followup-green td:not(.status-cell):not(.source-cell) { background: #e5f7e9 !important; }
.lead-table tr.followup-red .followup-date-cell { color: #c7253e; font-weight: 750; }
.lead-table tr.followup-orange .followup-date-cell { color: #a66306; font-weight: 750; }
.lead-table tr.followup-green .followup-date-cell { color: #16723c; font-weight: 700; }
.source-cell { padding: 0 !important; background: var(--source-color); }
.source-trigger { width: 100%; min-height: 52px; padding: 8px 12px; overflow: hidden; color: #fff; background: var(--source-color); font-size: 15px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.source-trigger:hover { filter: brightness(.97); }
.source-popover { position: fixed; z-index: 100; width: 150px; padding: 12px 10px 0; background: #fff; border: 1px solid #e2e4ea; border-radius: 0 0 7px 7px; box-shadow: 0 7px 18px rgba(28,32,40,.18); }
.source-popover-arrow { position: absolute; top: -11px; left: 50%; width: 0; height: 0; transform: translateX(-50%); border-right: 12px solid transparent; border-bottom: 12px solid #fff; border-left: 12px solid transparent; filter: drop-shadow(0 -1px 0 #e2e4ea); }
.source-popover.opens-up { transform: translateY(-100%); border-radius: 12px 12px 0 0; }
.source-popover.opens-up .source-popover-arrow { top: auto; bottom: -11px; border-top: 12px solid #fff; border-bottom: 0; filter: drop-shadow(0 1px 0 #e2e4ea); }
.source-options { display: flex; flex-direction: column; gap: 5px; }
.source-choice { width: 100%; min-height: 28px; padding: 4px; color: #fff; background: var(--source-color); border-radius: 2px; font-size: 11px; font-weight: 550; }
.source-choice:hover, .source-choice:focus-visible { filter: brightness(.94); outline: 3px solid rgba(7,136,169,.28); outline-offset: 2px; }
.source-edit { display: flex; align-items: center; gap: 6px; width: calc(100% + 20px); margin: 8px -10px 0; padding: 9px 12px; color: #30333a; background: #fff; border-top: 1px solid #e2e4ea; font-size: 10px; text-align: left; }
.source-edit:first-letter { font-size: 14px; }
.empty-state { height: 190px !important; text-align: center; color: var(--muted); cursor: default; }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { margin-bottom: 6px; color: var(--text); }

/* Sheets */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(25,31,38,.34); backdrop-filter: blur(2px); }
.sheet-panel {
  position: absolute; top: 0; right: 0; width: min(470px, 100%); height: 100%; overflow-y: auto;
  padding: 22px 22px calc(22px + var(--safe-bottom)); background: #fff; border-left: 1px solid var(--line);
  box-shadow: -16px 0 45px rgba(31,40,50,.14); animation: slideIn .2s ease-out;
}
@keyframes slideIn { from { transform: translateX(100%); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-head h2 { font-size: 20px; }
.sheet-body { display: flex; flex-direction: column; gap: 13px; }
.sheet-body label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
.sheet-body input, .sheet-body select, .sheet-body textarea { padding: 10px 11px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.45; }
.btn-ghost { padding: 9px 11px; border-radius: 7px; color: var(--muted); background: #f3f5f7; }
.btn-danger { padding: 11px 16px; color: var(--danger); border: 1px solid #f0c4cf; border-radius: 7px; font-weight: 650; }
.sheet-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 5px; }

/* Large lead detail window */
.lead-detail-panel {
  top: 3vh; right: auto; bottom: auto; left: 50%; width: min(1436px, calc(99vw - 48px)); height: min(812px, 94vh); padding: 0;
  transform: translateX(-50%); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #f5f7fb;
  box-shadow: 0 20px 70px rgba(31,40,50,.24); animation: detailIn .18s ease-out;
}
@keyframes detailIn { from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.99); } }
.lead-detail-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px 5px; background: #fff; }
.lead-detail-head h2 { font-size: 22px; color: #2f3138; }
.lead-close { width: 32px; height: 32px; border-radius: 7px; background: transparent; color: #343840; font-size: 24px; line-height: 1; }
.lead-close:hover { background: #eef1f5; }
.lead-detail-tabs { display: flex; gap: 16px; padding: 0 18px; background: #fff; border-bottom: 1px solid var(--line); }
.lead-detail-tabs button { padding: 7px 3px; color: #4e535d; background: transparent; border-bottom: 2px solid transparent; font-size: 12px; }
.lead-detail-tabs button.active { color: #0788a9; border-color: #0788a9; }
.lead-detail-body { height: calc(100% - 74px); min-height: 0; padding: 9px 12px; gap: 7px; overflow: hidden; }
.detail-card { overflow: hidden; background: #fff; border: 1px solid #d8dee8; border-radius: 10px; }
.detail-card-head { display: flex; align-items: center; min-height: 34px; padding: 0 13px; border-bottom: 1px solid #d8dee8; }
.detail-card-head h3 { font-size: 15px; color: #333740; }
.phase-card-body { padding: 7px 13px 9px; }
.lead-summary-chips { display: flex; flex-wrap: nowrap; gap: 6px; min-height: 23px; margin-bottom: 5px; overflow: hidden; }
.lead-summary-chips span { max-width: 300px; padding: 5px 8px; overflow: hidden; color: #40515a; background: #dff4f7; border-radius: 4px; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.phase-strip { display: flex; width: 100%; gap: 3px; }
.phase-step { position: relative; flex: 1 1 100px; min-height: 29px; padding: 4px; color: #fff; background: #b9beca; font-size: 10px; font-weight: 650; }
.phase-step:first-child { border-radius: 6px 0 0 6px; }
.phase-step:last-child { border-radius: 0 6px 6px 0; }
.phase-step.active { background: var(--stage-color); box-shadow: inset 0 0 0 3px rgba(0,0,0,.12); }
.phase-step:hover { filter: brightness(.96); }
.lead-detail-grid { display: grid; flex: 1 1 auto; min-height: 0; grid-template-columns: minmax(300px, .8fr) minmax(540px, 1.2fr); gap: 8px; align-items: stretch; }
.activity-body, .lead-info-fields { padding: 7px 10px; }
.notes-label textarea { min-height: 88px; resize: none; background: #fff; font-size: 12px; line-height: 1.35; }
.activity-entry { display: flex; gap: 9px; margin-top: 10px; padding: 10px; background: #f7f8fb; border: 1px solid #e1e5ec; border-radius: 7px; }
.activity-icon { display: grid; place-items: center; width: 31px; height: 31px; color: #fff; background: #078ca8; border-radius: 7px; }
.activity-entry div { display: flex; flex-direction: column; gap: 5px; }
.activity-entry small { color: var(--muted); }
.lead-activity-history { max-height: 190px; margin-top: 7px; overflow: hidden; border-top: 1px solid #e5e9ef; }
.history-entry { position: relative; display: grid; grid-template-columns: 12px 1fr; gap: 7px; padding: 6px 2px; border-bottom: 1px solid #edf0f4; }
.history-dot { width: 8px; height: 8px; margin-top: 5px; background: #078ca8; border-radius: 50%; }
.history-entry div { min-width: 0; }
.history-entry strong, .history-entry small, .history-entry p { display: block; overflow-wrap: anywhere; }
.history-entry strong { font-size: 12px; }
.history-entry small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.history-entry p { margin-top: 4px; color: #4e5968; font-size: 11px; }
.history-empty { padding: 12px 2px; color: var(--muted); font-size: 11px; }
.lead-info-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 9px; align-content: start; }
.lead-info-fields > .row2 { display: contents; }
.lead-info-fields label { gap: 2px; font-size: 10px; }
.lead-info-fields input, .lead-info-fields select { padding: 4px 7px; min-height: 28px; font-size: 11px; }
.lead-info-fields #f-stage { color: #fff; background: #a1b4c4; font-weight: 700; text-align: center; }
.lead-detail-actions { position: static; flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 6px 8px; background: rgba(255,255,255,.97); border: 1px solid #d8dee8; border-radius: 8px; box-shadow: 0 -5px 20px rgba(31,40,50,.06); }
.lead-detail-actions button { padding-top: 8px; padding-bottom: 8px; }
.lead-detail-actions > div:first-child { margin-right: auto; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); z-index: 70;
  transform: translateX(-50%); padding: 11px 18px; color: #fff; background: #252a32;
  border-radius: 8px; box-shadow: 0 10px 30px rgba(20,25,30,.22); font-size: 13px; font-weight: 650;
}

/* Developer-only reporting */
.developer-nav { margin-top: 10px; color: #6b3fd4 !important; border: 1px solid #ddd2fa !important; background: #f7f3ff !important; }
.time-nav { margin-top: 10px; color: #087b62 !important; border: 1px solid #bce6d8 !important; background: #edfbf6 !important; }
.followup-modal { position: fixed; inset: 0; z-index: 112; }
.followup-backdrop { position: absolute; inset: 0; background: rgba(22,27,35,.42); backdrop-filter: blur(2px); }
.followup-panel { position: absolute; top: 50%; left: 50%; width: min(420px, calc(100vw - 24px)); transform: translate(-50%, -50%); overflow: hidden; background: #fff; border-radius: 12px; box-shadow: 0 22px 70px rgba(20,25,35,.3); }
.followup-panel header { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; color: #fff; background: #579bfc; }
.followup-panel header span { color: #dceaff; font-size: 10px; text-transform: uppercase; }
.followup-panel header h2 { font-size: 20px; }
.followup-panel header button { color: #fff; background: transparent; font-size: 27px; }
.followup-body { padding: 20px; }
.followup-body > p { margin-bottom: 15px; font-size: 16px; font-weight: 700; }
.followup-body label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
.followup-body input { padding: 11px; }
.followup-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 10px 0 16px; }
.followup-quick button { padding: 8px 5px; color: #2764ae; background: #edf5ff; border: 1px solid #c9ddf8; border-radius: 6px; font-size: 11px; }
.followup-body > .btn-primary { width: 100%; }
.time-modal { position: fixed; inset: 0; z-index: 115; }
.time-backdrop { position: absolute; inset: 0; background: rgba(22,27,35,.42); backdrop-filter: blur(2px); }
.time-panel { position: absolute; top: 50%; left: 50%; width: min(440px, calc(100vw - 24px)); transform: translate(-50%, -50%); overflow: hidden; background: #fff; border-radius: 13px; box-shadow: 0 22px 70px rgba(20,25,35,.3); }
.time-panel header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; color: #fff; background: #087f68; }
.time-panel header span { color: #bcecdf; font-size: 11px; text-transform: uppercase; }
.time-panel header h2 { font-size: 21px; }
.time-panel header button { color: #fff; background: transparent; font-size: 27px; }
.time-body { padding: 20px; }
.time-body label { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; color: var(--muted); font-size: 12px; font-weight: 650; }
.time-body input, .time-body select { padding: 10px; }
.time-clock { margin: 20px 0 4px; color: #20242c; font-size: 48px; font-weight: 750; letter-spacing: .05em; text-align: center; font-variant-numeric: tabular-nums; }
.time-body > p { color: var(--muted); font-size: 12px; text-align: center; }
.time-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 20px; }
.time-actions button { padding: 11px 8px; }
.time-actions button:disabled { opacity: .42; cursor: not-allowed; }
.developer-modal { position: fixed; inset: 0; z-index: 120; }
.developer-backdrop { position: absolute; inset: 0; background: rgba(22,27,35,.52); backdrop-filter: blur(3px); }
.developer-panel { position: absolute; inset: 3vh 3vw; overflow-y: auto; background: #f5f7fb; border-radius: 14px; box-shadow: 0 24px 80px rgba(20,25,35,.3); }
.developer-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; background: #242733; color: #fff; }
.developer-head span { color: #bfc5d5; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.developer-head h2 { margin-top: 2px; font-size: 22px; }
.developer-head button { color: #fff; background: transparent; font-size: 28px; }
.developer-login-form { width: min(390px, calc(100% - 30px)); margin: 10vh auto; padding: 26px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 35px rgba(30,35,45,.12); }
.developer-login-form h3 { margin-bottom: 18px; }
.developer-login-form label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; color: var(--muted); font-size: 12px; font-weight: 650; }
.developer-login-form input { padding: 11px; }
.developer-login-form .btn-primary { width: 100%; margin-top: 5px; }
.developer-reports { padding: 20px; }
.report-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.report-toolbar p { color: var(--muted); font-size: 12px; }
.report-toolbar > div:last-child { display: flex; gap: 8px; }
.report-toolbar select { padding: 8px 10px; background: #fff; }
.report-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.report-kpis article, .report-card { background: #fff; border: 1px solid #dce1e9; border-radius: 10px; }
.report-kpis article { display: flex; flex-direction: column; gap: 5px; padding: 16px; }
.report-kpis span { color: var(--muted); font-size: 12px; }
.report-kpis strong { font-size: 27px; }
.report-grid { display: grid; grid-template-columns: 1.4fr .6fr; gap: 14px; margin-bottom: 14px; }
.report-card { padding: 16px; }
.report-card h3 { margin-bottom: 13px; font-size: 16px; }
.report-bar { display: grid; grid-template-columns: 140px 1fr 35px; align-items: center; gap: 8px; margin: 7px 0; font-size: 12px; }
.report-bar > div { height: 9px; overflow: hidden; background: #edf0f4; border-radius: 9px; }
.report-bar i { display: block; height: 100%; border-radius: inherit; }
.group-stat { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #edf0f4; font-size: 13px; }
.activity-report > div { display: grid; grid-template-columns: 145px 1fr 1.5fr; gap: 12px; padding: 9px 4px; border-bottom: 1px solid #edf0f4; font-size: 12px; }
.activity-report time, .activity-report span { color: var(--muted); }
.user-log-group, .user-login-group { margin-top: 12px; overflow: hidden; border: 1px solid #e1e5ec; border-radius: 9px; }
.user-log-group h4, .user-login-group h4 { display: flex; justify-content: space-between; padding: 10px 12px; color: #313640; background: #f2f4f8; font-size: 13px; }
.user-login-group h4 span { color: var(--muted); font-size: 11px; font-weight: 500; }
.user-log-group > div { display: grid; grid-template-columns: 145px 170px 1fr 1fr; gap: 10px; padding: 9px 12px; border-top: 1px solid #edf0f4; font-size: 11px; }
.user-log-group em { color: var(--muted); font-style: normal; }
.time-report-card { margin-bottom: 14px; }
.time-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.time-summary article { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #eefaf6; border: 1px solid #ccebdd; border-radius: 8px; }
.time-summary strong { color: #087f68; font-size: 20px; font-variant-numeric: tabular-nums; }
.deals-workspace { padding: 24px 28px 40px; background: #f6f7fb; min-height: 100%; }
.deals-card { overflow: hidden; background: #fff; border: 1px solid #d9dee8; border-radius: 12px; box-shadow: 0 4px 18px rgba(36, 45, 60, .05); }
.deals-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 28px; border-bottom: 1px solid #e3e7ee; }
.deals-head span { color: #078fc2; font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.deals-head h2 { margin: 4px 0; font-size: 24px; }
.deals-head p { margin: 0; color: var(--muted); font-size: 13px; }
.deals-head > strong { padding: 8px 12px; color: #087f68; background: #e6f8f3; border-radius: 999px; font-size: 13px; }
.deals-groups { padding: 24px 28px 30px; display: grid; gap: 28px; }
.deals-group { border-left: 5px solid var(--deal-group-color); }
.deals-group-title { display: flex; align-items: center; gap: 9px; padding: 0 0 10px 14px; }
.deals-group-title > span { width: 10px; height: 10px; background: var(--deal-group-color); border-radius: 50%; }
.deals-group-title h3 { margin: 0; color: var(--deal-group-color); font-size: 19px; }
.deals-group-title b { min-width: 25px; padding: 3px 7px; color: #667085; background: #eef1f5; border-radius: 999px; font-size: 11px; text-align: center; }
.deals-table-wrap { overflow-x: auto; }
.deals-table { width: 100%; min-width: 880px; border-collapse: collapse; table-layout: fixed; }
.deals-table th, .deals-table td { padding: 12px 14px; border: 1px solid #dfe4ec; text-align: left; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deals-table th { color: #4a5260; background: #f8f9fb; font-weight: 700; }
.deals-table tbody tr[data-deal-id] { cursor: pointer; }
.deals-table tbody tr[data-deal-id]:hover { background: #f1f9fb; }
.deals-table td strong, .deals-table td small { display: block; overflow: hidden; text-overflow: ellipsis; }
.deals-table td small { margin-top: 3px; color: var(--muted); }
.deals-table a { color: #078fc2; font-weight: 650; }
.deal-status { display: block; padding: 8px 10px; color: #fff; background: var(--deal-status); border-radius: 4px; text-align: center; font-weight: 700; }
.deals-empty { padding: 24px !important; color: var(--muted); text-align: center !important; }
.time-report > div { display: grid; grid-template-columns: 90px 155px 155px 90px 1fr; gap: 10px; align-items: center; padding: 9px 4px; border-top: 1px solid #edf0f4; font-size: 12px; }
.time-report span, .time-report em { color: var(--muted); font-style: normal; }
.time-report b { color: #087f68; font-variant-numeric: tabular-nums; }
.presence-report-card { margin-bottom: 14px; }
.presence-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 13px 0; }
.presence-summary article { display: flex; flex-direction: column; gap: 4px; padding: 11px; background: #f7f8fb; border: 1px solid #e0e4eb; border-radius: 8px; font-size: 11px; }
.presence-summary article strong { font-size: 14px; }
.presence-summary article span { color: var(--muted); }
.user-login-group > div { display: grid; grid-template-columns: 85px 1.2fr 1.2fr 100px 100px; gap: 9px; align-items: center; padding: 9px 12px; border-top: 1px solid #edf0f4; font-size: 11px; }
.presence-report span, .presence-report em { color: var(--muted); font-style: normal; }
.presence-state { display: inline-flex; justify-content: center; padding: 4px 7px; border-radius: 20px; font-weight: 700; }
.presence-state.active { color: #087f5b; background: #ddf8eb; }
.presence-state.idle { color: #a66408; background: #fff0cf; }
.presence-state.offline { color: #68707a; background: #edf0f3; }
@media (max-width: 800px) { .developer-panel { inset: 0; border-radius: 0; } .report-kpis, .presence-summary { grid-template-columns: 1fr 1fr; } .report-grid { grid-template-columns: 1fr; } .activity-report > div, .time-report > div, .user-login-group > div, .user-log-group > div { grid-template-columns: 1fr; gap: 3px; } }

@media (max-width: 900px) {
  .app { grid-template-columns: 68px minmax(0, 1fr); }
  .sidebar { padding-inline: 9px; align-items: center; }
  .workspace-head, .workspace-switch span:not(.workspace-logo), .sidebar-nav button span:last-child,
  .sidebar-bottom button span:last-child { display: none; }
  .workspace-switch { justify-content: center; padding: 8px; }
  .sidebar-nav button, .sidebar-bottom button { justify-content: center; padding: 10px; }
  .sidebar-nav button > span:first-child, .sidebar-bottom button > span:first-child { width: auto; }
  .page-header { padding-left: 18px; padding-right: 18px; }
  .lead-workspace { padding-left: 18px; padding-right: 18px; }
  .filter-panel form { grid-template-columns: 1fr 1fr; }
  .filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .text-action span { display: none; }
  .lead-detail-panel { overflow-y: auto; }
  .lead-detail-body { height: auto; overflow: visible; }
  .lead-detail-grid { grid-template-columns: 1fr; }
  .phase-strip { overflow-x: auto; }
  .phase-step { min-width: 120px; }
}

@media (max-width: 600px) {
  .app { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 58px; }
  .sidebar { grid-row: 2; flex-direction: row; width: 100%; padding: 6px 10px calc(6px + var(--safe-bottom)); border: 0; border-top: 1px solid var(--line); overflow: hidden; z-index: 20; }
  .workspace-switch, .sidebar-bottom, .sidebar-nav button:not(.active) { display: none; }
  .sidebar-nav { width: 100%; }
  .sidebar-nav button.active { flex-direction: column; gap: 1px; padding: 4px; background: transparent; }
  .sidebar-nav button.active span:last-child { display: block; font-size: 10px; }
  .content-shell { grid-row: 1; }
  .page-header { padding: calc(12px + var(--safe-top)) 14px 0; }
  .title-row h1 { font-size: 22px; }
  .header-actions .text-action { display: none; }
  .tabs { margin-top: 4px; }
  .tabs button:not(.active):not(.tab-add) { display: none; }
  .lead-workspace { padding: 12px 14px 18px; }
  .capture-workspace { padding: 12px 10px 24px; }
  .archive-workspace { padding: 12px 10px 24px; }
  .deals-workspace { padding: 12px 10px 24px; }
  .deals-head, .deals-groups { padding: 18px; }
  .deals-head > strong { display: none; }
  .archive-head { padding: 18px; }
  .archive-head > strong { display: none; }
  .archive-toolbar { align-items: stretch; flex-direction: column; }
  .archive-toolbar .btn-primary { width: 100%; }
  .capture-head { padding: 18px; }
  .capture-form { padding: 18px; }
  .capture-grid { grid-template-columns: 1fr; gap: 12px; }
  .capture-wide { grid-column: auto; }
  .capture-actions { flex-direction: column-reverse; }
  .capture-actions button { width: 100%; }
  .toolbar { margin-bottom: 18px; }
  .filter-panel { margin-top: -8px; }
  .filter-panel form { grid-template-columns: 1fr; }
  .filter-actions { grid-column: auto; }
  .filter-actions button { flex: 1; }
  .filter-summary { align-items: flex-start; gap: 7px; flex-direction: column; }
  #filter-result-count { margin-left: 0; }
  .row2 { grid-template-columns: 1fr; }
  .lead-detail-panel { inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; }
  .lead-detail-head { padding: 14px 16px 8px; }
  .lead-detail-head h2 { max-width: calc(100vw - 75px); overflow: hidden; font-size: 21px; text-overflow: ellipsis; white-space: nowrap; }
  .lead-detail-tabs { padding: 0 16px; }
  .lead-detail-body { padding: 12px; }
  .phase-card-body, .activity-body, .lead-info-fields { padding: 14px; }
  .lead-detail-actions { flex-wrap: wrap; }
  .lead-detail-actions > div:first-child { width: 100%; }
}

/* Tägliche Logins & Online-Zeit */
.daily-report-card { margin-bottom: 14px; }
.daily-report .user-login-group > div { grid-template-columns: 100px 1fr 1.2fr 1.4fr; }
.daily-report span, .daily-report em { color: var(--muted); font-style: normal; }

/* Sortierbare Status-Spalte */
.lead-table th.sortable-column { cursor: pointer; user-select: none; }
.lead-table th.sortable-column:hover { color: #078fc2; }

/* Spalten verschieben & umbenennen */
.lead-table th[draggable="true"] { cursor: grab; }
.lead-table th.sortable-column { cursor: pointer; }
.lead-table th .column-rename { display: none; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; cursor: pointer; font-size: 13px; color: #8a93a3; padding: 2px 4px; line-height: 1; }
.lead-table th:hover .column-rename { display: inline-block; }
.lead-table th .column-rename:hover { color: #078fc2; }
.lead-table th.drag-over { box-shadow: inset 3px 0 0 #078fc2; }

/* Fixierter Tabellenkopf beim Scrollen */
.lead-table thead { position: relative; z-index: 4; }
.lead-table thead.is-stuck th { box-shadow: 0 3px 8px rgba(31, 45, 61, .10); }

/* Oberer horizontaler Scrollbalken über jeder Tabelle */
.table-scroll-top { overflow-x: auto; overflow-y: hidden; height: 14px; background: #fff; border: 1px solid var(--line); border-left: 0; border-bottom: 0; position: relative; z-index: 5; }
.table-scroll-top > div { height: 1px; }
.table-scroll-top::-webkit-scrollbar { height: 12px; }
.table-scroll-top::-webkit-scrollbar-track { background: #f2f4f8; }
.table-scroll-top::-webkit-scrollbar-thumb { background: #c3cbd7; border-radius: 6px; border: 2px solid #f2f4f8; }
.table-scroll-top::-webkit-scrollbar-thumb:hover { background: #9aa6b6; }
.table-scroll-top.is-stuck { box-shadow: 0 2px 5px rgba(31, 45, 61, .08); }

/* Einklappbare Gruppen — zugeklappt als kompakte Karte (monday-Stil) */
.group-title { cursor: pointer; user-select: none; }
.group-toggle { transition: transform .15s ease; }
.lead-group.collapsed .group-toggle { transform: rotate(-90deg); }
.lead-group.collapsed .group-board { display: none; }
.lead-group.collapsed { min-width: 0; }
.lead-group.collapsed .group-title {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 10px;
  margin-bottom: 10px; padding: 10px 16px 12px 10px;
  background: #fff; border: 1px solid #e3e7ee; border-left: 6px solid var(--group-color, #94a3b8);
  border-radius: 8px; box-shadow: 0 1px 3px rgba(31, 45, 61, .05);
}
.lead-group.collapsed .group-title:hover { border-color: var(--group-color, #94a3b8); }
.lead-group.collapsed .group-toggle { grid-row: 1 / span 2; }
.lead-group.collapsed .group-title h2 { grid-column: 2; grid-row: 1; font-size: 17px; }
.lead-group.collapsed .group-rename { grid-column: 3; grid-row: 1; }
.lead-group.collapsed .lead-total { grid-column: 2; grid-row: 2; }
.appointment-group.collapsed .group-title { background: #fffdf7; }

/* Gruppen umbenennen */
.group-title .group-rename { display: none; border: 0; background: transparent; cursor: pointer; font-size: 14px; color: #8a93a3; padding: 2px 5px; }
.group-title:hover .group-rename { display: inline-block; }
.group-title .group-rename:hover { color: var(--group-color, #078fc2); }

/* Datei-Import */
.import-panel { width: min(680px, 100%); }
.import-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 20px; border: 2px dashed #c6cdd8; border-radius: 12px; cursor: pointer; text-align: center; color: #313640; }
.import-drop:hover { border-color: #078fc2; background: #f4f9fc; }
.import-drop span { font-size: 12px; color: #8a93a3; }
.import-drop input { display: none; }
.import-options { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.import-subhead { margin: 6px 0 2px; font-size: 14px; }
.import-mapping { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 10px 0 4px; }
.import-map-row { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #545b66; }
.import-summary h3 { margin-bottom: 10px; }
.import-summary p { margin: 4px 0; }
.import-summary details { margin-top: 10px; font-size: 13px; }
.import-summary details div { padding: 2px 0; color: #545b66; }
@media (max-width: 700px) { .import-options, .import-mapping { grid-template-columns: 1fr; } }

/* Neu:-Lead-Dropdown */
.new-lead-wrap { position: relative; }
.new-lead-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 80; min-width: 230px; display: flex; flex-direction: column; padding: 6px; background: #fff; border: 1px solid #dbe1e9; border-radius: 10px; box-shadow: 0 10px 30px rgba(31, 45, 61, .16); }
.new-lead-menu button { text-align: left; border: 0; background: transparent; padding: 9px 11px; border-radius: 7px; font-size: 14px; color: #313640; cursor: pointer; white-space: nowrap; }
.new-lead-menu button:hover { background: #eef2f7; }
