:root {
  --bg: #f4f5f1;
  --surface: #ffffff;
  --surface-2: #eef2ec;
  --ink: #18211f;
  --muted: #66736d;
  --line: #d9dfd8;
  --accent: #0f766e;
  --accent-dark: #0b514d;
  --warn: #b45309;
  --danger: #b42318;
  --shadow: 0 12px 30px rgba(24, 33, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
a.primary-button,
.file-button {
  transition: background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease, border-color 140ms ease;
}

button:hover,
a.primary-button:hover,
.file-button:hover {
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.16);
  transform: translateY(-1px);
}

.sidebar {
  background: #17201e;
  color: #f6f8f4;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  left: 0;
  padding: 22px;
  position: fixed;
  top: 0;
  transition: width 180ms ease, padding 180ms ease;
  width: 260px;
}

.sidebar-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: #d8dedb;
  display: flex;
  gap: 12px;
  font-weight: 800;
  justify-content: flex-start;
  padding: 0 0 18px;
}

.sidebar-toggle span {
  font-size: 26px;
  line-height: 1;
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand strong {
  display: block;
  font-size: 20px;
}

.brand small,
.sidebar-card small {
  color: #b8c3be;
  display: block;
  margin-top: 2px;
}

.brand-mark {
  align-items: end;
  background: #edf8f5;
  border-radius: 8px;
  display: flex;
  gap: 3px;
  height: 42px;
  justify-content: center;
  padding: 8px;
  width: 42px;
}

.brand-mark span {
  background: var(--accent);
  border-radius: 999px 999px 2px 2px;
  display: block;
  width: 6px;
}

.brand-mark span:nth-child(1) {
  height: 14px;
}

.brand-mark span:nth-child(2) {
  height: 24px;
}

.brand-mark span:nth-child(3) {
  height: 18px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #d8dedb;
  padding: 12px 14px;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 16px;
}

.sidebar-user-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #ffffff;
  display: grid;
  gap: 10px;
  grid-template-columns: 46px 1fr auto;
  margin-top: auto;
  padding: 12px;
  text-align: left;
}

.sidebar-user-text strong,
.sidebar-user-text small {
  display: block;
}

.sidebar-user-text small {
  color: #b8c3be;
  margin-top: 2px;
}

.user-avatar {
  align-items: center;
  background: linear-gradient(135deg, #e8f7f4, #dfe8ff);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  color: var(--accent-dark);
  display: inline-flex;
  font-size: 14px;
  font-weight: 900;
  height: 46px;
  justify-content: center;
  overflow: hidden;
  width: 46px;
}

.user-avatar.small {
  height: 44px;
  width: 44px;
}

.sidebar-collapsed .sidebar {
  padding: 22px 12px;
  width: 84px;
}

.sidebar-collapsed .shell {
  margin-left: 84px;
}

.sidebar-collapsed .brand div:last-child,
.sidebar-collapsed .nav-item,
.sidebar-collapsed .sidebar-card,
.sidebar-collapsed .legal-links,
.sidebar-collapsed .sidebar-user-text,
.sidebar-collapsed .sidebar-user-card i,
.sidebar-collapsed .sidebar-toggle strong {
  display: none;
}

.sidebar-collapsed .brand,
.sidebar-collapsed .sidebar-toggle,
.sidebar-collapsed .sidebar-user-card {
  justify-content: center;
}

.sidebar-collapsed .sidebar-user-card {
  display: flex;
  padding: 8px;
}

.legal-links {
  display: flex;
  gap: 12px;
}

.legal-links a {
  color: #b8c3be;
  font-size: 13px;
  text-decoration: none;
}

.legal-links a:hover {
  color: #ffffff;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.shell {
  margin-left: 260px;
  min-height: 100vh;
  padding: 20px;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
}

.topbar-title-row {
  align-items: flex-start;
  display: flex;
  gap: 12px;
}

.back-button {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 30px;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  line-height: 1;
  margin-top: 2px;
  width: 42px;
}

.topbar h1 {
  font-size: 38px;
  line-height: 1;
  margin: 0;
}

.topbar-subtitle {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  margin: 8px 0 0;
}

.header-timer {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  padding: 10px 12px;
}

.header-timer .metric-icon {
  height: 46px;
  width: 46px;
}

.header-timer strong {
  display: block;
  font-size: 18px;
}

.header-timer small {
  color: var(--muted);
  display: block;
  font-weight: 700;
}

.topbar-actions,
.call-actions,
.toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-actions {
  position: relative;
}

.topbar-icon-button,
.profile-button,
.topbar-auth-button {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 46px;
}

.topbar-icon-button {
  font-size: 22px;
  position: relative;
  width: 46px;
}

.topbar-icon-button.has-dot::after {
  background: #3b82f6;
  border: 2px solid #ffffff;
  border-radius: 999px;
  content: "";
  height: 9px;
  position: absolute;
  right: 8px;
  top: 8px;
  width: 9px;
}

.topbar-auth-button {
  border-radius: 8px;
  padding: 0 18px;
}

.profile-button {
  gap: 10px;
  padding: 4px 10px 4px 4px;
}

.profile-button i {
  color: var(--muted);
  font-style: normal;
  font-size: 18px;
}

.profile-menu {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  min-width: 220px;
  padding: 14px;
  position: absolute;
  right: 68px;
  top: calc(100% + 10px);
  z-index: 20;
}

.profile-menu .secondary-button,
.profile-menu .danger-button {
  width: 100%;
}

.profile-menu strong,
.profile-menu small {
  display: block;
}

.profile-menu small {
  color: var(--muted);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.primary-button,
.secondary-button,
.danger-button,
.file-button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button,
.file-button {
  background: var(--surface-2);
  color: var(--ink);
}

.primary-button.file-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button.file-button:hover {
  background: var(--accent-dark);
}

.danger-button {
  background: #fee4e2;
  color: var(--danger);
}

#stopWorkButton,
#headerStopButton {
  background: #fee4e2;
  border: 1px solid #f3b8b2;
  color: var(--danger);
}

.icon-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-dark);
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  padding: 0;
  width: 34px;
}

