/* AutoPIM – CRM-Modul Styles */
/* Basis: Dev1 (CRM-002) | Erweiterungen: Dev2 + Dev3 */

/* ─── Sidebar: CRM-Abschnitt ──────────────────────────────────── */
.crm-nav-section {
  border-top: 2px solid #e2e8f0;
  padding-bottom: 4px;
}

.crm-nav-label {
  padding: 8px 12px 4px;
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  color: #5c6773;
  letter-spacing: 0.05em;
  background: #f7fafc;
  border-bottom: 1px solid #e2e8f0;
}

.crm-nav-section button {
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  border-bottom: 1px solid #f0f4f8;
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
  color: #2b6cb0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-nav-section button:hover {
  background: #ebf8ff;
}

.crm-nav-section button.crm-nav-active {
  background: #dbeafe;
  border-left: 3px solid #0064d2;
}

/* CRM-Buttons im Header */
#crm-nav-kunden, #crm-nav-kanban {
  transition: background 0.15s;
}
#crm-nav-kunden.crm-nav-active, #crm-nav-kanban.crm-nav-active {
  background: rgba(255,255,255,0.25) !important;
  color: #fff !important;
}

/* ─── Utility: Karten ────────────────────────────────────────── */
.crm-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.crm-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: #90cdf4;
}

/* ─── Utility: Badges ────────────────────────────────────────── */
.crm-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
}

/* ─── Utility: Tabelle ───────────────────────────────────────── */
.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.crm-table th {
  padding: 10px 12px;
  text-align: left;
  background: #f7fafc;
  border-bottom: 2px solid #e2e8f0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #5c6773;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
}

.crm-table th:hover {
  background: #edf2f7;
}

.crm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f4f8;
  color: #2d3748;
}

.crm-table tr:hover td {
  background: #ebf8ff;
  cursor: pointer;
}

/* ─── Utility: Toolbar / Filterleiste ───────────────────────── */
.crm-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.crm-toolbar input[type="text"],
.crm-toolbar select {
  padding: 10px 16px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 1rem;
  background: white;
}

.crm-toolbar input[type="text"] {
  min-width: 320px;
}

/* ─── Utility: Buttons ───────────────────────────────────────── */
.crm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.crm-btn:hover { opacity: 0.85; }

.crm-btn-primary {
  background: #0064d2;
  color: white;
}

.crm-btn-danger {
  background: #e53e3e;
  color: white;
}

.crm-btn-secondary {
  background: #edf2f7;
  color: #4a5568;
}

/* ─── Utility: Leer-Zustand ──────────────────────────────────── */
.crm-empty {
  padding: 40px;
  text-align: center;
  color: #687482;
  font-size: 0.95rem;
}

/* ─── Kanban-Board: Grundlayout (Dev3 erweitert) ─────────────── */
.crm-kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: flex-start;
}

.crm-kanban-col {
  min-width: 260px;
  background: #f7fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.crm-kanban-col-header {
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.crm-kanban-col-body {
  padding: 8px;
  min-height: 60px;
}

/* ─── Kanban: Eingeklappte Spalte ────────────────────────── */
.crm-kanban-col--collapsed {
  min-width: 160px;
  max-width: 160px;
}

.crm-kanban-col--collapsed .crm-kanban-col-header {
  border-bottom: none;
  border-radius: 8px;
}

/* ─── Kanban: Toggle-Pfeil ───────────────────────────────── */
.crm-kanban-toggle {
  margin-left: auto;
  font-size: 0.7rem;
  color: #687482;
  flex-shrink: 0;
}

/* ─── Kanban: Karten ─────────────────────────────────────── */
.crm-kanban-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.crm-kanban-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: #90cdf4;
}

