/*
  Struktur
  1. Tokens, Reset und App-Grundlayout
  2. Sidebar, Navigation, FAQ und Erfolgsmodus
  3. Kopfbereiche, Fokusmodus und Pipeline-Layout
  4. Lead-Liste, Bearbeitungsbereich und Aktivitäten
  5. Formulare, Popups, Gmail-Dialoge und Login
  6. Animationen und responsive Anpassungen
*/

:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #2e2e2e;
  --deep: #101816;
  --deep-soft: #17231f;
  --muted: #5e746b;
  --line: #e2e6e2;
  --line-dark: rgba(255, 255, 255, 0.14);
  --mint: #2fbf8a;
  --mint-soft: rgba(47, 191, 138, 0.13);
  --mint-hover: #58d6a8;
  --sage: #355a4a;
  --card: rgba(255, 255, 255, 0.9);
  --glass: rgba(16, 24, 22, 0.72);
  --shadow: 0 20px 60px rgba(46, 46, 46, 0.08);
  --shadow-strong: 0 24px 70px rgba(0, 0, 0, 0.18);
  --radius: 24px;
  --display-mono: "Courier New", "Courier Prime", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-width: 1120px;
  height: 100vh;
  background: #ffffff;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body::before {
  display: none;
}

body::after {
  display: none;
}