.icon-button.disabled {
  color: var(--muted);
  opacity: 0.45;
}

.danger-icon {
  color: var(--danger);
}

.file-button input {
  display: none;
}

.full-width {
  width: 100%;
}

.hidden {
  display: none !important;
}

.auth-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-message {
  color: var(--muted);
  font-size: 13px;
  min-height: 20px;
}

.auth-message.error {
  color: var(--danger);
}

.auth-message.success {
  color: var(--accent-dark);
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 16px;
}

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(24, 33, 31, 0.06);
}

.metric {
  min-height: 170px;
  padding: 18px;
}

.lead-detail-grid span {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.metric-top {
  align-items: center;
  display: flex;
  gap: 16px;
}

.metric-top span:last-child {
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
}

.metric-icon {
  align-items: center;
  background: #e8f7f4;
  border-radius: 8px;
  color: var(--accent);
  display: inline-flex;
  font-size: 24px;
  height: 58px;
  justify-content: center;
  width: 58px;
}

.metric-mid {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 72px;
  margin: 8px 0 10px;
}

.metric strong {
  display: block;
  font-size: 38px;
  line-height: 1;
}

.metric small {
  color: var(--muted);
  display: block;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}

.metric svg {
  height: 28px;
  width: 72px;
}

.metric svg path {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-width: 4;
}

.metric-progress {
  background: var(--line);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}

.metric-progress i {
  background: var(--accent);
  display: block;
  height: 100%;
}

.metric-calls .metric-icon {
  background: #e8f7f4;
  color: #0f766e;
}

.metric-worktime .metric-icon {
  background: #e8f2ff;
  color: #3b82f6;
}

.metric-worktime svg path,
.metric-worktime .metric-progress i {
  stroke: #3b82f6;
  background: #3b82f6;
}

.metric-followups .metric-icon {
  background: #f0e9ff;
  color: #8b5cf6;
}

.metric-followups svg path,
.metric-followups .metric-progress i {
  stroke: #8b5cf6;
  background: #8b5cf6;
}

.metric-leads .metric-icon {
  background: #fff0df;
  color: #f97316;
}

.metric-leads svg path,
.metric-leads .metric-progress i {
  stroke: #f97316;
  background: #f97316;
}

.metric-streak .metric-icon {
  background: #e8f7f4;
  color: #16a34a;
}

.metric-streak svg path,
.metric-streak .metric-progress i {
  stroke: #16a34a;
  background: #16a34a;
}

.metric-delta.positive {
  color: #16a34a;
}

.metric-delta.negative {
  color: #ef4444;
}

.metric-delta.neutral {
  color: var(--muted);
}

.main-grid,
.call-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  margin-bottom: 16px;
}