.crm-kanban-card-name {
  font-weight: 700;
  font-size: 0.84rem;
  color: #2d3748;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-kanban-card-titel {
  font-size: 0.78rem;
  color: #5c6773;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.crm-kanban-card-seller {
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  background: #718096;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ─── Kanban: Spalten-Zähler ─────────────────────────────── */
.crm-kanban-count {
  background: #e2e8f0;
  color: #4a5568;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 2px;
}

/* ─── Kanban: Drag & Drop States (CRM-008) ───────────────── */
.crm-kanban-ghost {
  opacity: 0.35;
  background: #ebf8ff;
  border: 2px dashed #90cdf4;
}

.crm-kanban-dragging {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transform: rotate(1.5deg);
  opacity: 0.95;
}

.crm-kanban-droppable {
  background: #f0f9ff;
  border-color: #bee3f8;
  transition: background 0.1s, border-color 0.1s;
}

.crm-kanban-drop-over {
  background: #ebf8ff;
  border: 2px dashed #3182ce;
  box-shadow: inset 0 0 0 2px #90cdf4;
}

/* ─── Kanban: Filterleiste (CRM-010) ─────────────────────── */
.crm-kanban-toolbar {
  display: none; /* replaced by crm-pipeline-topbar */
}

/* Pipeline top bar: header row + filter row */
.crm-pipeline-topbar {
  padding: 0 0 12px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 16px;
}

.crm-pipeline-topbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.crm-pipeline-topbar-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #2d3748;
}

.crm-pipeline-topbar-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crm-pipeline-topbar-filters input[type="text"],
.crm-pipeline-topbar-filters select {
  padding: 7px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.9rem;
  background: white;
}

.crm-pipeline-topbar-filters input[type="text"] {
  min-width: 180px;
  flex: 1;
}

.crm-filter-reset {
  font-size: 0.82rem;
  color: #e53e3e;
  text-decoration: none;
  white-space: nowrap;
}

.crm-filter-reset:hover {
  text-decoration: underline;
}

/* ─── Kanban-Wrap ─────────────────────────────────────────── */
.crm-kanban-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px 20px;
  box-sizing: border-box;
}

/* ─── Modal: Verloren-Grund-Dialog (CRM-009) ─────────────── */
.crm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.crm-modal {
  background: white;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
  width: 440px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.crm-modal-header {
  padding: 18px 20px 14px;
  font-size: 1rem;
  font-weight: 700;
  color: #2d3748;
  border-bottom: 1px solid #e2e8f0;
}

.crm-modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.crm-modal-vorgang-info {
  font-size: 0.84rem;
  color: #4a5568;
  margin: 0 0 14px;
}

.crm-modal-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4a5568;
  display: block;
  margin-bottom: 5px;
}

.crm-required {
  color: #e53e3e;
}

.crm-modal-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.85rem;
  background: white;
  cursor: pointer;
}

.crm-modal-select:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.crm-modal-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.84rem;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.crm-modal-textarea:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.crm-modal-footer {
  padding: 14px 20px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #e2e8f0;
}

.crm-modal-footer .crm-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ─── Dev2: Kundenpfad-Styles (CRM-003 bis CRM-006) ─────── */

/* Wrapper für alle CRM-Views */
.crm-view-wrapper {
  padding: 24px;
  max-width: 960px;
}

/* Breadcrumb / Zurück-Zeile */
.crm-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* Detail-Karte (Kunden + Vorgänge) */
.crm-detail-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.crm-detail-headline {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 18px;
}

/* Grid für Inline-Felder */
.crm-inline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
}

@media (max-width: 600px) {
  .crm-inline-grid { grid-template-columns: 1fr; }
}

/* Einzelnes Inline-Feld */
.crm-inline-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Label */
.crm-field-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5c6773;
}

/* Contenteditable Inline-Edit Span */
.crm-inline-edit {
  display: block;
  padding: 7px 10px;
  border: 1px solid #cbd5e0;
  border-radius: 5px;
  font-size: 0.88rem;
  color: #2d3748;
  min-height: 34px;
  cursor: text;
  background: #fff;
  transition: border-color 0.1s, box-shadow 0.1s;
  word-break: break-word;
}

.crm-inline-edit:hover {
  border-color: #a0aec0;
}

.crm-inline-edit:focus {
  outline: none;
  background: #fff;
  border-color: #3182ce;
  box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.15);
}

.crm-inline-edit-large {
  font-size: 1rem;
  font-weight: 600;
  min-height: 36px;
}