body.login-page {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(76, 209, 160, 0.18), transparent 31%),
    radial-gradient(circle at 78% 72%, rgba(53, 90, 74, 0.08), transparent 28%),
    linear-gradient(135deg, #f6faf8 0%, #ffffff 48%, #edf5f2 100%);
  overflow: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

#app {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

/* 2. Sidebar, Navigation, FAQ und Erfolgsmodus */
.sidebar {
  color: #ffffff;
  padding: 30px 22px;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: linear-gradient(180deg, rgba(16, 24, 22, 0.82), rgba(16, 24, 22, 0.7));
  border-right: 1px solid var(--line-dark);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(18px);
}

.brand {
  width: 100%;
  min-height: 56px;
  display: grid;
  place-items: center;
  text-align: center;
}

.brand-text {
  display: grid;
  gap: 3px;
  justify-items: center;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand span,
.panel-label,
.faq-item p,
.eyebrow,
.metric-card span,
.detail-grid span,
.timeline small,
.section-title span {
  color: var(--muted);
  font-size: 12px;
}

.sidebar .brand span,
.sidebar .panel-label,
.sidebar .faq-item p {
  color: rgba(255, 255, 255, 0.58);
}

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

.nav-item {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
  backdrop-filter: blur(12px);
}

.nav-item.active,
.nav-item:hover {
  background: var(--mint);
  border-color: var(--mint);
  color: #10231d;
}

.sidebar-panel {
  display: grid;
  gap: 10px;
}

.admin-panel {
  margin-top: auto;
}

.panel-label,
.eyebrow,
.table-head {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 800;
}

.faq-panel,
.admin-panel {
  display: block;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.faq-panel[open],
.admin-panel[open] {
  background: rgba(255, 255, 255, 0.09);
}

.faq-panel > summary,
.admin-panel > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.faq-panel > summary::-webkit-details-marker,
.admin-panel > summary::-webkit-details-marker {
  display: none;
}

.faq-panel > summary::after,
.admin-panel > summary::after {
  content: "+";
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--mint);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.faq-panel[open] > summary::after,
.admin-panel[open] > summary::after {
  content: "-";
}

.faq-content {
  display: grid;
  gap: 13px;
  margin-top: 15px;
}

.faq-panel:not([open]) .faq-content {
  display: none;
}

.faq-item {
  display: grid;
  gap: 6px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.faq-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.faq-item strong {
  color: #ffffff;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 800;
}

.faq-item p {
  line-height: 1.45;
}

.admin-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.admin-button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 800;
}

.file-admin-button {
  display: grid;
  place-items: center;
  cursor: pointer;
}

.file-admin-button input {
  display: none;
}

.admin-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.admin-button.danger {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-celebration {
  min-height: 150px;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 280ms ease, transform 280ms ease;
}

.sidebar-celebration.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.sidebar-celebration.is-leaving {
  opacity: 0;
  transform: translateY(-4px);
}

.sidebar-typewriter {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 2px 2px 0;
}

.sidebar-typewriter::before {
  content: "";
  position: absolute;
  left: 0;
  top: -12px;
  width: 38px;
  height: 1px;
  background: var(--mint);
  opacity: 0.62;
}

.sidebar-typewriter small {
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sidebar-typewriter strong {
  display: block;
  min-height: 116px;
  color: #ffffff;
  font-size: 36px;
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: 0;
  overflow-wrap: normal;
  word-break: normal;
  text-wrap: balance;
}

.typewriter-text {
  white-space: normal;
}

.type-caret {
  display: inline-block;
  width: 8px;
  height: 1.04em;
  margin-left: 3px;
  vertical-align: -0.16em;
  background: var(--mint);
  animation: caret-blink 760ms steps(1, end) infinite;
}

@keyframes caret-blink {
  0%,
  48% {
    opacity: 1;
  }

  49%,
  100% {
    opacity: 0;
  }
}

@keyframes day-title-type {
  from {
    width: 0;
  }

  to {
    width: 13ch;
  }
}

@keyframes day-mobile-title-type {
  from {
    width: 0;
  }

  to {
    width: 13.8ch;
  }
}

@keyframes pipeline-title-type {
  from {
    width: 0;
  }

  to {
    width: 17ch;
  }
}

@keyframes consultation-title-type {
  from {
    width: 0;
  }

  to {
    width: 19ch;
  }
}

@keyframes day-top-title-type {
  from {
    width: 0;
  }

  to {
    width: 19ch;
  }
}

@keyframes analytics-title-type {
  from {
    width: 0;
  }

  to {
    width: 31ch;
  }
}

@keyframes attention-breathe {
  0% {
    transform: scale(1);
  }

  18% {
    transform: scale(1.026);
  }

  36% {
    transform: scale(1);
  }

  56% {
    transform: scale(1.022);
  }

  76%,
  100% {
    transform: scale(1);
  }
}

@keyframes attention-ring {
  0%,
  34%,
  70%,
  100% {
    opacity: 0;
    transform: scale(1);
  }

  12%,
  48% {
    opacity: 0.22;
    transform: scale(1.035);
  }

  24%,
  62% {
    opacity: 0;
    transform: scale(1.075);
  }
}

.main {
  padding: 32px 28px 34px;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 18px;
  overflow: hidden;
}

.main.analytics-main {
  grid-template-rows: auto minmax(0, 1fr);
}

/* 3. Kopfbereiche, Fokusmodus und Pipeline-Layout */
.topbar,
.detail-header,
.section-title,
.top-actions,
.action-grid {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 0;
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--mint);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: 50px;
  line-height: 1.04;
  font-weight: 800;
  text-wrap: balance;
}

.analytics-main h1 {
  max-width: none;
  font-size: clamp(38px, 4vw, 56px);
  white-space: nowrap;
  text-wrap: nowrap;
}

h2 {
  font-size: 29px;
  line-height: 1.08;
  font-weight: 800;
}

h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 800;
}

.top-actions {
  gap: 10px;
  flex-shrink: 0;
}

.gmail-status {
  width: 88px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 88px;
  min-width: 0;
  padding: 0 13px;
  border: 1px solid rgba(46, 46, 46, 0.08);
  border-radius: 999px;
  background: rgba(246, 248, 247, 0.84);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
}

.gmail-status::before {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #aeb9b4;
  content: "";
}

.gmail-status.connected::before {
  background: var(--mint);
}

.gmail-status.inactive::before {
  background: #d95c4a;
}

.gmail-status span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .gmail-status {
    width: 78px;
    flex-basis: 78px;
  }
}

.primary,
.secondary,
.import-button,
.icon-button {
  position: relative;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(46, 46, 46, 0.12);
  padding: 0 17px;
  background: #ffffff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.primary {
  background: var(--mint);
  border-color: var(--mint);
  color: #10231d;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.primary:hover,
.secondary:hover,
.import-button:hover {
  transform: translateY(-1px);
}

.primary:disabled,
.secondary:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.primary:not(:disabled):hover {
  background: var(--mint-hover);
}

.attention-pulse {
  animation: attention-breathe 2600ms ease-in-out var(--attention-delay, 0ms) 1 both;
  transform-origin: center;
  isolation: isolate;
  will-change: transform;
}

.attention-pulse::after {
  position: absolute;
  inset: -5px;
  z-index: -1;
  border-radius: inherit;
  background: rgba(47, 191, 138, 0.2);
  content: "";
  opacity: 0;
  pointer-events: none;
  animation: attention-ring 2600ms ease-in-out var(--attention-delay, 0ms) 1 both;
}

.secondary:not(:disabled):hover,
.import-button:hover {
  border-color: var(--mint);
  color: var(--sage);
}

.danger {
  color: #9a3d2e;
}

.top-link {
  color: var(--sage);
}

.import-button {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  backdrop-filter: blur(12px);
}

.import-button:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.import-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  position: relative;
  margin-bottom: 0;
}

.metrics::before {
  position: absolute;
  top: 22px;
  right: 7%;
  left: 7%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(76, 209, 160, 0.74), rgba(255, 255, 255, 0.56), transparent);
}

.metric-card {
  position: relative;
  min-height: 106px;
  display: grid;
  align-content: end;
  gap: 7px;
  padding: 18px 18px 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.metric-card strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
}

.analytics-view {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 16px;
  padding-right: 4px;
}

.analytics-card,
.analytics-panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.analytics-card > span {
  color: var(--mint);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.analytics-card p,
.analytics-rate span,
.analytics-list span {
  color: var(--muted);
  line-height: 1.5;
}

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

.analytics-card {
  min-height: 150px;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 20px;
}

.analytics-card.highlight {
  background: linear-gradient(135deg, rgba(76, 209, 160, 0.18), rgba(255, 255, 255, 0.9));
}

.analytics-card strong {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
}

.analytics-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 14px;
}

.analytics-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px;
}

.conversion-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-radius: 20px;
  background: #f6f8f7;
}

.conversion-line div {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.conversion-line strong {
  font-size: 28px;
  line-height: 1;
}

.conversion-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.conversion-line i {
  height: 1px;
  background: linear-gradient(90deg, rgba(76, 209, 160, 0.2), var(--mint));
}

.analytics-rate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 48px;
  align-items: center;
  gap: 12px;
}

.analytics-rate strong,
.analytics-rate span {
  display: block;
}

