/**
 * Aquamentum CRM - Styles
 * Zusätzliche Styles für das CRM-Modul
 */

/* ============================================
   LOGIN
   ============================================ */

.crm-login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, #1a4a6e 100%);
  padding: var(--space-lg);
}

.crm-login-box {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 400px;
}

.crm-login-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.crm-login-header h1 {
  color: var(--color-primary);
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-xs);
}

.crm-login-header p {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.crm-login-form .form-group {
  margin-bottom: var(--space-md);
}

/* Password toggle wrapper - used across all password fields */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  flex: 1;
  padding-right: 2.5rem !important;
}

.password-toggle-btn {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.password-toggle-btn:hover {
  color: var(--color-primary);
}

.crm-login-form label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.crm-login-form input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.crm-login-form input:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(91, 178, 172, 0.2);
}

.crm-login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-sm);
}

.crm-login-form .btn-block {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-base);
}

.crm-login-footer {
  text-align: center;
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.crm-login-footer a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--font-size-sm);
}

.crm-login-footer a:hover {
  color: var(--color-secondary);
}

/* ============================================
   USER INFO (Header)
   ============================================ */

.crm-user-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.crm-user-name {
  font-weight: 500;
  font-size: var(--font-size-sm);
}

.crm-user-role {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: capitalize;
}

.crm-user-info .btn {
  padding: var(--space-xs);
}

.crm-user-info .btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   CRM NAVIGATION
   ============================================ */


.crm-nav-badge {
  background: var(--color-secondary);
  color: white;
  font-size: var(--font-size-xs);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-left: auto;
}

/* ============================================
   CRM DASHBOARD
   ============================================ */

.crm-dashboard {
  padding: var(--space-lg);
}

.crm-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.crm-dashboard-header h1 {
  font-size: var(--font-size-2xl);
  color: var(--color-primary);
}

.crm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.crm-kpi-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-secondary);
}

.crm-kpi-card .kpi-value {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--color-primary);
}

.crm-kpi-card .kpi-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.crm-kpi-card .kpi-trend {
  font-size: var(--font-size-xs);
  margin-top: var(--space-sm);
}

.crm-kpi-card .kpi-trend.positive {
  color: #22c55e;
}

.crm-kpi-card .kpi-trend.negative {
  color: #ef4444;
}

/* ============================================
   PIPELINE (Kanban)
   ============================================ */

.crm-pipeline {
  padding: var(--space-lg);
  /* Flexbox-Inheritance: Pipeline füllt den verfügbaren Platz im Content-Bereich */
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: var(--radius-lg);
  /* Kein margin - content-padding reicht */
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.pipeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.pipeline-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.btn-toggle-deals {
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}

.btn-toggle-deals:hover {
  background: var(--color-primary-light);
}

.btn-toggle-deals.active {
  background: var(--color-primary);
  color: var(--color-white);
}

.pipeline-header-left h1 {
  font-size: var(--font-size-xl);
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
  font-weight: 600;
}

.pipeline-stats {
  display: flex;
  gap: var(--space-lg);
  color: var(--color-text-muted);
}

.pipeline-stats .stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pipeline-stats .stat-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.1;
}

.pipeline-stats .stat-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

/* Legacy: strong innerhalb .stat (Kompatibilität) */
.pipeline-stats .stat strong {
  color: var(--color-primary);
  font-size: var(--font-size-xl);
  font-weight: 700;
}

/* Kanban Board — mit Scroll-Wrapper für Fade-Effekt */
.kanban-board-wrapper {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Fade-Indikator rechts: zeigt dass mehr Spalten folgen */
.kanban-board-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 48px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.9));
  pointer-events: none;
  z-index: 2;
  border-radius: 0 var(--radius-lg) 0 0;
  transition: opacity var(--transition-fast);
}

.kanban-board-wrapper.scroll-end::after {
  opacity: 0;
}

.kanban-board {
  display: flex;
  gap: var(--space-md);
  height: 100%;
  padding-bottom: var(--space-md);
  overflow-x: auto;
  overflow-y: hidden;
  /* Custom Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.kanban-board::-webkit-scrollbar {
  height: 4px;
}

.kanban-board::-webkit-scrollbar-track {
  background: transparent;
}

.kanban-board::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

.kanban-board::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

.kanban-column {
  flex: 0 0 260px; /* Feste Breite — Drop-Zones sind immer gleich groß */
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: 100%;
  overflow: hidden;
  /* Farbindikator: top-border per Stage-Klasse */
  border-top: 3px solid var(--stage-color, var(--color-border));
}