.crm-inline-edit-notiz {
  min-height: 80px;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

/* Fehleranzeige */
.crm-field-error {
  font-size: 0.76rem;
  color: #e53e3e;
  min-height: 16px;
}

/* Abschnitt-Header (Titel + Button nebeneinander) */
.crm-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.crm-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #2d3748;
  margin: 0;
}

/* Vorgangskarten-Zeile */
.crm-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.crm-card-titel {
  font-size: 0.9rem;
  color: #2d3748;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-card-meta {
  font-size: 0.78rem;
  color: #5c6773;
}

/* Meta-Zeile in Detailansichten */
.crm-meta {
  font-size: 0.78rem;
  color: #687482;
  margin-top: 8px;
}

/* Link-Stil */
.crm-link {
  color: #0064d2;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}

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

/* Formular-Input */
.crm-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  background: white;
  box-sizing: border-box;
}

.crm-input:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.15);
}

.crm-textarea {
  resize: vertical;
}

/* Formular-Zeile */
.crm-form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

/* Modal-Titel + Untertitel */
.crm-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #2d3748;
  margin: 0 0 4px;
  padding: 18px 20px 0;
}

.crm-modal-subtitle {
  font-size: 1rem;
  font-weight: 700;
  color: #2d3748;
  line-height: 1.6;
  margin: 0 0 24px;
  padding: 18px 20px 0;
}

.crm-modal > .crm-form-row,
.crm-modal > .crm-field-error {
  padding: 0 20px;
}

.crm-modal > .crm-modal-footer {
  margin-top: 4px;
}

/* Sortier-Icon in Tabellenköpfen */
.crm-sort-icon {
  font-size: 0.75rem;
  color: #4a5568;
}

/* Kundensuche-Modal: Zeilen */
.crm-ks-row {
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  border-bottom: 1px solid #f0f4f8;
  line-height: 1.3;
  font-size: 0.83rem;
}

.crm-ks-row:hover {
  background: #ebf8ff;
}

/* ─── Admin: Kanban-Spalten-Verwaltung (CRM-023–026) ────────── */
.crm-admin-spalte-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #f0f4f8;
  transition: background 0.1s;
}

.crm-admin-spalte-row:hover {
  background: #f7fafc;
}

.crm-admin-spalte-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.crm-admin-spalte-emoji {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.crm-admin-spalte-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #2d3748;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: border-color 0.1s, background 0.1s;
}

.crm-admin-spalte-name:hover {
  background: #edf2f7;
  border-color: #e2e8f0;
}

.crm-admin-rename-input {
  width: 180px;
  font-size: 0.88rem;
  padding: 3px 6px;
}

.crm-admin-farb-badge {
  width: 24px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
}

.crm-admin-spalte-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.crm-admin-action-btn {
  padding: 4px 8px !important;
  font-size: 0.78rem !important;
}

.crm-admin-sonder-hint {
  font-size: 0.75rem;
  color: #687482;
  font-style: italic;
}

.crm-admin-reorder-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.crm-admin-reorder-btn {
  padding: 1px 6px !important;
  font-size: 0.72rem !important;
  line-height: 1;
  min-width: 24px;
}

.crm-admin-reorder-placeholder {
  display: block;
  width: 24px;
  height: 18px;
}

/* Inline Emoji+Farbe Edit Form */
.crm-admin-spalte-style-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 0 4px;
}

.crm-admin-color-input {
  width: 40px;
  height: 30px;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  padding: 2px;
  cursor: pointer;
  background: white;
}

/* Add-Spalte Form */
.crm-admin-spalte-add-form {
  padding: 12px 0;
}

.crm-admin-add-fields {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.crm-admin-add-fields .crm-form-row {
  margin-bottom: 0 !important;
}

.crm-admin-spalte-rename-hint {
  width: 100%;
  padding: 0 0 4px 60px;
}

/* ─── Admin Config-Listen (CRM-027 + CRM-028, Dev3) ─────── */
.crm-admin-list-hint {
  font-size: 0.82rem;
  color: #92631a;
  background: #fffff0;
  border: 1px solid #fefcbf;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
  line-height: 1.45;
}

.crm-admin-list {
  margin-bottom: 12px;
}

.crm-admin-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid #f0f4f8;
  gap: 8px;
}