.rate-track {
  height: 10px;
  border-radius: 999px;
  background: #edf2ef;
  overflow: hidden;
}

.rate-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--mint);
}

.analytics-rate b {
  font-size: 20px;
  text-align: right;
}

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

.analytics-list > div:not(.empty) {
  display: grid;
  gap: 4px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.analytics-list strong,
.analytics-list span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.workspace {
  --list-pane-width: 50%;
  display: grid;
  grid-template-columns: minmax(240px, var(--list-pane-width)) 24px minmax(280px, 1fr) 390px;
  gap: 12px;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.day-workspace {
  grid-template-columns: minmax(520px, 1fr) minmax(360px, 0.66fr);
}

.list-panel,
.detail-panel,
.journal-panel,
.day-focus-panel {
  min-height: 0;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.day-focus-panel {
  overflow: auto;
  padding: 26px;
}

.day-mode-header {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 24px;
  border-radius: 26px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(76, 209, 160, 0.16), rgba(255, 255, 255, 0.76)),
    #ffffff;
}

.day-mode-header > span {
  color: var(--mint);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.day-mode-header h2 {
  max-width: 760px;
  font-size: clamp(48px, 6vw, 76px);
  line-height: 0.94;
}

.day-type-title,
.top-type-title {
  min-height: 0.98em;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  color: var(--ink);
  font-family: var(--display-mono);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: lowercase;
}

.day-type-title span,
.top-type-title span {
  display: inline-block;
  width: 0;
  max-width: fit-content;
  overflow: hidden;
  white-space: nowrap;
  animation: day-title-type 1650ms steps(13, end) 120ms forwards;
}

.top-type-title span {
  animation-name: pipeline-title-type;
  animation-duration: 1900ms;
  animation-timing-function: steps(16, end);
}

.consultation-type-title span {
  animation-name: consultation-title-type;
  animation-duration: 2050ms;
  animation-timing-function: steps(18, end);
}

.day-top-type-title span {
  width: auto;
  overflow: visible;
  text-transform: none;
  animation: none;
}

.analytics-type-title span {
  animation-name: analytics-title-type;
  animation-duration: 2600ms;
  animation-timing-function: steps(30, end);
}

.day-type-title::after,
.top-type-title::after {
  content: "";
  width: 0.09em;
  height: 0.78em;
  margin-left: 0.07em;
  border-radius: 999px;
  background: var(--mint);
  transform: translateY(0.08em);
  animation: caret-blink 1180ms steps(1, end) infinite;
}

.day-top-type-title::after {
  display: none;
}

.day-mode-header p {
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.55;
}

.day-step-strip {
  width: min(100%, 560px);
  display: grid;
  justify-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 15px 17px;
  border: 1px solid rgba(76, 209, 160, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  text-align: center;
}

.day-step-strip span {
  color: var(--mint);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.day-step-strip strong {
  font-size: 23px;
  line-height: 1.15;
}

.day-profile-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid rgba(46, 46, 46, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  text-align: center;
}

.day-profile-card span {
  color: var(--mint);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.day-profile-card h3 {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0;
  word-spacing: 0;
  text-transform: none;
}

.day-profile-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.day-focus-panel .detail-header {
  display: none;
}

.day-focus-panel .detail-meta {
  display: none;
}

.day-focus-panel .workflow-card {
  display: none;
}

.day-step-strip .template-link {
  justify-self: center;
  margin-top: 4px;
}

.day-focus-panel .action-grid {
  margin-top: 14px;
}

.day-journal-panel {
  min-width: 0;
  max-width: 100%;
}

.split-rail {
  position: relative;
  width: 24px;
  min-height: 100%;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
}

.split-rail::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 50%;
  width: 1px;
  content: "";
  background: rgba(255, 255, 255, 0.74);
  transform: translateX(-50%);
}

.split-rail span {
  position: sticky;
  top: 50%;
  z-index: 1;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(76, 209, 160, 0.32);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--sage);
  box-shadow: 0 12px 26px rgba(16, 24, 22, 0.14);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  transform: translate(-2px, -50%);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.split-rail:hover span,
.split-rail:focus-visible span,
.workspace.is-resizing .split-rail span {
  border-color: var(--mint);
  background: var(--mint);
  color: #10231d;
  transform: translate(-2px, -50%) scale(1.05);
}

body.is-resizing {
  cursor: grabbing;
  user-select: none;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 158px 128px;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(76, 209, 160, 0.08), rgba(246, 248, 247, 0.78));
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 18px;
  color: var(--ink);
  padding: 11px 13px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 4px rgba(76, 209, 160, 0.14);
}

/* 4. Lead-Liste, Bearbeitungsbereich und Aktivitäten */
.lead-table {
  height: calc(100% - 71px);
  min-width: 0;
  display: grid;
  grid-template-rows: 44px 1fr;
}

.lead-table:has(.list-count) {
  grid-template-rows: 44px 1fr auto;
}

.table-head,
.lead-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.86fr) minmax(0, 0.78fr) minmax(48px, 0.52fr);
  align-items: center;
  column-gap: clamp(6px, 2vw, 12px);
  min-width: 0;
}

.table-head {
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.table-body {
  overflow: auto;
}

.list-count {
  padding: 9px 14px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.lead-row {
  width: 100%;
  min-width: 0;
  min-height: 74px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 0 15px;
  color: var(--ink);
}

.lead-row:hover,
.lead-row.selected {
  background: rgba(76, 209, 160, 0.08);
}

.lead-row.selected {
  box-shadow: inset 4px 0 0 var(--mint);
}

.lead-row strong,
.lead-row small,
.lead-row > span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-row strong {
  font-weight: 800;
}

.lead-row small {
  color: var(--muted);
  margin-top: 4px;
}

.stage {
  display: inline-flex;
  max-width: 100%;
  min-height: 27px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--sage);
  background: var(--mint-soft);
  border: 1px solid rgba(76, 209, 160, 0.18);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage.new {
  background: #f1f6f3;
  color: var(--ink);
}

.stage.nurture {
  background: var(--mint-soft);
  color: var(--sage);
}

.stage.consultation {
  background: rgba(182, 169, 199, 0.18);
  color: #4b415d;
}

.stage.archived {
  background: #e8ecea;
  color: var(--muted);
}

.danger-text {
  color: #9a3d2e;
  font-weight: 800;
}

.detail-panel,
.journal-panel {
  min-width: 0;
  max-width: 100%;
  padding: 18px;
  overflow: auto;
}

.detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-header > div > span {
  color: var(--muted);
  font-size: 13px;
  display: block;
  margin-top: 7px;
  word-break: break-word;
}

.contact-fields {
  width: min(100%, 560px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.contact-fields > button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  row-gap: 2px;
  min-height: 46px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f6f8f7;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.contact-fields span,
.contact-fields strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-fields span {
  grid-column: 1;
  grid-row: 1;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contact-fields strong {
  grid-column: 1;
  grid-row: 2;
  font-size: 12px;
}

.contact-fields > button:hover {
  border-color: rgba(47, 191, 138, 0.28);
  background: #f2f6f4;
}

.contact-fields > button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.mini-copy {
  grid-column: 2;
  grid-row: 1 / 3;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: var(--mint-soft);
  color: var(--sage);
  padding: 0 9px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.mini-copy:hover {
  background: var(--mint);
  color: #10231d;
}

.mini-copy:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

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

.detail-grid > div {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
}

.detail-grid strong {
  display: block;
  min-width: 0;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-card,
.sequence-card,
.consultation-card,
.last-email-card,
.notes,
.detail-meta,
.timeline {
  border-top: 1px solid var(--line);
  padding-top: 17px;
  margin-top: 17px;
}

.detail-meta {
  padding-top: 10px;
  margin-top: 12px;
}

.detail-meta .section-title {
  margin-bottom: 6px;
}

.detail-meta .section-title h3 {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.detail-meta .detail-grid span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.workflow-card {
  display: grid;
  gap: 9px;
  border-top: 0;
  margin-top: 12px;
  padding-top: 0;
}

.last-email-card {
  width: min(100%, 520px);
  display: grid;
  gap: 8px;
  margin-right: auto;
  margin-left: auto;
  padding: 14px;
  border: 1px solid rgba(76, 209, 160, 0.22);
  border-radius: 18px;
  background: rgba(76, 209, 160, 0.1);
}

.last-email-card .section-title {
  margin-bottom: 0;
}

.last-email-card strong {
  font-size: 15px;
}

.last-email-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.workflow-card > strong {
  display: block;
  font-size: 24px;
  line-height: 1.12;
  font-weight: 800;
}

.workflow-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.template-link {
  display: inline-flex;
  width: fit-content;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--mint-soft);
  color: var(--sage);
  padding: 0 13px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.template-link:hover {
  background: var(--mint);
  color: #10231d;
}

.section-title {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.workflow-card .section-title {
  margin-bottom: 0;
}

.workflow-card .section-title span {
  color: var(--mint);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.sequence-track {
  display: grid;
  gap: 8px;
}

.sequence-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
}

.sequence-step > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #2e2e2e;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.sequence-step strong,
.sequence-step small {
  display: block;
}

.sequence-step small {
  color: var(--muted);
  margin-top: 3px;
}

.sequence-step.done > span {
  background: var(--mint);
  color: #10231d;
}

.sequence-step.current {
  border-color: rgba(76, 209, 160, 0.5);
  background: linear-gradient(135deg, rgba(76, 209, 160, 0.1), #ffffff);
}

.action-grid {
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 17px auto 0;
}

.action-grid .primary {
  grid-column: auto;
}

.consultation-actions {
  grid-template-columns: 1fr;
}

.notes button {
  margin-top: 9px;
}

.consultation-card {
  width: min(100%, 520px);
  display: grid;
  gap: 9px;
  margin-left: auto;
  margin-right: auto;
}

.consultation-workbench {
  width: min(100%, 560px);
  display: grid;
  gap: 14px;
  margin: 18px auto 0;
  padding: 18px;
  border: 1px solid rgba(76, 209, 160, 0.18);
  border-radius: 22px;
  background: rgba(76, 209, 160, 0.08);
}

.consultation-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.consultation-action-grid button {
  min-height: 54px;
}

.timeline {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.timeline-list {
  max-height: calc(100vh - 502px);
  min-height: 360px;
  overflow: auto;
  padding-right: 4px;
  min-width: 0;
  max-width: 100%;
}

.timeline-item {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 10px 0;
  overflow: visible;
}

.timeline-action {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  overflow: visible;
}

.timeline-action:hover {
  background: var(--mint-soft);
  padding-left: 10px;
  padding-right: 10px;
}

.timeline-note-preview {
  grid-column: 2;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: -2px;
  padding: 12px;
  border: 1px solid rgba(76, 209, 160, 0.22);
  border-radius: 14px;
  background: #f1fbf7;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: visible;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2e2e2e;
  margin-top: 5px;
}

.dot.email {
  background: var(--mint);
}

.dot.reply {
  background: #b6a9c7;
}

.dot.call {
  background: #355a4a;
}

.dot.status {
  background: #9a3d2e;
}

.timeline-content {
  min-width: 0;
  max-width: 100%;
}

.timeline-item strong,
.timeline-item small {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.workflow-overlay {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 24, 22, 0.52);
  backdrop-filter: blur(10px);
}

.workflow-modal {
  position: relative;
  width: min(540px, calc(100vw - 40px));
  display: grid;
  gap: 14px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(246, 248, 247, 0.9)),
    var(--card);
  box-shadow: var(--shadow-strong);
}

.template-preview-modal {
  width: min(820px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
}

.template-preview-frame {
  width: 100%;
  height: min(58vh, 620px);
  border: 1px solid rgba(46, 46, 46, 0.1);
  border-radius: 18px;
  background: #ffffff;
}

.system-status-modal {
  width: min(900px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
}

.system-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.system-status-card {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(46, 46, 46, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

.system-status-card span {
  color: var(--sage);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.system-status-card strong {
  min-width: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.system-status-card small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.system-status-value.info {
  color: var(--sage);
}

.system-status-value.warn {
  color: #9b6b18;
}

.system-status-value.error {
  color: #a23b2a;
}

.system-status-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 2px;
}

.system-status-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.system-status-toolbar button {
  width: auto;
  min-width: 130px;
}

.system-status-error {
  padding: 12px 14px;
  border: 1px solid rgba(162, 59, 42, 0.22);
  border-radius: 16px;
  background: rgba(162, 59, 42, 0.08);
  color: #8f2d20;
  font-size: 13px;
  font-weight: 800;
}

.system-event-list {
  min-height: 0;
  max-height: min(42vh, 420px);
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.system-event {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(46, 46, 46, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.system-badge {
  width: 58px;
  height: 26px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 999px;
  background: rgba(47, 191, 138, 0.12);
  color: var(--sage);
  font-size: 10px;
  font-weight: 850;
}

.system-badge.warn {
  background: rgba(155, 107, 24, 0.12);
  color: #8a5d13;
}

.system-badge.error {
  background: rgba(162, 59, 42, 0.12);
  color: #8f2d20;
}

.system-event strong,
.system-event p,
.system-event small {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.system-event strong {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
  font-weight: 850;
}

.system-event p {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}

.system-event small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.workflow-modal-kicker {
  width: fit-content;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--mint);
  color: #10231d;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .system-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-status-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .system-status-toolbar button {
    width: 100%;
  }
}

.workflow-modal h2 {
  padding-right: 28px;
}

.workflow-modal p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.send-composer {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(46, 46, 46, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.send-composer label {
  display: grid;
  gap: 6px;
  color: var(--sage);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.send-composer input,
.send-composer textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(46, 46, 46, 0.12);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  padding: 0 12px;
}

.send-composer input {
  height: 42px;
}

.send-composer textarea {
  min-height: 150px;
  padding: 12px;
  resize: vertical;
  line-height: 1.48;
}

.send-composer input:focus,
.send-composer textarea:focus {
  outline: 2px solid rgba(76, 209, 160, 0.34);
  border-color: rgba(76, 209, 160, 0.56);
}

.consultation-email-preview {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(76, 209, 160, 0.2);
  border-radius: 16px;
  background: rgba(76, 209, 160, 0.08);
}

.consultation-email-preview span {
  color: var(--mint);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.consultation-email-preview strong {
  color: var(--ink);
  font-size: 18px;
}

.attachment-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.attachment-button {
  width: fit-content;
}

.attachment-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.attachment-button span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(46, 46, 46, 0.1);
  border-radius: 999px;
  background: rgba(47, 191, 138, 0.12);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.attachment-button span:hover {
  background: rgba(47, 191, 138, 0.18);
}

.attachment-picker small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.attachment-picker small.is-error {
  color: #a23b2a;
}

.template-preview-link {
  width: fit-content;
  color: var(--sage);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.template-preview-link:hover {
  color: var(--ink);
}

.call-phone-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 3px;
  min-height: 58px;
  padding: 10px 11px 10px 14px;
  border: 1px solid rgba(76, 209, 160, 0.22);
  border-radius: 18px;
  background: rgba(76, 209, 160, 0.1);
}

.call-phone-field span {
  grid-column: 1;
  grid-row: 1;
  color: var(--sage);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.call-phone-field strong {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 800;
}

.call-phone-field .mini-copy {
  grid-column: 3;
  grid-row: 1 / 3;
  background: #ffffff;
}

.call-now-button {
  grid-column: 2;
  grid-row: 1 / 3;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--mint);
  color: #10231d;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.call-now-button:hover {
  background: var(--mint-hover);
}

.call-quick-note {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(46, 46, 46, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.call-quick-note label {
  display: grid;
  gap: 6px;
}

.call-quick-note span {
  color: var(--sage);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.call-quick-note select,
.call-quick-note textarea {
  width: 100%;
  border: 1px solid rgba(46, 46, 46, 0.12);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0;
  outline: none;
}

.call-quick-note select {
  height: 42px;
  padding: 0 12px;
}

.call-quick-note textarea {
  min-height: 82px;
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.45;
}

.call-quick-note select:focus,
.call-quick-note textarea:focus {
  outline: 2px solid rgba(76, 209, 160, 0.34);
  border-color: rgba(76, 209, 160, 0.56);
}

.callback-fields {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(76, 209, 160, 0.24);
  border-radius: 16px;
  background: rgba(76, 209, 160, 0.09);
}

.callback-fields[hidden] {
  display: none;
}

.callback-days {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.callback-days button {
  min-height: 34px;
  border: 1px solid rgba(76, 209, 160, 0.28);
  border-radius: 999px;
  background: #ffffff;
  color: var(--sage);
  font-size: 12px;
  font-weight: 800;
}

.callback-days button:hover {
  background: var(--mint);
  color: #10231d;
}

.callback-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
}

.callback-inputs input {
  height: 40px;
  border-radius: 13px;
  font-size: 13px;
}

.workflow-modal-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.workflow-done {
  width: 100%;
  margin-top: 2px;
  background: #ffffff;
  border-color: rgba(46, 46, 46, 0.12);
  color: var(--ink);
  box-shadow: none;
}

.workflow-gmail {
  width: 100%;
}

/* 5. Formulare, Popups, Gmail-Dialoge und Login */
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 24, 22, 0.08);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.modal-close:hover {
  background: var(--mint);
  color: #10231d;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 48px));
  border: 1px solid rgba(76, 209, 160, 0.28);
  border-radius: 999px;
  background: rgba(16, 24, 22, 0.92);
  color: #ffffff;
  padding: 14px 18px;
  box-shadow: var(--shadow-strong);
  font-size: 14px;
  font-weight: 800;
  backdrop-filter: blur(16px);
}

.toast.error {
  border-color: rgba(154, 61, 46, 0.4);
}

.toast.celebrate {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  width: fit-content;
  max-width: none;
  min-width: min(340px, calc(100vw - 48px));
  min-height: 112px;
  display: flex;
  flex-direction: column;
  place-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.7);
  color: #111111;
  padding: 22px 30px;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
  box-shadow: 0 22px 70px rgba(16, 24, 22, 0.16);
  backdrop-filter: blur(14px);
  animation: celebrate-pop 1800ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.toast.celebrate::before,
.toast.celebrate::after {
  display: none;
}

.toast.celebrate .toast-kicker,
.toast.celebrate strong,
.toast.celebrate .toast-subline {
  position: static;
  z-index: auto;
}

.toast.celebrate .toast-kicker {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(17, 17, 17, 0.58);
  padding: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.toast.celebrate strong {
  display: block;
  max-width: none;
  font-size: 30px;
  line-height: 1.08;
  font-weight: 800;
  text-wrap: balance;
  text-shadow: none;
}

.toast.celebrate .toast-subline {
  color: rgba(17, 17, 17, 0.58);
  font-size: 12px;
  font-weight: 700;
}

@keyframes celebrate-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.98);
    filter: blur(4px);
  }

  12%,
  82% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: blur(0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -53%) scale(0.99);
    filter: blur(3px);
  }
}

.empty {
  padding: 28px;
  color: var(--muted);
}

.modal {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-strong);
  padding: 0;
}

.modal::backdrop {
  background: rgba(16, 24, 22, 0.62);
  backdrop-filter: blur(8px);
}

.modal form {
  padding: 20px;
  display: grid;
  gap: 12px;
  background: #ffffff;
}

.modal header,
.modal footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.icon-button {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 22px;
}

.login-shell {
  width: min(100%, 456px);
}

.login-card {
  position: relative;
  display: grid;
  gap: 28px;
  padding: 38px;
  border: 1px solid rgba(16, 24, 22, 0.08);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9)),
    #ffffff;
  box-shadow: 0 32px 90px rgba(16, 24, 22, 0.14);
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--mint), rgba(76, 209, 160, 0.24), var(--sage));
}

.login-brand {
  display: grid;
  gap: 3px;
  justify-items: center;
  text-align: center;
  color: var(--ink);
}

.login-brand strong {
  font-size: 27px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.login-brand span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-intro {
  display: grid;
  gap: 10px;
  text-align: center;
}

.login-intro p {
  margin: 0;
  color: var(--mint);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.login-intro h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(31px, 6vw, 46px);
  line-height: 0.96;
  font-weight: 850;
  letter-spacing: 0;
}

.login-intro span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 15px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.login-form input {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(16, 24, 22, 0.1);
  border-radius: 17px;
  background: rgba(248, 251, 249, 0.92);
  color: var(--ink);
  padding: 0 17px;
  font-size: 16px;
  font-weight: 750;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.login-form input:focus {
  border-color: rgba(76, 209, 160, 0.82);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(76, 209, 160, 0.16);
}

.login-form button {
  width: 100%;
  min-height: 56px;
  margin-top: 6px;
  border-radius: 999px;
  border: 0;
  background: var(--mint);
  color: #10231d;
  font-size: 15px;
  box-shadow: 0 18px 44px rgba(76, 209, 160, 0.26);
}

.login-form button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.login-message {
  min-height: 20px;
  margin: 0;
  color: #9a3d2e;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.login-message.success {
  color: var(--sage);
}

.startup-error {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #ffffff;
}

.startup-error section {
  width: min(100%, 460px);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid rgba(16, 24, 22, 0.08);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(16, 24, 22, 0.12);
  text-align: center;
}

.startup-error p {
  color: var(--mint);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.startup-error h1 {
  font-size: clamp(28px, 8vw, 42px);
}

.startup-error span {
  color: var(--muted);
  line-height: 1.5;
}

.startup-error button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--mint);
  color: #10231d;
  font-weight: 850;
}

/* 6. Mobile Arbeitsansicht */
@media (max-width: 860px) {
  html,
  body {
    width: 100%;
    min-width: 0;
    height: 100dvh;
    overflow: hidden;
  }

  body {
    min-width: 0;
  }

  #app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
  }

  .sidebar {
    min-height: 0;
    max-height: 142px;
    padding: 10px 10px 12px;
    gap: 9px;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line-dark);
    box-shadow: 0 16px 40px rgba(16, 24, 22, 0.18);
  }

  #app.view-day .sidebar {
    max-height: 96px;
    padding: 9px 10px 10px;
    gap: 6px;
  }

  #app.view-day .brand {
    display: grid;
    min-height: 26px;
  }

  #app.view-day .brand strong {
    font-size: 12px;
    letter-spacing: 0.12em;
  }

  #app.view-day .brand span {
    font-size: 8px;
  }

  #app.view-day .nav-item {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }

  .brand {
    min-height: 30px;
  }

  .brand strong {
    font-size: 14px;
    letter-spacing: 0.1em;
  }

  .brand span {
    font-size: 9px;
  }

  .nav {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    min-height: 38px;
    flex: 0 0 auto;
    padding: 0 13px;
    font-size: 13px;
  }

  .faq-panel,
  .admin-panel,
  .sidebar-celebration {
    display: none;
  }

  .main {
    min-height: 0;
    padding: 12px;
    gap: 10px;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .day-main {
    padding: 8px 10px 10px;
    gap: 7px;
  }

  .topbar {
    display: grid;
    gap: 10px;
  }

  .day-main .topbar,
  .consultation-main .topbar {
    display: none;
  }

  #app:not(.view-day):not(.view-consultation):not(.view-analytics) .topbar {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    justify-content: center;
    justify-items: center;
    align-items: center;
    text-align: center;
    gap: 7px;
  }

  #app:not(.view-day):not(.view-consultation):not(.view-analytics) .topbar > div {
    width: 100%;
    display: grid;
    justify-items: center;
    text-align: center;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 10px;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(30px, 10vw, 42px);
    line-height: 1;
  }

  #app:not(.view-day):not(.view-consultation):not(.view-analytics) .eyebrow {
    margin: 0;
    text-align: center;
    font-size: 9px;
    letter-spacing: 0.15em;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
    gap: 7px;
  }

  #app:not(.view-day):not(.view-consultation):not(.view-analytics) .top-actions {
    width: min(100%, 340px);
    justify-self: center;
    grid-template-columns: auto auto auto;
    justify-content: center;
    gap: 5px;
  }

  #app:not(.view-day):not(.view-consultation):not(.view-analytics) .gmail-status {
    width: fit-content;
    min-height: 28px;
    padding: 0 9px;
    font-size: 10px;
  }

  #app:not(.view-day):not(.view-consultation):not(.view-analytics) .gmail-status::before {
    width: 6px;
    height: 6px;
    margin-right: 6px;
  }

  #app:not(.view-day):not(.view-consultation):not(.view-analytics) .top-actions .secondary,
  #app:not(.view-day):not(.view-consultation):not(.view-analytics) .top-actions .top-link {
    min-height: 30px;
    padding: 0 9px;
    font-size: 11px;
  }

  .top-actions .primary,
  .top-actions .secondary,
  .top-actions .top-link {
    min-height: 38px;
    padding: 0 11px;
    font-size: 12px;
  }

  #app:not(.view-day) h1 {
    width: 100%;
    display: flex;
    justify-content: center;
    text-align: center;
    font-size: clamp(25px, 8vw, 34px);
    line-height: 1.02;
  }

  #app:not(.view-day):not(.view-consultation):not(.view-analytics) #openAddLead {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 170px);
    min-height: 32px;
    font-size: 11px;
  }

  .analytics-main h1 {
    font-size: clamp(27px, 8vw, 36px);
    white-space: normal;
    text-wrap: balance;
  }

  .gmail-status {
    width: auto;
    flex-basis: auto;
    min-height: 38px;
    padding: 0 10px;
    font-size: 11px;
  }

  .metrics {
    display: none;
  }

  .analytics-view {
    gap: 10px;
    overflow: auto;
    padding-right: 0;
  }

  .analytics-grid,
  .analytics-panels {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .analytics-card {
    min-height: 112px;
    padding: 16px;
    border-radius: 20px;
  }

  .analytics-card strong {
    font-size: clamp(32px, 12vw, 46px);
  }

  .analytics-panel {
    gap: 11px;
    padding: 15px;
    border-radius: 20px;
  }

  .conversion-line {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 10px;
  }

  .conversion-line i {
    display: none;
  }

  .conversion-line strong {
    font-size: 22px;
  }

  .conversion-line span {
    font-size: 10px;
  }

  .analytics-rate {
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 8px;
  }

  .analytics-rate .rate-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .workspace,
  .day-workspace {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .day-workspace {
    gap: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .split-rail {
    display: none;
  }

  .list-panel {
    min-height: clamp(340px, 52dvh, 470px);
    max-height: none;
    flex: 0 0 auto;
  }

  .filters {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 9px;
  }

  .filters input,
  .filters select {
    min-height: 38px;
    border-radius: 14px;
    font-size: 13px;
    padding: 8px 10px;
  }

  .lead-table {
    height: calc(100% - 143px);
    min-height: 190px;
    grid-template-rows: 36px 1fr;
  }

  .table-body {
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .lead-row {
    min-height: 64px;
  }

  .table-head,
  .lead-row {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  }

  .table-head span:nth-child(3),
  .table-head span:nth-child(4),
  .lead-row > span:nth-child(3),
  .lead-row > span:nth-child(4) {
    display: none;
  }

  .detail-panel,
  .journal-panel,
  .day-focus-panel {
    border-radius: 20px;
    box-shadow: 0 16px 44px rgba(16, 24, 22, 0.08);
  }

  .detail-panel,
  .day-focus-panel {
    padding: 14px;
    overflow: visible;
  }

  #app.view-consultation .detail-panel,
  #app.view-consultation .journal-panel,
  #app:not(.view-day):not(.view-analytics) .detail-panel,
  #app:not(.view-day):not(.view-analytics) .journal-panel {
    flex: 0 0 auto;
    padding: 14px;
    overflow: visible;
  }

  #app:not(.view-day):not(.view-analytics) .detail-panel {
    order: 2;
  }

  #app:not(.view-day):not(.view-analytics) .journal-panel {
    order: 3;
  }

  #app:not(.view-day):not(.view-analytics) .list-panel {
    order: 1;
  }

  #app.view-consultation .consultation-workbench {
    width: 100%;
    margin-top: 10px;
    padding: 13px;
    border-radius: 18px;
  }

  .consultation-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .consultation-action-grid button {
    min-height: 48px;
    font-size: 13px;
  }

  .day-mode-header {
    gap: 5px;
    margin-bottom: 7px;
    padding: 10px;
    border-radius: 18px;
  }

  .day-mode-header > span {
    font-size: 8px;
    letter-spacing: 0.13em;
  }

  .day-mode-header h2 {
    font-size: clamp(26px, 9.4vw, 37px);
    line-height: 0.95;
  }

  .day-type-title span {
    animation-name: day-mobile-title-type;
    animation-duration: 1500ms;
  }

  .day-mode-header p {
    max-width: 320px;
    font-size: 12px;
    line-height: 1.25;
  }

  .day-step-strip {
    width: 100%;
    gap: 3px;
    margin-top: 3px;
    padding: 9px 10px;
    border-radius: 15px;
  }

  .day-step-strip span {
    font-size: 9px;
    letter-spacing: 0.11em;
  }

  .day-step-strip strong {
    font-size: 17px;
  }

  .day-step-strip .template-link {
    min-height: 28px;
    margin-top: 2px;
    padding: 0 10px;
    font-size: 11px;
  }

  .day-profile-card {
    gap: 4px;
    margin-bottom: 7px;
    padding: 10px;
    border-radius: 16px;
  }

  .day-profile-card span {
    font-size: 9px;
    letter-spacing: 0.06em;
  }

  .day-profile-card h3 {
    font-size: 18px;
  }

  .day-profile-card p {
    font-size: 12px;
    line-height: 1.3;
  }

  .day-focus-panel {
    flex: 0 0 auto;
    padding: 10px;
    overflow: visible;
  }

  .day-focus-panel .action-grid {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin-top: 10px;
    padding: 10px 0 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), #ffffff 26%);
  }

  .action-grid {
    width: 100%;
    gap: 8px;
  }

  .action-grid .primary,
  .action-grid .secondary {
    min-height: 52px;
    font-size: 14px;
  }

  .contact-fields {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .detail-meta {
    display: none;
  }

  .day-journal-panel,
  .journal-panel {
    min-height: 180px;
    max-height: none;
    flex: 0 0 auto;
    padding: 14px;
    overflow: visible;
  }

  .timeline-list {
    min-height: 170px;
    max-height: none;
  }

  .workflow-overlay {
    align-items: end;
    place-items: end center;
    padding: 10px;
    overflow: auto;
  }

  .workflow-modal {
    width: 100%;
    max-height: calc(100dvh - 20px);
    overflow: auto;
    gap: 12px;
    padding: 20px;
    border-radius: 24px;
  }

  .workflow-modal h2 {
    font-size: 25px;
  }

  .send-composer,
  .call-quick-note {
    padding: 12px;
  }

  .send-composer input,
  .send-composer textarea,
  .call-quick-note select,
  .call-quick-note textarea {
    font-size: 16px;
  }

  .call-phone-field {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    gap: 8px;
    padding: 13px;
  }

  .call-phone-field strong {
    white-space: normal;
    font-size: 19px;
  }

  .call-now-button {
    grid-column: 1 / -1;
    grid-row: 3;
    min-height: 50px;
    width: 100%;
    font-size: 15px;
  }

  .call-phone-field .mini-copy {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .callback-days {
    grid-template-columns: 1fr;
  }

  .callback-inputs {
    grid-template-columns: 1fr;
  }

  .modal {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100dvh - 20px);
  }
}