/* Stage-spezifische Farben */
.kanban-column[data-stage-type="new"]         { --stage-color: #94a3b8; }
.kanban-column[data-stage-type="contacted"]   { --stage-color: #3b82f6; }
.kanban-column[data-stage-type="qualified"]   { --stage-color: #8b5cf6; }
.kanban-column[data-stage-type="proposal"]    { --stage-color: var(--color-warning); }
.kanban-column[data-stage-type="negotiation"] { --stage-color: #f97316; }
.kanban-column[data-stage-type="won"]         { --stage-color: var(--color-success); }
.kanban-column[data-stage-type="lost"]        { --stage-color: var(--color-error); }

/* Fallback: erste Spalte=grau, dann nach Positionsindex */
.kanban-column:nth-child(1) { --stage-color: #94a3b8; }
.kanban-column:nth-child(2) { --stage-color: #3b82f6; }
.kanban-column:nth-child(3) { --stage-color: #8b5cf6; }
.kanban-column:nth-child(4) { --stage-color: var(--color-warning); }
.kanban-column:nth-child(5) { --stage-color: #f97316; }
.kanban-column:nth-child(6) { --stage-color: var(--color-success); }
.kanban-column:nth-child(7) { --stage-color: var(--color-error); }

/* Gewonnen/Verloren Spalten kompakter */
.kanban-column[data-stage-type="won"],
.kanban-column[data-stage-type="lost"] {
  flex: 0 0 200px;
  opacity: 0.85;
}

.kanban-column-header {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kanban-column-header h3 {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-column-stats {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-xs);
}

.kanban-column-stats .count {
  background: var(--color-primary);
  color: white;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--font-size-xs);
}

.kanban-column-stats .value {
  color: var(--color-text-muted);
  white-space: nowrap;
  font-weight: 500;
}

.kanban-column-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-height: 200px;
  transition: background-color 0.2s;
}

.kanban-column-body.drag-over {
  background: rgba(91, 178, 172, 0.15);
  border-radius: var(--radius-md);
}

/* Leere Spalte Hinweis */
.kanban-column-body:empty::after {
  content: 'Keine Deals';
  display: block;
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  padding: var(--space-lg);
  opacity: 0.6;
}

/* Kanban Cards */
.kanban-card {
  background: white;
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: grab;
  transition: box-shadow 0.2s, transform 0.2s, opacity 0.2s;
  border-left: 3px solid transparent;
}

.kanban-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.kanban-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
  transform: rotate(2deg);
  box-shadow: var(--shadow-lg);
}

.kanban-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-xs);
  gap: var(--space-sm);
}

.kanban-card-header .deal-title {
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  flex: 1;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card-header .deal-value {
  color: var(--color-secondary);
  font-weight: 700;
  font-size: var(--font-size-sm);
  white-space: nowrap;
}

.kanban-card-body {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.kanban-card-body .deal-contact {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}

.kanban-card-body .contact-avatar {
  width: var(--avatar-xs);
  height: var(--avatar-xs);
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.kanban-card-body .contact-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.kanban-card-body .deal-product {
  background: var(--color-bg);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-top: var(--space-xs);
  font-size: var(--font-size-xs);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text);
}

.kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border);
  font-size: var(--font-size-xs);
}

.kanban-card-footer .deal-owner {
  width: var(--avatar-xs);
  height: var(--avatar-xs);
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
}

.kanban-card-footer .deal-date {
  color: var(--color-text-muted);
  font-weight: 500;
}

.kanban-card-footer .deal-date.overdue {
  color: #ef4444;
  font-weight: 600;
  background: #fef2f2;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* Deal Detail Modal */
.crm-modal-lg {
  max-width: 800px;
}

/* ============================================
   DEAL DETAIL MODAL HEADER
   ============================================ */

/* Modal volle Breite, kein inneres max-width */
.deal-modal-header {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--color-primary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  color: white;
  border-bottom: none;
}

/* × Schließen — groß, oben rechts */
.deal-modal-close-btn {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: none;
  background: rgba(255,255,255,0.15);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.deal-modal-close-btn:hover {
  background: rgba(255,255,255,0.3);
}

/* Titel */
.deal-modal-title {
  margin: 0 48px 0 0; /* Platz für × */
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: white;
}

/* Meta-Zeile: Stage-Badge + Wert + Priorität */
.deal-header-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.deal-stage-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.2);
  color: white;
  font-size: var(--font-size-xs);
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.3);
}

.deal-value-badge {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: white;
}

.priority-badge-sm {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

/* Aktions-Zeilen: jeweils 2 Buttons nebeneinander */
.deal-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.deal-action-row + .deal-action-row {
  margin-top: var(--space-md); /* Mehr Abstand zwischen den Zeilen */
}

.deal-action-row .btn {
  justify-content: center;
  font-size: var(--font-size-sm);
  padding: var(--space-sm) var(--space-md);
  color: white;
}

/* Bearbeiten — Outline weiß */
.deal-action-row .btn-secondary {
  background: transparent;
  color: white;
  border: 1.5px solid rgba(255,255,255,0.5);
}

.deal-action-row .btn-secondary:hover {
  background: rgba(255,255,255,0.15);
}

/* Löschen — Roter Outline-Button, gut erkennbar */
.deal-action-row .btn-error {
  background: transparent;
  color: #fca5a5;
  border: 1.5px solid #fca5a5;
}

.deal-action-row .btn-error:hover {
  background: rgba(252, 165, 165, 0.15);
}

/* Gewonnen — solides Grün */
.deal-action-row .btn-success {
  color: white;
}

/* Verloren — solides Rot mit weißer Schrift */
.deal-action-row .btn-error.btn-verloren,
.deal-action-row .btn[onclick*="markAsLost"] {
  background: var(--color-error);
  color: white;
  border-color: var(--color-error);
}

.deal-action-row .btn[onclick*="markAsLost"]:hover {
  opacity: 0.85;
}

/* Löschen-Button gezielt — Outline rot */
.deal-action-row .btn[onclick*="deleteDeal"] {
  background: transparent;
  color: #fca5a5;
  border: 1.5px solid #fca5a5;
}

.deal-action-row .btn[onclick*="deleteDeal"]:hover {
  background: rgba(252, 165, 165, 0.15);
}

/* Stage-Switcher */
.deal-stage-switcher {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(255,255,255,0.2);
}

.deal-stage-btn {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(255,255,255,0.4);
  background: transparent;
  color: rgba(255,255,255,0.75);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.deal-stage-btn:hover {
  background: rgba(255,255,255,0.2);
  color: white;
}

.deal-stage-btn.active {
  background: white;
  color: var(--color-primary);
  border-color: white;
}

.deal-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.deal-detail-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.deal-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.deal-stage {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  color: white;
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.deal-value-large {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-primary);
}

.detail-section h4 {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.contact-info {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.contact-avatar-large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.contact-details .contact-name {
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.contact-details .contact-email,
.contact-details .contact-phone {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.detail-item label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.detail-item span {
  font-size: var(--font-size-sm);
}

.deal-notes {
  background: var(--color-bg);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  white-space: pre-wrap;
}

.deal-detail-sidebar {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-lg);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.deal-detail-sidebar h4 {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
  margin-top: var(--space-lg);
}

.deal-detail-sidebar h4:first-child {
  margin-top: 0;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.stage-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

/* Legacy deal-card styles for compatibility */
.deal-card {
  background: white;
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  box-shadow: var(--shadow-sm);
  cursor: grab;
  border-left: 3px solid var(--color-secondary);
  transition: box-shadow 0.2s, transform 0.2s;
}

.deal-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.deal-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.deal-card-title {
  font-weight: 600;
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-xs);
}

.deal-card-value {
  color: var(--color-secondary);
  font-weight: 500;
  font-size: var(--font-size-sm);
}

.deal-card-meta {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-xs);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.deal-card-action {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--color-border);
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  color: white;
  font-size: var(--font-size-sm);
  z-index: 2000;
  animation: slideIn 0.3s ease;
}

.toast-success {
  background: #22c55e;
}

.toast-error {
  background: #ef4444;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================
   KONTAKTLISTE
   ============================================ */

.crm-contacts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.crm-contacts-filters {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.crm-contacts-filters select,
.crm-contacts-filters input {
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
}

.crm-contacts-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.crm-contacts-table th,
.crm-contacts-table td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.crm-contacts-table th {
  background: var(--color-bg);
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.crm-contacts-table tr:hover {
  background: var(--color-bg);
  cursor: pointer;
}

.contact-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.contact-status.lead { background: #dbeafe; color: #1d4ed8; }
.contact-status.interessent { background: #fef3c7; color: #d97706; }
.contact-status.kunde { background: #d1fae5; color: #059669; }
.contact-status.bestandskunde { background: #dcfce7; color: #16a34a; }
.contact-status.partner { background: #ede9fe; color: #7c3aed; }
.contact-status.inaktiv { background: #f3f4f6; color: #6b7280; }

/* ============================================
   AUFGABEN
   ============================================ */

.crm-tasks-group {
  margin-bottom: var(--space-xl);
}

.crm-tasks-group-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  font-weight: 600;
}

.crm-tasks-group-header .badge {
  font-size: var(--font-size-xs);
}

.crm-task-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-sm);
}

.crm-task-item.overdue {
  border-left: 3px solid #ef4444;
}

.crm-task-item.today {
  border-left: 3px solid #f59e0b;
}

/* Custom Checkbox */
.crm-task-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
  background: white;
  transition: all var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

.crm-task-checkbox:hover {
  border-color: var(--color-secondary);
  background: var(--color-secondary-light);
}

.crm-task-checkbox:checked {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
}

.crm-task-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.crm-task-content {
  flex: 1;
}

.crm-task-title {
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.crm-task-meta {
  display: flex;
  gap: var(--space-md);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.crm-task-item.completed .crm-task-title {
  text-decoration: line-through;
  color: var(--color-text-muted);
}

/* ============================================
   TIMELINE / AKTIVITÄTEN
   ============================================ */

.crm-timeline {
  position: relative;
  padding-left: var(--space-xl);
}

.crm-timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.crm-timeline-item {
  position: relative;
  padding-bottom: var(--space-lg);
}

.crm-timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-xl) + 6px);
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-secondary);
  border: 2px solid white;
}

.crm-timeline-item.note::before { background: #6b7280; }
.crm-timeline-item.call::before { background: #3b82f6; }
.crm-timeline-item.email::before { background: #8b5cf6; }
.crm-timeline-item.meeting::before { background: #ec4899; }
.crm-timeline-item.stage_change::before { background: #f59e0b; }

.crm-timeline-date {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.crm-timeline-content {
  background: white;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.crm-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.crm-timeline-type {
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--color-secondary);
}

.crm-timeline-user {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ============================================
   MODAL / FORMULARE
   ============================================ */

.crm-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-lg);
}

.crm-modal-content {
  background: white;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

/* Kontakt-Info-Grid (2 Spalten Desktop, 1 Spalte Mobile) */
.contact-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.crm-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.crm-modal-header h2 {
  font-size: var(--font-size-xl);
  color: var(--color-primary);
}

.crm-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  color: var(--color-text-muted);
}

.crm-modal-close:hover {
  color: var(--color-text);
}

.crm-modal-body {
  padding: var(--space-lg);
}

/* Form Styling für Modals */
.crm-modal-body .form-group {
  margin-bottom: var(--space-md);
}

.crm-modal-body label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.crm-modal-body .form-control,
.crm-modal-body input[type="text"],
.crm-modal-body input[type="number"],
.crm-modal-body input[type="date"],
.crm-modal-body input[type="email"],
.crm-modal-body select,
.crm-modal-body textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-family: inherit;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.crm-modal-body input:focus,
.crm-modal-body select:focus,
.crm-modal-body textarea:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(91, 178, 172, 0.2);
}

.crm-modal-body .form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.crm-modal-body textarea {
  resize: vertical;
  min-height: 80px;
}

.crm-modal-body .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

/* CRM Button Varianten */
.btn-success {
  background: #22c55e;
  color: white;
  border: none;
}

.btn-success:hover {
  background: #16a34a;
}

.btn-danger {
  background: #ef4444;
  color: white;
  border: none;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-outline {
  background: transparent;
  border: 1px solid currentColor;
}

.btn-outline:hover {
  background: rgba(0, 0, 0, 0.05);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-xs);
}

.crm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

/* Task-Detail: 2 Spalten Desktop, 1 Spalte Mobile */
.task-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

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

  .crm-modal {
    padding: var(--space-sm);
    align-items: flex-end;
  }

  .crm-modal-content {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 92vh;
  }

  .crm-modal-footer {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .crm-modal-footer .btn {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
  }

  .crm-modal-body .form-row {
    grid-template-columns: 1fr;
  }
}

/* Kleine Modals für Confirm/Prompt */
.crm-modal-sm {
  max-width: 420px;
}

.crm-modal-sm .crm-modal-body {
  padding: var(--space-lg);
}

.crm-modal-sm .crm-modal-footer {
  padding: var(--space-md) var(--space-lg);
}

/* Produkt-Autocomplete Dropdown (Angebote) */
.product-dropdown {
  position: absolute;
  z-index: 10000;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  max-height: 240px;
  overflow-y: auto;
  min-width: 280px;
}

.product-dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  transition: background 0.1s;
}

.product-dropdown-item:last-child {
  border-bottom: none;
}

.product-dropdown-item:hover {
  background: var(--color-bg-secondary, #f8fafc);
}

/* Wrapper für position:relative beim Dropdown */
.product-search-wrapper {
  position: relative;
}

/* Prioritäts-Indikator in Kanban-Karten — dezenter Farbpunkt */
.deal-priority {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.deal-priority::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Prioritäts-Farben */
.deal-priority.hoch,
.deal-priority.high {
  color: var(--color-error);
}
.deal-priority.hoch::before,
.deal-priority.high::before {
  background: var(--color-error);
}

.deal-priority.normal,
.deal-priority.medium {
  color: var(--color-warning);
}
.deal-priority.normal::before,
.deal-priority.medium::before {
  background: var(--color-warning);
}

.deal-priority.niedrig,
.deal-priority.low {
  color: var(--color-text-muted);
}
.deal-priority.niedrig::before,
.deal-priority.low::before {
  background: #cbd5e1;
}

/* Text-Styles für Status */
.overdue-text {
  color: #ef4444;
  font-weight: 600;
}

.won-text {
  color: #22c55e;
  font-weight: 600;
}

.lost-text {
  color: #ef4444;
  font-weight: 600;
}

/* Detail-Ansicht Links */
.contact-email a,
.contact-phone a,
.contact-mobile a {
  color: var(--color-secondary);
  text-decoration: none;
}

.contact-email a:hover,
.contact-phone a:hover,
.contact-mobile a:hover {
  text-decoration: underline;
}

/* Company Info */
.company-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.company-name {
  font-weight: 500;
  color: var(--color-text);
}

.company-type {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

/* Danger Zone */
.danger-zone h4 {
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-sm);
}

/* ============================================
   SLIDE-IN PANEL (Aquamentum CRM)
   ============================================ */

.slide-panel {
  position: fixed;
  top: 0;
  right: -500px;
  width: 480px;
  max-width: 100vw;
  height: 100vh;
  background: white;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
}

.slide-panel.open {
  right: 0;
}

.slide-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.slide-panel-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.slide-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.slide-panel-header h2 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-primary);
  margin: 0;
}

.slide-panel-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: var(--space-xs);
  line-height: 1;
}

.slide-panel-close:hover {
  color: var(--color-text);
}

.slide-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
}

.slide-panel-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

/* Form Styling für Slide Panel */
.slide-panel .form-group {
  margin-bottom: var(--space-lg);
}

.slide-panel .form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.slide-panel .form-group label .required {
  color: #ef4444;
  margin-left: 2px;
}

.slide-panel .form-control {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-family: inherit;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.slide-panel .form-control:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(91, 178, 172, 0.2);
}

.slide-panel .form-control::placeholder {
  color: var(--color-text-muted);
}

.slide-panel .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.slide-panel .form-section {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.slide-panel .form-section:last-child {
  border-bottom: none;
}

.slide-panel .form-section-title {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-md);
}

.crm-form .form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.crm-form .form-group {
  margin-bottom: var(--space-md);
}

.crm-form label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-sm);
}

.crm-form input,
.crm-form select,
.crm-form textarea {
  width: 100%;
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
}

.crm-form input:focus,
.crm-form select:focus,
.crm-form textarea:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(91, 178, 172, 0.2);
}

.crm-form textarea {
  resize: vertical;
  min-height: 100px;
}

/* ============================================
   RESPONSIVE — Pipeline Grid-Breakpoints
   ============================================ */

/* Mixin für Grid-Modus (2er und 3er Reihe) */
.kanban-grid-mode .kanban-board-wrapper {
  overflow: visible;
  flex: none;
}
.kanban-grid-mode .kanban-board {
  display: grid;
  height: auto;
  overflow: visible;
  padding-bottom: var(--space-lg);
}
.kanban-grid-mode .kanban-board-wrapper::after {
  display: none;
}
.kanban-grid-mode .kanban-column {
  flex: none;
  width: auto;
  max-height: 420px;
  overflow: hidden;
}
.kanban-grid-mode .kanban-column-body {
  flex: 1;
  overflow-y: auto;
  min-height: 100px;
}
.kanban-grid-mode .crm-pipeline {
  height: auto !important;
  flex: none;
}
.kanban-grid-mode.content.pipeline-mode {
  overflow-y: auto;
  padding-bottom: var(--space-xl);
}

/* ≥1920px: alles in einer Zeile (Default — keine Klasse nötig) */

/* 1200px – 1919px: 2er-Reihe */
@media (max-width: 1919px) and (min-width: 1200px) {
  .kanban-board {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    height: auto;
    overflow: visible;
    padding-bottom: var(--space-lg);
  }
  .kanban-board-wrapper {
    overflow: visible;
    flex: none;
  }
  .kanban-board-wrapper::after { display: none; }
  .kanban-column {
    flex: none;
    width: auto;
    max-height: 420px;
    overflow: hidden;
  }
  .kanban-column-body {
    overflow-y: auto;
    min-height: 100px;
  }
  .crm-pipeline {
    height: auto !important;
    flex: none;
  }
  .content.pipeline-mode {
    overflow-y: auto;
    padding-bottom: var(--space-xl);
  }
}

/* 880px – 1219px: 3er-Reihe */
@media (max-width: 1219px) and (min-width: 880px) {
  .kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    height: auto;
    overflow: visible;
    padding-bottom: var(--space-lg);
  }
  .kanban-board-wrapper {
    overflow: visible;
    flex: none;
  }
  .kanban-board-wrapper::after { display: none; }
  .kanban-column {
    flex: none;
    width: auto;
    max-height: 380px;
    overflow: hidden;
  }
  .kanban-column-body {
    overflow-y: auto;
    min-height: 80px;
  }
  .crm-pipeline {
    height: auto !important;
    flex: none;
  }
  .content.pipeline-mode {
    overflow-y: auto;
    padding-bottom: var(--space-xl);
  }
  .crm-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .slide-panel {
    width: min(480px, 100vw);
    right: -100vw;
  }
  .search-box input {
    width: 150px;
  }
}

/* < 770px: einzelne Spalten gestapelt */
@media (max-width: 769px) {
  .crm-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .crm-pipeline {
    padding: var(--space-md);
    margin: 0;
    border-radius: var(--radius-md);
    height: auto !important;
    flex: none;
  }
  .content.pipeline-mode {
    overflow-y: auto;
    padding-bottom: var(--space-md);
  }
  .kanban-board-wrapper {
    overflow: visible;
    flex: none;
  }
  .kanban-board-wrapper::after { display: none; }
  .kanban-board {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
    gap: var(--space-sm);
    padding-bottom: var(--space-sm);
  }
  .kanban-column {
    flex: none;
    width: 100%;
    max-height: none;
    overflow: visible;
  }
  .kanban-column[data-stage-type="won"],
  .kanban-column[data-stage-type="lost"] {
    flex: none;
    width: 100%;
    opacity: 1;
  }
  .kanban-column-body {
    flex: none;
    overflow-y: visible;
    min-height: 80px;
  }
  .pipeline-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  .pipeline-stats {
    flex-wrap: wrap;
    gap: var(--space-md);
  }
  .crm-form .form-row {
    grid-template-columns: 1fr;
  }
  .crm-contacts-header {
    flex-direction: column;
    align-items: stretch;
  }
  .slide-panel {
    width: 100%;
    right: -100%;
  }
}

/* ============================================
   TABS
   ============================================ */

.crm-tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0;
}

.crm-tab {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: -1px;
}

.crm-tab:hover {
  color: var(--color-text);
}

.crm-tab.active {
  color: var(--color-secondary);
  border-bottom-color: var(--color-secondary);
  font-weight: 500;
}

/* ============================================
   TASKS
   ============================================ */

.crm-tasks-page {
  padding: var(--space-lg);
  overflow-x: hidden;
  min-height: 0;
}

.task-group {
  margin-bottom: var(--space-xl);
}

.task-card {
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.task-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.task-checkbox {
  transition: transform 0.2s, background 0.2s;
}

.task-checkbox:hover {
  transform: scale(1.1);
}

.task-priority {
  font-size: var(--font-size-xs);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-success {
  background: #10b981;
  color: white;
  border: none;
}

.btn-success:hover {
  background: #059669;
}

/* ============================================
   TIMELINE
   ============================================ */

.timeline {
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-icon {
  position: relative;
  z-index: 1;
}

.timeline-content {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

/* ============================================
   DASHBOARD (Phase 6)
   ============================================ */

/* Zeitraum-Buttons */
.dashboard-period-bar {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.dashboard-period-btn {
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: white;
  font-size: var(--font-size-sm);
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all 0.15s ease;
}

.dashboard-period-btn:hover {
  border-color: var(--color-secondary);
  color: var(--color-secondary);
}

.dashboard-period-btn.active {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: white;
  font-weight: 600;
}

/* KPI-Karte: Icon */
.crm-kpi-card .kpi-icon {
  margin-bottom: var(--space-sm);
}

.crm-kpi-card .kpi-icon i {
  width: 20px;
  height: 20px;
}

/* Dashboard Widgets Grid */
.dashboard-widgets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.dashboard-pipeline-widget {
  grid-column: 1 / -1;
}

/* Aufgaben-Widget */
.dashboard-task-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.1s;
}

.dashboard-task-row:last-child {
  border-bottom: none;
}

.dashboard-task-row:hover {
  background: var(--color-bg);
}

.dashboard-task-prio {
  width: 3px;
  height: 32px;
  border-radius: 2px;
  flex-shrink: 0;
}

.dashboard-task-info {
  flex: 1;
  min-width: 0;
}

.dashboard-task-title {
  font-size: var(--font-size-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-task-contact {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Aktivitäten-Widget */
.dashboard-activity-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.1s;
}

.dashboard-activity-row:last-child {
  border-bottom: none;
}

.dashboard-activity-row:hover {
  background: var(--color-bg);
}

.dashboard-activity-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dashboard-activity-info {
  flex: 1;
  min-width: 0;
}

.dashboard-activity-text {
  font-size: var(--font-size-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-activity-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  display: flex;
  gap: var(--space-xs);
}

/* Pipeline-Mini-Widget */
.dashboard-pipeline-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

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

.dashboard-pipeline-stage {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 160px;
  flex-shrink: 0;
}

.dashboard-stage-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.dashboard-stage-name {
  font-size: var(--font-size-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-pipeline-bar-wrap {
  flex: 1;
  height: 16px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.dashboard-pipeline-bar {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 0.3s ease;
}

.dashboard-pipeline-stats {
  display: flex;
  gap: var(--space-md);
  width: 120px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.dashboard-pipeline-count {
  font-weight: 600;
  font-size: var(--font-size-sm);
  min-width: 24px;
  text-align: right;
}

.dashboard-pipeline-value {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  min-width: 60px;
  text-align: right;
}

/* ============================================
   REPORTS (Phase 6)
   ============================================ */

/* Tab-Navigation */
.reports-tabs {
  display: flex;
  gap: var(--space-xs);
  border-bottom: 2px solid var(--color-border);
  margin-bottom: var(--space-lg);
}

.reports-tab-btn {
  padding: var(--space-sm) var(--space-lg);
  border: none;
  background: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.reports-tab-btn:hover {
  color: var(--color-primary);
}

.reports-tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Reports Tabelle */
.reports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.reports-table th {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.reports-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.reports-table tr:last-child td {
  border-bottom: none;
}

.reports-table tr:hover td {
  background: var(--color-bg);
}

/* Stage-Badge */
.stage-badge {
  display: inline-block;
  padding: 2px var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

/* Source-Kategorie-Badge */
.source-category-badge {
  display: inline-block;
  padding: 2px var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

/* Progress Bar */
.reports-bar-track {
  height: 8px;
  background: var(--color-bg);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.reports-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  min-width: 2px;
}

/* Monatstrend / Balkendiagramm */
.reports-trend {
  display: flex;
  align-items: flex-end;
  gap: var(--space-sm);
  height: 120px;
  padding: var(--space-md) 0 var(--space-xs);
  overflow-x: auto;
}

.trend-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 40px;
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  flex: 1;
}

.trend-bar-new {
  width: 12px;
  background: #8b5cf640;
  border: 1px solid #8b5cf6;
  border-radius: 2px 2px 0 0;
  transition: height 0.3s ease;
  min-height: 0;
}

.trend-bar-won {
  width: 12px;
  background: #22c55e;
  border-radius: 2px 2px 0 0;
  transition: height 0.3s ease;
  min-height: 0;
}

.trend-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.trend-count {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text);
}

.reports-legend {
  display: flex;
  gap: var(--space-lg);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-md);
}

/* Reports Responsive */
@media (max-width: 768px) {
  .dashboard-widgets-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-pipeline-widget {
    grid-column: auto;
  }

  .dashboard-pipeline-stage {
    width: 120px;
  }

  /* Period-Bar: Label ausblenden, Buttons als gleichbreites Grid */
  .dashboard-period-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xs);
  }

  .dashboard-period-bar > span {
    display: none;
  }

  .dashboard-period-btn {
    text-align: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
  }

  /* Tabs: horizontal scroll statt umbrechen */
  .reports-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    flex-wrap: nowrap;
  }

  /* Tabellen: horizontal scrollbar im Container */
  .reports-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 calc(-1 * var(--space-md));
    padding: 0 var(--space-md);
  }

  .reports-table {
    min-width: 480px;
  }

  .reports-table th,
  .reports-table td {
    padding: var(--space-xs) var(--space-sm);
    white-space: nowrap;
  }

  /* Spalten auf Mobile ausblenden: Verteilung/Anteil-Bar */
  .reports-table .col-bar {
    display: none;
  }

  /* Trend: kompakter */
  .reports-trend {
    height: 100px;
    gap: var(--space-xs);
  }

  .trend-col {
    min-width: 32px;
  }

  .trend-bar-new,
  .trend-bar-won {
    width: 9px;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============================================
   HQ LOGIN GATE (Overlay)
   ============================================ */

#hq-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(135deg, var(--color-primary) 0%, #1a4a6e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.hq-login-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hq-login-box {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 400px;
}

.hq-login-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.hq-login-logo {
  width: 80px;
  height: auto;
  margin-bottom: var(--space-md);
}

.hq-login-header h1 {
  color: var(--color-primary);
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-xs);
}

.hq-login-header p {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.hq-login-form .form-group {
  margin-bottom: var(--space-md);
}

.hq-login-form label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.hq-login-form input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hq-login-form input:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(91, 178, 172, 0.2);
}

.hq-login-form .btn-block {
  width: 100%;
  margin-top: var(--space-sm);
}

.hq-login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-sm);
}

/* ============================================
   SIDEBAR USER INFO
   ============================================ */

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: var(--space-xs);
}

.sidebar-user-details {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-sidebar-text, #e2e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  display: block;
  font-size: 11px;
  color: var(--color-sidebar-muted, #94a3b8);
  text-transform: capitalize;
}

.sidebar-logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  color: var(--color-sidebar-muted, #94a3b8);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.sidebar-logout-btn:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
}

.sidebar-logout-btn i {
  width: 16px;
  height: 16px;
}

/* ============================================
   ZEITERFASSUNG - SIDEBAR WIDGET
   ============================================ */

#sidebar-zeiterfassung {
  padding: var(--space-xs) var(--space-md);
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-bottom: var(--space-xs);
}

.ze-widget {
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.75);
}

.ze-widget-status {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: 2px;
}

.ze-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ze-status-dot--green { background: #22c55e; box-shadow: 0 0 4px #22c55e; }
.ze-status-dot--gray  { background: #64748b; }

.ze-widget-label {
  font-size: var(--font-size-xs);
  opacity: 0.85;
}

.ze-widget-time {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: #7dd3ce;
  margin-left: 11px;
  margin-bottom: var(--space-xs);
}

.ze-clockout-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: var(--radius-md);
  padding: 5px 10px;
  font-size: var(--font-size-xs);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  letter-spacing: 0.01em;
}
.ze-clockout-btn:hover {
  background: rgba(239, 68, 68, 0.32);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fecaca;
}
.ze-clockout-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ze-clockout-btn i { width: 12px; height: 12px; }

/* ============================================
   ZEITERFASSUNG - SEITE
   ============================================ */

.ze-page {
  padding: var(--space-lg);
}

.ze-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.ze-page-header h1 {
  font-size: var(--font-size-2xl);
  color: var(--color-primary);
}

/* Heute-Karte */
.ze-heute-card {
  margin-bottom: var(--space-xl);
}

.ze-heute-body {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.ze-heute-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ze-heute-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ze-heute-value {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--color-primary);
}

.ze-heute-value.ze-heute-main {
  font-size: var(--font-size-2xl);
}

.ze-heute-value.ze-value--muted { color: var(--color-text-muted); }
.ze-heute-value.ze-value--green { color: #22c55e; }

.ze-heute-status { margin-left: auto; }

.ze-heute-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl);
  color: var(--color-text-muted);
}

/* Tabs */
.ze-tabs {
  display: flex;
  gap: var(--space-xs);
  border-bottom: 2px solid var(--color-border);
  margin-bottom: var(--space-lg);
}

.ze-tab {
  background: none;
  border: none;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.ze-tab:hover { color: var(--color-primary); }

.ze-tab--active {
  color: var(--color-secondary);
  border-bottom-color: var(--color-secondary);
}

.ze-tab-content { display: none; }
.ze-tab-content--active { display: block; }

/* Tabelle */
.ze-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.ze-table th {
  background: var(--color-bg);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-weight: 600;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
}

.ze-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.ze-table tr:last-child td { border-bottom: none; }
.ze-table tr:hover td { background: #f8fafa; }

.ze-row--warning td { background: #fffbeb; }
.ze-row--warning:hover td { background: #fef9c3; }

/* Badges */
.ze-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.ze-badge--green  { background: #dcfce7; color: #166534; }
.ze-badge--gray   { background: #f1f5f9; color: #64748b; }
.ze-badge--orange { background: #fef3c7; color: #92400e; }

/* Inline Edit */
.ze-inline-edit {
  border-bottom: 1px dashed var(--color-border);
  padding-bottom: 1px;
  transition: border-color var(--transition-fast);
}
.ze-inline-edit:hover { border-color: var(--color-secondary); }

.ze-inline-input {
  border: 1px solid var(--color-secondary);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: var(--font-size-sm);
  outline: none;
  width: 100%;
  max-width: 120px;
}

.ze-note.ze-inline-input { max-width: 220px; }

/* Pager */
.ze-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Hint */
.ze-hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
  font-style: italic;
}

/* Admin-Korrektur Modal */
.ze-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.ze-modal {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
}

.ze-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.ze-modal-header h3 {
  font-size: var(--font-size-lg);
  color: var(--color-primary);
}

.ze-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: var(--space-xs);
}
.ze-modal-close:hover { color: var(--color-primary); }
.ze-modal-close i { width: 18px; height: 18px; }

.ze-modal-body {
  padding: var(--space-lg);
}

.ze-modal-body .form-group {
  margin-bottom: var(--space-md);
}

.ze-modal-body label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.ze-modal-body .form-input,
.ze-modal-body input[type="number"],
.ze-modal-body input[type="text"],
.ze-modal-body input[type="datetime-local"] {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  outline: none;
}

.ze-modal-body .form-input:focus,
.ze-modal-body input[type="number"]:focus,
.ze-modal-body input[type="text"]:focus,
.ze-modal-body input[type="datetime-local"]:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(12, 44, 66, 0.12);
}

.ze-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
}

/* Admin-Edit-Button */
.btn-xs {
  padding: 2px 6px;
  font-size: var(--font-size-xs);
}
.btn-xs i { width: 12px; height: 12px; }

/* ============================================
   Wochenbericht
   ============================================ */
.ze-bericht-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.ze-bericht-range {
  font-weight: 500;
  color: var(--color-text);
}
.ze-bericht-table th,
.ze-bericht-table td {
  text-align: center;
  min-width: 80px;
}
.ze-bericht-table th:first-child,
.ze-bericht-table td:first-child {
  text-align: left;
  min-width: 150px;
}
.ze-bericht-table th small {
  font-weight: 400;
  color: var(--color-text-muted);
}
.ze-cell--warning {
  background: #fff7ed;
}

/* ============================================
   Zeiterfassung Widget – Pause & Ausstempel-Dialog
   ============================================ */

/* Orange Status-Dot für Pause */
.ze-status-dot--orange {
  background: #f59e0b;
}

/* Pause-Widget */
.ze-widget--pause .ze-widget-time--pause {
  color: #f59e0b;
}

/* Zwei-Knopf-Reihe im Widget */
.ze-widget-actions {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

/* Pause-Starten Button */
.ze-pause-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  padding: 5px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-size-xs);
  font-weight: 500;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s;
}
.ze-pause-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
}
.ze-pause-btn i { width: 12px; height: 12px; }

/* Ausstempeln-Button (kompakt wenn neben Pause-Btn) */
.ze-widget-actions .ze-clockout-btn {
  flex: 1;
}

/* Pause beenden Button */
.ze-pause-end-btn {
  width: 100%;
  background: #f59e0b;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: var(--space-xs);
  transition: background 0.15s;
}
.ze-pause-end-btn:hover { background: #d97706; }
.ze-pause-end-btn i { width: 12px; height: 12px; }

/* Angesammelte Pausen-Anzeige */
.ze-widget-pause-hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  display: block;
  margin-bottom: 2px;
}

/* Blocking-Overlay (Vergessen-Dialog) */
.ze-modal-overlay--blocking {
  z-index: 9999;
}

/* ============================================
   NOTIFICATION CENTER
   ============================================ */

.notification-center {
  position: relative;
}

.notification-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.notification-btn:hover {
  background: var(--bg-tertiary, #f0f0f0);
  color: var(--text-primary, #111);
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 1000;
  overflow: hidden;
}

.notification-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  font-weight: 600;
  font-size: 14px;
}

.btn-link {
  border: none;
  background: none;
  color: var(--primary, #0066cc);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

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

.notification-list {
  max-height: 380px;
  overflow-y: auto;
}

.notification-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-secondary, #888);
  font-size: 13px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light, #f0f0f0);
  transition: background 0.1s;
  position: relative;
}

.notification-item:last-child { border-bottom: none; }

.notification-item:hover { background: var(--bg-secondary, #f8f8f8); }

.notification-item.is-unread { background: #f0f6ff; }
.notification-item.is-unread:hover { background: #e6f0ff; }

.notification-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #111);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-message {
  font-size: 12px;
  color: var(--text-secondary, #666);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-time {
  font-size: 11px;
  color: var(--text-tertiary, #999);
  margin-top: 4px;
}

.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0066cc;
  flex-shrink: 0;
  margin-top: 5px;
}

/* ============================================
   Phase 14: Zeiterfassung Erweiterungen
   Urlaub, Monatsabschluss, DATEV
   ============================================ */

/* Badge: Rot (abgelehnt) */
.ze-badge--red { background: #fee2e2; color: #991b1b; }

/* Urlaubskonto-Widget */
.ze-vacation-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: var(--space-md);
}

/* Sektion-Wrapper */
.ze-section {
  padding: var(--space-md) 0;
}

/* Stats-Grid für Monatsabschluss */
.ze-monat-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  margin: var(--space-md) 0;
}

.ze-stat-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
}

.ze-stat-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ze-stat-value {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text);
}

/* ============================================
   MOBILE STYLES (max-width: 768px)
   Phase 15: Mobile-First Redesign
   ============================================ */

@media (max-width: 768px) {

  /* --- Kontaktliste: saubere Cards auf Mobile --- */

  .crm-contacts-table thead {
    display: none;
  }

  .crm-contacts-table,
  .crm-contacts-table tbody {
    display: block;
    width: 100%;
  }

  /* Jede Zeile = Card */
  .crm-contacts-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: var(--space-sm);
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-sm);
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s;
  }

  .crm-contacts-table tr:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
  }

  /* Alle TDs standardmäßig ausblenden */
  .crm-contacts-table td {
    display: none;
    border-bottom: none;
    padding: 0;
  }

  /* td 1: Name — Zeile 1, Spalte 1 */
  .crm-contacts-table td:nth-child(1) {
    display: block;
    grid-column: 1;
    grid-row: 1;
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--color-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* td 2: Telefon + Email — Zeile 2, Spalte 1 */
  .crm-contacts-table td:nth-child(2) {
    display: block;
    grid-column: 1;
    grid-row: 2;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .crm-contacts-table td:nth-child(2) > div {
    display: inline;
  }

  .crm-contacts-table td:nth-child(2) > div + div::before {
    content: ' · ';
    color: var(--color-border);
  }

  /* td 3: Status Badge — Zeile 1, Spalte 2 */
  .crm-contacts-table td:nth-child(3) {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    grid-column: 2;
    grid-row: 1;
  }

  /* td 7: Edit Button — Zeile 2, Spalte 2 */
  .crm-contacts-table td:nth-child(7) {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    grid-column: 2;
    grid-row: 2;
  }

  /* Filter-Bereich auf Mobile: stacked */
  .crm-contacts-filters {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .crm-contacts-filters input,
  .crm-contacts-filters select {
    width: 100%;
    min-height: 44px;
    font-size: var(--font-size-base);
  }

  /* Pipeline-Header auf Mobile */
  .pipeline-header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  /* --- Formulare: Touch-freundlich --- */

  .form-group input,
  .form-group select,
  .form-group textarea,
  .edit-form-group input,
  .edit-form-group select,
  .edit-form-group textarea {
    min-height: 44px;
    font-size: var(--font-size-base);
  }

  /* Buttons: Touch-freundlich */
  .btn {
    min-height: 44px;
    padding: var(--space-sm) var(--space-md);
  }

  /* --- Aktivitäten / Tasks: kompakter --- */

  .crm-task-item {
    flex-direction: column;
    gap: var(--space-sm);
  }

  /* --- Reports: Stack Charts --- */

  .reports-grid {
    grid-template-columns: 1fr;
  }

  /* --- Detail-Panel auf Mobile --- */

  .contact-detail-layout,
  .deal-detail-layout {
    flex-direction: column;
  }

  .contact-detail-sidebar,
  .deal-detail-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  /* --- Kontakt-Modal auf Mobile: Fullscreen Bottom-Sheet --- */

  .contact-modal-content {
    max-width: 100% !important;
    max-height: 95vh !important;
    margin: auto 0 0 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
    width: 100%;
  }

  /* 2-Spalten → 1-Spalte */
  .contact-info-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: var(--space-md);
  }

  /* Tabs scrollbar auf Mobile */
  .contact-modal-content .crm-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .contact-modal-content .crm-tabs::-webkit-scrollbar {
    display: none;
  }

  .contact-modal-content .crm-tab {
    flex-shrink: 0;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
  }

  /* Footer-Buttons: volle Breite gestapelt */
  .contact-modal-content .crm-modal-footer {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .contact-modal-content .crm-modal-footer .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  /* --- Call-Assistent auf Mobile --- */

  /* Header: 2 Reihen — Zeile 1: Kontakt + Timer, Zeile 2: Aktionsbuttons */
  .ca-call-header {
    padding: var(--space-sm) var(--space-md) !important;
    gap: var(--space-sm) !important;
  }

  .ca-call-header .btn {
    font-size: var(--font-size-xs);
    padding: 6px 10px;
    min-height: 36px;
  }

  /* Body: 1 Spalte statt 300px + 1fr */
  .ca-main-grid {
    grid-template-columns: 1fr !important;
    height: calc(100vh - var(--header-height) - var(--active-banner-height, 0px) - 90px) !important;
    grid-template-rows: auto 1fr;
  }

  /* Kontakt-Panel: kompakt, feste Höhe, kein Border-Right */
  .ca-contact-panel {
    border-right: none !important;
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-sm) var(--space-md) !important;
    max-height: 180px;
    overflow-y: auto;
  }

  /* Kontakt-Panel Inhalte komprimieren */
  .ca-contact-panel .ca-contact-avatar {
    width: 40px !important;
    height: 40px !important;
    font-size: var(--font-size-base) !important;
  }

  .ca-contact-panel h3 {
    font-size: var(--font-size-base) !important;
  }

  /* Leitfaden-Panel: füllt Rest */
  .ca-leitfaden-panel {
    min-height: 0;
  }
}

/* ============================================
   GESPRÄCHSFORMULAR IM CALL-ASSISTENTEN
   ============================================ */

/* Kompakteres crm-form im Call-Assistenten Kontext */
.ca-leitfaden-panel .crm-form input,
.ca-leitfaden-panel .crm-form select,
.ca-leitfaden-panel .crm-form textarea {
  padding: 6px 10px;
  font-size: var(--font-size-sm);
}

.ca-leitfaden-panel .crm-form .form-group {
  margin-bottom: var(--space-sm);
}

.ca-leitfaden-panel .crm-form label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: 3px;
  font-weight: 500;
}

.ca-leitfaden-panel .crm-form .form-row {
  gap: var(--space-sm);
}

/* ============================================
   FAB: Floating Action Button (Mobile)
   Phase 15.2
   ============================================ */

.fab-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 200;
  display: none; /* Nur auf Mobile */
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: var(--space-sm);
}

@media (max-width: 768px) {
  .fab-container {
    display: flex;
  }
}

.fab-main {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-secondary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.fab-main:active {
  transform: scale(0.92);
}

.fab-main svg {
  width: 24px;
  height: 24px;
  transition: transform var(--transition-fast);
}

.fab-container.open .fab-main {
  background: var(--color-primary);
}

.fab-container.open .fab-main svg {
  transform: rotate(45deg);
}

.fab-menu {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-sm);
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: all var(--transition-fast);
}

.fab-container.open .fab-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.fab-action {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: white;
  border: none;
  border-radius: var(--radius-full);
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  transition: all var(--transition-fast);
  min-height: 44px;
}

.fab-action:active {
  transform: scale(0.96);
}

.fab-action svg {
  width: 18px;
  height: 18px;
  color: var(--color-secondary);
  flex-shrink: 0;
}

/* Quick-Call: Kontakt-Suche */
.quick-call-results {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-top: var(--space-xs);
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

.quick-call-results.active {
  display: block;
}

.quick-call-result-item {
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
  border-bottom: 1px solid var(--color-border);
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: background var(--transition-fast);
}

.quick-call-result-item:last-child {
  border-bottom: none;
}

.quick-call-result-item:active {
  background: var(--color-bg);
}

.quick-call-selected {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  margin-top: var(--space-xs);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quick-call-selected button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 4px;
}

/* ============================================================
   CALL-ASSISTENT (Phase 17)
   ============================================================ */

/* Search Page Layout */
.ca-search-page {
  max-width: 680px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
}

.ca-search-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.ca-search-title-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.ca-search-title-row h1 {
  margin: 0;
}

.ca-search-icon,
.ca-search-icon svg {
  width: 32px;
  height: 32px;
  color: var(--color-secondary);
  flex-shrink: 0;
}

.ca-search-card {
  padding: var(--space-lg);
}

.ca-search-input-wrap {
  position: relative;
}

.ca-search-icon-sm {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}

.ca-search-icon-sm,
.ca-search-icon-sm svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
}

.ca-search-input {
  padding-left: 40px !important;
  font-size: var(--font-size-lg) !important;
  height: 52px !important;
}

.ca-search-footer {
  text-align: center;
  margin-top: var(--space-xl);
}

/* Contact Results List */
.ca-results-list {
  margin-top: var(--space-md);
}

.ca-results-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  padding: 0 var(--space-xs);
}

.ca-results-loading,
.ca-results-empty {
  color: var(--color-text-muted);
  padding: var(--space-md) var(--space-xs);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.ca-results-error {
  color: var(--color-error);
  padding: var(--space-md) var(--space-xs);
  font-size: var(--font-size-sm);
}

.ca-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-xs);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
}

.ca-result-item:hover {
  background: var(--color-bg);
}

.ca-result-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(91, 178, 172, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: var(--font-size-base);
  color: var(--color-secondary);
}

.ca-result-info {
  flex: 1;
  min-width: 0;
}

.ca-result-name {
  font-weight: 600;
  font-size: var(--font-size-base);
}

.ca-result-meta {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.ca-result-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ca-meta-icon,
.ca-meta-icon svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.ca-result-arrow,
.ca-result-arrow svg {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.ca-spin-sm,
.ca-spin-sm svg {
  width: 14px;
  height: 14px;
}

/* Timer Controls */
.ca-timer-display {
  font-size: var(--font-size-lg);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  min-width: 65px;
  text-align: center;
}

.ca-timer-btn-start {
  background: rgba(34, 197, 94, 0.1) !important;
  color: var(--color-success) !important;
  border-color: var(--color-success) !important;
}

.ca-timer-btn-pause {
  background: rgba(245, 158, 11, 0.1) !important;
  color: var(--color-warning) !important;
  border-color: var(--color-warning) !important;
}

.ca-btn-danger {
  background: var(--color-error) !important;
  border-color: var(--color-error) !important;
  color: #fff !important;
}

.ca-btn-danger:hover {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
}

/* ============================================
   CRM TABLE (shared, used in Angebote etc.)
   ============================================ */

.crm-table {
  width: 100%;
  border-collapse: collapse;
}

.crm-table th {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  background: var(--color-bg);
}

.crm-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--font-size-sm);
  vertical-align: middle;
}

.crm-table tbody tr:last-child td {
  border-bottom: none;
}

.crm-table tbody tr:hover td {
  background: var(--color-bg);
}

.crm-table-footer {
  padding: var(--space-sm) var(--space-md);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  border-top: 1px solid var(--color-border);
}

/* ============================================
   ANGEBOTE / OFFERS
   ============================================ */

/* Filter bar */
.angebote-filter-bar {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  align-items: flex-end;
}

/* Status badges */
.offer-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.offer-badge-draft   { background: #f1f5f9; color: #64748b; }
.offer-badge-sent    { background: #eff6ff; color: #2563eb; }
.offer-badge-accepted{ background: #f0fdf4; color: #16a34a; }
.offer-badge-rejected{ background: #fef2f2; color: #dc2626; }
.offer-badge-expired { background: #fffbeb; color: #d97706; }

/* Detail status row */
.offer-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.offer-status-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.offer-status-meta-text {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.offer-action-btns {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* Info grid in detail */
.offer-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
}

.offer-info-field {}

.offer-info-field label {
  display: block;
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.offer-info-field .field-value {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-primary);
}

.offer-info-field .field-sub {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Section label */
.offer-section-label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

/* Totals */
.offer-totals {
  text-align: right;
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--color-border);
  margin-bottom: var(--space-md);
}

.offer-totals-line {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.offer-totals-total {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-primary);
}

/* Notes block */
.offer-notes {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-secondary);
}

.offer-notes label {
  display: block;
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.offer-notes-text {
  white-space: pre-wrap;
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

/* Product picker cards */
.product-picker-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: white;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.product-picker-card:hover {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 2px var(--color-secondary-light);
}

.product-picker-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
}

.product-picker-cat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-picker-status {
  font-size: 10px;
  font-weight: 600;
}

.product-picker-name {
  font-weight: 600;
  font-size: var(--font-size-sm);
  line-height: 1.3;
}

.product-picker-desc {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-picker-price {
  font-weight: 700;
  color: var(--color-primary);
  font-size: var(--font-size-sm);
  margin-top: auto;
  padding-top: 4px;
}

/* Items empty state */
.offer-items-empty {
  text-align: center;
  padding: var(--space-md);
  color: var(--color-text-muted);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
}

/* Add-product section in form */
.offer-add-product-card {
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.offer-add-product-row {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  align-items: flex-end;
}

/* ============================================
   ANGEBOTE — MOBILE
   ============================================ */

@media (max-width: 768px) {

  /* Filter bar: stack vertically */
  .angebote-filter-bar {
    flex-direction: column;
  }

  /* Table → Card list */
  .crm-table thead {
    display: none;
  }

  .crm-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 2px var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
    background: white;
  }

  .crm-table tbody tr:hover {
    background: var(--color-bg);
  }

  /* Hide all cells by default */
  .crm-table td {
    display: none;
    padding: 0;
    border: none;
  }

  /* Col 1: Angebotsnummer — row 1 col 1 */
  .crm-table td:nth-child(1) {
    display: block;
    grid-column: 1;
    grid-row: 1;
    font-weight: 600;
    font-size: var(--font-size-sm);
  }

  /* Col 2: Kontakt — row 2 col 1 */
  .crm-table td:nth-child(2) {
    display: block;
    grid-column: 1;
    grid-row: 2;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
  }

  /* Col 4: Status badge — row 1 col 2 */
  .crm-table td:nth-child(4) {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    align-items: flex-start;
    justify-content: flex-end;
  }

  /* Col 5: Betrag — row 2 col 2 */
  .crm-table td:nth-child(5) {
    display: flex;
    grid-column: 2;
    grid-row: 2;
    align-items: center;
    justify-content: flex-end;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    text-align: right;
  }

  /* Col 6: Datum — row 3 col 1 */
  .crm-table td:nth-child(6) {
    display: block;
    grid-column: 1;
    grid-row: 3;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
  }

  /* Col 8: Auge-Button — row 3 col 2 */
  .crm-table td:nth-child(8) {
    display: flex;
    grid-column: 2;
    grid-row: 3;
    align-items: center;
    justify-content: flex-end;
  }

  /* Detail modal: bottom-sheet */
  .offer-modal-content {
    margin: auto 0 0 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
    max-height: 95vh !important;
  }

  /* Status row: stack vertically */
  .offer-status-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  /* Action buttons: full width */
  .offer-action-btns {
    width: 100%;
  }

  .offer-action-btns .btn {
    flex: 1;
    justify-content: center;
  }

  /* Form grid: single column */
  .offer-form-grid {
    grid-template-columns: 1fr !important;
  }

  /* Info grid: 2 cols on mobile (already auto-fit but ensure min is smaller) */
  .offer-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Sortable drag ghost */
.sortable-ghost { opacity: 0.35; border: 2px dashed var(--color-secondary) !important; }