.crm-admin-list-row:hover {
  background: #f7fafc;
}

.crm-admin-list-text {
  font-size: 0.88rem;
  color: #2d3748;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-admin-list-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.crm-admin-list-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px 5px;
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity 0.1s;
}

.crm-admin-list-actions button:hover {
  opacity: 1;
  background: #edf2f7;
}

.crm-admin-list-inline-input {
  flex: 1;
  min-width: 0;
}

.crm-admin-list-add {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.crm-admin-list-add .crm-input {
  flex: 1;
  min-width: 0;
}

.crm-admin-list-add .crm-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ─── Pipeline-View (ersetzt Kanban-Board-Darstellung) ──────── */

/* Pipeline wrap */
.crm-pipeline-wrap {
  padding: 16px 20px;
}

/* Funnel stepper at top */
.crm-pipeline-funnel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.crm-pipeline-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4a5568;
  transition: background 0.15s;
}

.crm-pipeline-step:hover {
  background: #edf2f7;
}

.crm-pipeline-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.crm-pipeline-step-count {
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.75rem;
}

/* Pipeline list */
.crm-pipeline-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Sections */
.crm-pipeline-section {
  margin-bottom: 8px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.crm-pipeline-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f7fafc;
  border-bottom: 1px solid #e2e8f0;
  user-select: none;
}

.crm-pipeline-section-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #2d3748;
  flex: 1;
}

.crm-pipeline-section-count {
  font-size: 0.78rem;
  color: #5c6773;
  background: #e2e8f0;
  border-radius: 10px;
  padding: 1px 8px;
}

.crm-pipeline-section-bar {
  width: 4px;
  border-radius: 2px;
  height: 18px;
  flex-shrink: 0;
}

/* Items container */
.crm-pipeline-items {
  background: #fff;
  min-height: 8px;
}

.crm-pipeline-items-empty {
  padding: 12px 16px;
  font-size: 0.83rem;
  color: #687482;
  font-style: italic;
}

/* Row */
.crm-pipeline-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f4f8;
  cursor: pointer;
  transition: background 0.1s;
}

.crm-pipeline-row:last-child {
  border-bottom: none;
}

.crm-pipeline-row:hover {
  background: #f7fafc;
}

/* Drag handle */
.crm-pipeline-handle {
  cursor: grab;
  color: #cbd5e0;
  font-size: 1.1rem;
  padding: 2px 4px;
  flex-shrink: 0;
  user-select: none;
}

.crm-pipeline-handle:active {
  cursor: grabbing;
}

/* Alarm-Indikator: keine Aktivität oder überfällige Wiedervorlage */
.crm-pipeline-alarm {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
  cursor: default;
}
.crm-pipeline-row--alarm {
  border-left: 3px solid #e53e3e;
}

/* Row content */
.crm-pipeline-row-main {
  flex: 1;
  min-width: 0;
}

.crm-pipeline-row-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 700;
  font-size: 0.88rem;
  color: #2d3748;
}

.crm-pipeline-row-name-wv {
  font-weight: 400;
  font-size: 0.78rem;
}

.crm-pipeline-row-titel {
  font-size: 0.82rem;
  color: #5c6773;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-pipeline-row-fahrzeuge {
  margin-top: 3px;
}

.crm-pipeline-row-fahrzeug {
  display: block;
  font-size: 0.78rem;
  color: #4a5568;
}

.crm-pipeline-row-fahrzeug--fav {
  font-weight: 600;
  color: #2d3748;
}

.crm-pipeline-row-wv {
  font-size: 0.78rem;
  font-weight: 600;
}

.crm-pipeline-row-akt {
  font-size: 0.78rem;
  color: #687482;
}