.panel {
  margin-bottom: 16px;
  padding: 22px;
}

.panel-header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel h2 {
  font-size: 20px;
  margin: 0;
}

.panel p {
  color: var(--muted);
  margin: 4px 0 0;
}

.leads-hero {
  padding-bottom: 20px;
}

.leads-hero h2 {
  font-size: 48px;
  line-height: 1;
}

.leads-hero .panel-header {
  align-items: center;
}

.compact-field {
  max-width: 420px;
}

.lead-metric-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}

.lead-mini-card {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(24, 33, 31, 0.06);
  display: flex;
  gap: 28px;
  min-height: 148px;
  padding: 26px;
}

.lead-mini-card small,
.lead-mini-card em {
  color: var(--muted);
  display: block;
  font-style: normal;
  font-weight: 700;
}

.lead-mini-card strong {
  display: block;
  font-size: 42px;
  line-height: 1.05;
  margin: 6px 0;
}

.metric-icon.blue {
  background: #e8f2ff;
  color: #1d7ed8;
}

.metric-icon.orange {
  background: #fff4df;
  color: #f59e0b;
}

.metric-icon.purple {
  background: #f4eaff;
  color: #7c3aed;
}

.metric-icon.green {
  background: #e8f7f4;
  color: #16a34a;
}

.lead-table-header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.task-list,
.timeline,
.followup-list,
.stats-list,
.ai-brief,
.import-summary {
  display: grid;
  gap: 10px;
}

.empty-state {
  color: var(--muted);
  padding: 8px 0;
}

.task,
.timeline-item,
.followup-item,
.stat-row,
.brief-card {
  background: #f8faf7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.coach-card {
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.coach-card:hover {
  border-color: var(--accent);
}

.brief-card pre {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  line-height: 1.5;
  overflow-x: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.task {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: auto 1fr auto;
}

.task-index {
  align-items: center;
  background: var(--ink);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 12px;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.pill {
  background: var(--surface-2);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
}

.pill.due {
  background: #fff7ed;
  color: var(--warn);
}

.pill.good {
  background: #e8f7f4;
  color: var(--accent-dark);
}

.field {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
  margin-bottom: 12px;
}

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  line-height: 1.45;
  resize: vertical;
}

.toolbar {
  margin-bottom: 14px;
}

.toolbar input {
  flex: 1 1 280px;
}

.toolbar select {
  flex: 0 0 190px;
}

.work-tracker {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(220px, 0.34fr) minmax(280px, 1fr);
  margin-bottom: 22px;
}

.work-tracker .field {
  margin-bottom: 0;
}

.work-controls {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.3fr 1fr 1fr;
  margin-bottom: 18px;
}

.work-controls.idle {
  grid-template-columns: 1fr;
}

.work-controls button {
  min-height: 64px;
  font-size: 18px;
}

.plan-summary {
  display: grid;
  gap: 0;
}

.day-detail-panel {
  display: grid;
  gap: 16px;
}

.day-detail-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.day-detail-row {
  align-items: center;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: 122px 34px 1fr auto;
  min-height: 54px;
  padding: 10px 14px;
  text-align: left;
  width: 100%;
}

.day-detail-row:last-child {
  border-bottom: 0;
}

.day-detail-row span {
  color: var(--muted);
  font-weight: 700;
}

.day-detail-row i {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-style: normal;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.day-detail-row strong {
  font-size: 15px;
}

.day-detail-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.day-detail-row.call i {
  background: #e8f7f4;
  color: #16a34a;
}

.day-detail-row.follow i {
  background: #f0e9ff;
  color: #8b5cf6;
}

.day-detail-row.admin i {
  background: #e8f2ff;
  color: #3b82f6;
}

.day-detail-row.break i {
  background: #f3f4f6;
  color: #4b5563;
}

.day-detail-row.focus i {
  background: #fff0df;
  color: #f97316;
}

.day-detail-row:hover {
  background: #f8faf7;
}

.day-detail-stats {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.day-chip {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 10px 6px;
  text-align: center;
}

.day-chip small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 6px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.day-chip strong {
  display: block;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.05;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.day-chip.green {
  background: #edf8f5;
  color: #15803d;
}

.day-chip.blue,
.day-chip.blue-soft {
  background: #eef6ff;
  color: #2563eb;
}

.day-chip.purple {
  background: #f5efff;
  color: #7c3aed;
}

.day-chip.orange {
  background: #fff7ed;
  color: #f97316;
}

.plan-row {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  display: grid;
  gap: 18px;
  grid-template-columns: 58px 52px 1fr auto;
  min-height: 76px;
  padding: 10px 0;
  text-align: left;
}

.plan-row .metric-icon {
  font-size: 26px;
  height: 48px;
  width: 48px;
}

.plan-row strong {
  font-size: 30px;
}

.plan-row span:not(.metric-icon) {
  color: var(--muted);
  font-weight: 700;
}

.plan-row b {
  color: var(--muted);
  font-size: 30px;
}

.compact-task {
  margin-top: 10px;
}

.tel-link {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.tel-link:hover {
  text-decoration: underline;
}

.lead-groups {
  display: grid;
  gap: 14px;
}

.lead-list-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.lead-list-head {
  align-items: center;
  background: #ffffff;
  border: 0;
  color: var(--ink);
  display: grid;
  gap: 14px;
  grid-template-columns: 34px 1fr auto;
  padding: 16px;
  text-align: left;
  width: 100%;
}

.lead-list-head > span {
  align-items: center;
  background: var(--surface-2);
  border-radius: 999px;
  display: inline-flex;
  font-size: 24px;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.lead-list-head strong,
.lead-list-head small {
  display: block;
}

.lead-list-head small {
  color: var(--muted);
  font-weight: 700;
  margin-top: 3px;
}

.lead-list-actions {
  display: flex;
  gap: 8px;
}

.lead-list-actions b {
  background: var(--surface-2);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 8px 10px;
}

.lead-list-actions b:hover {
  background: #e8f7f4;
  color: var(--accent-dark);
}

.lead-list-card .table-wrap {
  border-top: 1px solid var(--line);
}

.lead-list-card .lead-list-head:hover {
  background: #f8faf7;
}

.lead-list-card .lead-list-head:hover > span {
  background: #dff3ef;
  color: var(--accent-dark);
}

.settings-list {
  display: grid;
  gap: 10px;
}

.settings-row {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
}

.settings-row strong,
.settings-row small {
  display: block;
}

.settings-row small {
  color: var(--muted);
  font-weight: 700;
  margin-top: 3px;
}

.checkbox-row {
  cursor: pointer;
  justify-content: flex-start;
}

.checkbox-row input {
  height: 18px;
  width: 18px;
}

.small-button {
  min-height: auto;
  padding: 8px 10px;
}

.report-layout {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(280px, 360px) 1fr;
}

.report-card-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(24, 33, 31, 0.05);
  padding: 18px;
}

.report-card small,
.report-card em {
  color: var(--muted);
  display: block;
  font-style: normal;
  font-weight: 700;
}

.report-card strong {
  display: block;
  font-size: 30px;
  line-height: 1;
  margin: 14px 0 8px;
}

.crm-pipeline {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.crm-column {
  background: #f8faf7;
  border: 1px solid var(--line);
  border-top: 4px solid #94a3b8;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.crm-column-neu {
  border-top-color: #94a3b8;
}

.crm-column-erreicht {
  border-top-color: #14b8a6;
}

.crm-column-follow-up {
  border-top-color: #3b82f6;
}

.crm-column-termin {
  border-top-color: #8b5cf6;
}

.crm-column-kein-interesse {
  border-top-color: #ef4444;
}

.crm-column-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.crm-column-head span {
  background: #e8f7f4;
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  padding: 4px 9px;
}

.crm-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.crm-card strong,
.crm-card small,
.crm-card span {
  display: block;
}

.crm-card small,
.crm-card span {
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
}

.compact-empty {
  padding: 12px;
}

.crm-more {
  font-weight: 800;
  padding: 8px;
  text-align: center;
}

.score-bar {
  background: var(--line);
  border-radius: 999px;
  height: 5px;
  margin-top: 6px;
  overflow: hidden;
  width: 90px;
}

.score-bar i {
  background: var(--accent);
  display: block;
  height: 100%;
}

.table-actions {
  display: flex;
  gap: 8px;
}

.status-neu,
.status-kontaktiert {
  background: #e8f1ff;
  color: #2563eb;
}

.status-erreicht {
  background: #e8f7f4;
  color: #0f766e;
}

.status-follow-up {
  background: #e8f1ff;
  color: #2563eb;
}

.status-termin {
  background: #f3e8ff;
  color: #7c3aed;
}

.status-kein-interesse {
  background: #fee4e2;
  color: var(--danger);
}

.kpi-card-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(24, 33, 31, 0.06);
  padding: 22px;
}

.kpi-card strong {
  display: block;
  font-size: 32px;
  line-height: 1;
  margin: 18px 0 8px;
}

.kpi-card svg {
  height: 28px;
  margin: 14px 0;
  width: 72px;
}

.kpi-card svg path {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-width: 4;
}

.kpi-card.blue svg path,
.kpi-card.blue .metric-progress i {
  stroke: #3b82f6;
  background: #3b82f6;
}

.kpi-card.purple svg path,
.kpi-card.purple .metric-progress i {
  stroke: #8b5cf6;
  background: #8b5cf6;
}

.kpi-card.orange svg path,
.kpi-card.orange .metric-progress i {
  stroke: #f97316;
  background: #f97316;
}

.kpi-dashboard-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.85fr);
}

.kpi-funnel {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(160px, 0.8fr) 1fr;
}

.funnel-shape {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.funnel-shape i {
  background: var(--c);
  clip-path: polygon(8% 0, 92% 0, 82% 100%, 18% 100%);
  display: block;
  height: 44px;
  opacity: 0.92;
  width: var(--w);
}

.funnel-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.funnel-list div,
.distribution-list div {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 12px 64px 1fr auto;
  padding: 12px;
}

.funnel-list div:last-child,
.distribution-list div:last-child {
  border-bottom: 0;
}

.funnel-list span,
.distribution-list span {
  border-radius: 999px;
  height: 10px;
  width: 10px;
}

.funnel-list small,
.distribution-list small,
.funnel-list em,
.distribution-list em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.kpi-distribution {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: 180px 1fr;
}

.donut {
  align-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), #cbd5e1 0);
  border-radius: 999px;
  display: flex;
  flex-direction: column;
  height: 170px;
  justify-content: center;
  position: relative;
  width: 170px;
}

.donut::after {
  background: #ffffff;
  border-radius: 999px;
  content: "";
  inset: 38px;
  position: absolute;
}

.donut strong,
.donut small {
  position: relative;
  z-index: 1;
}

.donut strong {
  font-size: 24px;
}

.donut small {
  color: var(--muted);
  font-weight: 800;
}

.kpi-insights {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.insight-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.insight-card span,
.insight-card small,
.insight-card strong,
.insight-card em {
  display: block;
}

.insight-card span {
  color: var(--accent);
  font-size: 28px;
  margin-bottom: 14px;
}

.insight-card small,
.insight-card em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.insight-card strong {
  font-size: 26px;
  margin: 8px 0;
}

.insight-card.blue {
  background: #f4f8ff;
}

.insight-card.purple {
  background: #faf5ff;
}

.insight-card.orange {
  background: #fff7ed;
}

.settings-foldout {
  margin-top: 18px;
}

.settings-foldout summary {
  cursor: pointer;
  font-weight: 800;
  margin-bottom: 12px;
}

.week-chart {
  align-items: end;
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-height: 300px;
  padding: 40px 30px 8px;
  position: relative;
}

.week-chart::before {
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 59px, var(--line) 60px);
  content: "";
  inset: 20px 20px 46px;
  pointer-events: none;
  position: absolute;
}

.week-tools {
  align-items: center;
  display: flex;
  gap: 28px;
}

.week-tools select {
  min-width: 160px;
}

.chart-legend {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-weight: 800;
  gap: 22px;
}

.chart-legend span {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.legend-dot {
  background: var(--accent);
  border-radius: 999px;
  height: 12px;
  width: 12px;
}

.legend-line {
  background: #3b82f6;
  border-radius: 999px;
  height: 4px;
  width: 22px;
}

.week-axis {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  position: absolute;
  top: 12px;
}

.week-axis-left {
  left: 10px;
}

.week-axis-right {
  right: 10px;
}

.week-line {
  height: calc(100% - 64px);
  left: 30px;
  pointer-events: none;
  position: absolute;
  right: 30px;
  top: 40px;
  width: calc(100% - 60px);
  z-index: 2;
}

.week-line polyline {
  fill: none;
  stroke: #3b82f6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.day-bar {
  align-items: stretch;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  height: 280px;
  padding: 12px;
  position: relative;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.day-bar span,
.day-bar strong {
  position: relative;
  z-index: 1;
}

.day-bar i {
  align-self: end;
  background: linear-gradient(180deg, #19a79c, #0f766e);
  border-radius: 8px 8px 0 0;
  display: block;
  min-height: 8px;
  position: relative;
  z-index: 1;
}

.day-bar i small {
  color: #ffffff;
  display: block;
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
  padding-top: 8px;
}

.day-bar.active {
  background: #eef8f5;
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.18);
}

.day-bar > strong {
  color: var(--accent-dark);
  font-size: 16px;
  margin-bottom: 10px;
}

.day-bar > span {
  color: var(--muted);
  font-weight: 800;
  margin-top: 10px;
}

.day-bar > em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  margin-top: 4px;
}

.day-bar:hover {
  background: #f8faf7;
  border-color: var(--line);
  transform: translateY(-2px);
}

.week-summary {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
  padding: 22px;
}

.week-summary-item {
  align-items: center;
  border-right: 1px solid var(--line);
  display: flex;
  gap: 18px;
}

.week-summary-item:last-child {
  border-right: 0;
}

.week-summary-item .metric-icon {
  flex: 0 0 auto;
}

.week-summary-item strong {
  display: block;
  font-size: 24px;
}

.week-summary-item small {
  color: var(--muted);
  display: block;
  font-weight: 700;
}

.kpi-pivot-wrap {
  overflow-x: auto;
}

.kpi-pivot-wrap table {
  min-width: 920px;
}

.kpi-pivot-wrap td,
.kpi-pivot-wrap th {
  border: 1px solid var(--line);
  font-size: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 840px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #f8faf7;
}

.lead-detail-grid,
.settings-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.settings-grid.single-column {
  grid-template-columns: 1fr;
}

.call-card .panel-header {
  align-items: flex-start;
  min-height: 104px;
}

#callCompany {
  line-height: 1.08;
}

#callMeta {
  display: -webkit-box;
  line-height: 1.35;
  max-width: 560px;
  min-height: 44px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lead-info-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 2px 14px;
  grid-template-columns: 56px 1fr;
  min-height: 92px;
  min-width: 0;
  padding: 18px;
}

.lead-info-card span,
.lead-info-card label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.lead-info-card strong,
.lead-info-card input {
  display: block;
  font-size: 20px;
  font-weight: 900;
  grid-column: 2;
  line-height: 1.2;
  min-height: auto;
  overflow-wrap: anywhere;
  padding: 0;
}

#callWebsite,
#callPhone,
#callRating {
  max-height: 48px;
  overflow: hidden;
}

.inline-edit-input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.inline-edit-input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18);
  outline-offset: 4px;
}