/* Seller badge */
.crm-pipeline-seller {
  background: #edf2f7;
  color: #4a5568;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Ghost/dragging states */
.crm-pipeline-ghost {
  opacity: 0.4;
  background: #ebf8ff !important;
  border: 2px dashed #3182ce !important;
}

.crm-pipeline-dragging {
  opacity: 0.9;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.crm-pipeline-droppable {
  background: #f0f9ff;
}

/* ─── Status-Select auf Detailseite ─────────────────────────── */
.crm-status-select {
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  appearance: auto;
  transition: opacity 0.15s;
}

.crm-status-select:hover {
  opacity: 0.85;
}

/* ─── Fälligkeitshinweis ─────────────────────────────────────── */
.crm-faellig-hinweis {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.crm-faellig-hinweis--ok {
  background: #f0fff4;
  border: 1px solid #9ae6b4;
  color: #276749;
}

.crm-faellig-zeile {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}

.crm-faellig-zeile + .crm-faellig-zeile {
  border-top: 1px solid #c6f6d5;
  margin-top: 4px;
  padding-top: 6px;
}

.crm-faellig-date-input {
  flex-shrink: 0;
}

.crm-faellig-actions {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.crm-faellig-actions .crm-akt-erledigt-btn,
.crm-faellig-actions .crm-akt-loeschen-btn {
  margin-left: 0;
}

.crm-faellig-hinweis--warn {
  background: #fffaf0;
  border: 1px solid #fbd38d;
  color: #7b341e;
  font-weight: 500;
}

/* ─── Aktivitäten-Typ-Buttons ────────────────────────────────── */
.crm-akt-typ-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.crm-akt-typ-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  min-width: 68px;
}

.crm-akt-typ-btn:hover {
  border-color: #a0aec0;
  background: #f7fafc;
  transform: translateY(-1px);
}

.crm-akt-typ-btn.active {
  border-color: #3182ce;
  background: #ebf8ff;
}

.crm-akt-typ-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.crm-akt-typ-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ─── Aktivitäten-Inline-Formular ────────────────────────────── */
.crm-akt-inline-form {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 16px;
}

.crm-akt-form-titel {
  font-size: 0.9rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 10px;
}

.crm-akt-form-footer {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.crm-akt-faellig-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 200px;
}

.crm-akt-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── Aktivitäten-Zeitlinie ───────────────────────────────────── */
.crm-akt-zeitlinie {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
}

.crm-akt-eintrag {
  display: flex;
  gap: 14px;
  position: relative;
  padding-bottom: 20px;
}

.crm-akt-eintrag--erledigt .crm-akt-body {
  opacity: 0.5;
}

.crm-akt-eintrag--erledigt .crm-akt-icon {
  opacity: 0.4;
}

.crm-akt-mehr-btn {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 7px;
  background: #f7fafc;
  border: 1px dashed #cbd5e0;
  border-radius: 6px;
  color: #5c6773;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: center;
}

.crm-akt-mehr-btn:hover {
  background: #edf2f7;
  color: #2d3748;
}

.crm-akt-footer {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.crm-akt-erledigt-btn {
  font-size: 0.78rem;
  padding: 3px 10px;
  border: 1px solid #cbd5e0;
  border-radius: 12px;
  background: #f7fafc;
  color: #4a5568;
  cursor: pointer;
}

.crm-akt-erledigt-btn:hover {
  background: #edf2f7;
}

.crm-akt-loeschen-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.3;
  padding: 0 2px;
  line-height: 1;
}

.crm-akt-loeschen-btn:hover {
  opacity: 1;
}

.crm-akt-eintrag--erledigt .crm-akt-erledigt-btn {
  background: #f0fff4;
  border-color: #9ae6b4;
  color: #276749;
}

/* Verbindungslinie zwischen Einträgen */
.crm-akt-eintrag:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.crm-akt-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #edf2f7;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  z-index: 1;
}

.crm-akt-body {
  flex: 1;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  min-width: 0;
}

.crm-akt-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.crm-akt-datum {
  font-size: 0.78rem;
  font-weight: 700;
  color: #4a5568;
}

.crm-akt-urheber {
  font-size: 0.78rem;
  color: #5c6773;
  background: #edf2f7;
  border-radius: 10px;
  padding: 1px 8px;
}

.crm-akt-faellig {
  font-size: 0.78rem;
}

.crm-akt-text {
  font-size: 0.88rem;
  color: #2d3748;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