.call-info-icon {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-style: normal;
  font-size: 24px;
  font-weight: 900;
  grid-row: span 2;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.call-info-icon.green {
  background: #e8f7f4;
  color: #0f766e;
}

.call-info-icon.gray {
  background: #f1f5f9;
  color: #475569;
}

.call-info-icon.orange {
  background: #fff4df;
  color: #f59e0b;
}

.lead-progress {
  display: grid;
  gap: 8px;
  min-width: 170px;
}

.lead-progress span {
  color: var(--muted);
  font-weight: 800;
}

.lead-progress i {
  background: var(--line);
  border-radius: 999px;
  display: block;
  height: 8px;
  overflow: hidden;
}

.lead-progress b {
  background: var(--accent);
  display: block;
  height: 100%;
}

.outline-danger {
  background: #ffffff;
  border: 1px solid #f3c8c5;
}

.outline-accent {
  background: #ffffff;
  border: 1px solid rgba(15, 118, 110, 0.32);
  color: var(--accent-dark);
}

.call-tool-button {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  gap: 10px;
  min-height: 58px;
  padding-inline: 22px;
}

.call-tool-button span {
  font-size: 22px;
}

.compact-call-filter {
  margin-bottom: 0;
  min-width: 180px;
}

.call-note-input {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
  min-height: 150px;
  resize: vertical;
  width: 100%;
}

.result-button {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  justify-content: center;
  min-height: 62px;
  padding-inline: 24px;
}

.result-button span {
  font-size: 20px;
}

.success-soft {
  background: #eef9f0;
  border: 1px solid #c8e6cc;
  color: #2f7d32;
}

.blue-action {
  background: #256f87;
}

.ai-suggestion {
  background: #e9f8f5;
  border: 1px solid #bfe3dc;
  border-radius: 8px;
  color: var(--accent-dark);
  margin-top: 14px;
  padding: 16px;
}

.ai-suggestion p {
  color: var(--accent-dark);
  margin-top: 8px;
}

.followup-actions {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 22px;
  overflow: hidden;
}

.side-action {
  align-items: center;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  display: grid;
  gap: 3px 14px;
  grid-template-columns: 42px 1fr auto;
  min-height: 76px;
  padding: 14px 18px;
  text-align: left;
  width: 100%;
}

.side-action:last-child {
  border-bottom: 0;
}

.side-action span {
  color: var(--muted);
  font-size: 26px;
  grid-row: span 2;
}

.side-action strong,
.side-action small {
  display: block;
}

.side-action small {
  color: var(--muted);
  font-weight: 700;
}

.side-action b {
  color: var(--muted);
  font-size: 24px;
  grid-row: span 2;
}

.dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(24, 33, 31, 0.24);
  max-width: 480px;
  padding: 22px;
  width: calc(100vw - 32px);
}

.dialog::backdrop {
  background: rgba(24, 33, 31, 0.42);
}

.dialog h2 {
  margin-top: 0;
}

.dialog menu {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin: 14px 0 0;
  padding: 0;
}

.muted {
  color: var(--muted);
}

.legal-page {
  background: var(--bg);
}

.legal-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  line-height: 1.6;
  margin: 40px auto;
  max-width: 860px;
  padding: 32px;
}

.legal-shell h1 {
  font-size: 36px;
  line-height: 1.1;
  margin: 14px 0 8px;
}

.legal-shell h2 {
  font-size: 20px;
  margin: 28px 0 8px;
}

.legal-shell p,
.legal-shell li {
  color: var(--muted);
}

.legal-back {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 1040px) {
  .sidebar {
    height: auto;
    position: static;
    width: auto;
  }

  .sidebar-collapsed .sidebar {
    padding: 22px;
    width: auto;
  }

  .shell {
    margin-left: 0;
  }

  .sidebar-collapsed .shell {
    margin-left: 0;
  }

  .metric-grid,
  .lead-metric-grid,
  .kpi-card-grid,
  .kpi-insights,
  .day-detail-stats,
  .main-grid,
  .call-layout,
  .kpi-dashboard-grid,
  .kpi-funnel,
  .kpi-distribution,
  .report-layout,
  .crm-pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .week-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 16px;
  }

  .topbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .call-actions,
  .inline-actions,
  .week-tools,
  .chart-legend {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .lead-metric-grid,
  .kpi-card-grid,
  .kpi-insights,
  .day-detail-stats,
  .main-grid,
  .call-layout,
  .kpi-dashboard-grid,
  .kpi-funnel,
  .kpi-distribution,
  .lead-detail-grid,
  .settings-grid,
  .work-tracker,
  .week-chart,
  .report-layout,
  .report-card-grid,
  .crm-pipeline {
    grid-template-columns: 1fr;
  }

  .week-summary {
    grid-template-columns: 1fr;
  }

  .day-detail-row {
    grid-template-columns: 1fr auto;
  }

  .day-detail-row i,
  .day-detail-row strong {
    grid-row: 2;
  }

  .lead-table-header {
    flex-direction: column;
  }

  .day-bar {
    height: 96px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
