/* ============================================
   Customer Timeline Styles
   Vertikale Lebenszyklus-Timeline fuer Kundendetails
   ============================================ */

/* Timeline Container */
.customer-timeline {
    position: relative;
    padding: 8px 0 8px 0;
}

.customer-timeline-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.customer-timeline-loading {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Vertikale Linie */
.customer-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

/* Einzelner Timeline-Event */
.tl-event {
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 0 0 24px 52px;
    min-height: 48px;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.tl-event:last-child {
    padding-bottom: 0;
}

.tl-event:hover {
    opacity: 0.85;
}

/* Kreis auf der Linie */
.tl-dot {
    position: absolute;
    left: 12px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    z-index: 1;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tl-event:hover .tl-dot {
    transform: scale(1.15);
    box-shadow: 0 0 0 3px rgba(200, 149, 108, 0.2);
}

/* Status-Farben fuer den Dot */
.tl-dot--abgeschlossen {
    border-color: var(--color-success, #22c55e);
    background: rgba(34, 197, 94, 0.15);
}

.tl-dot--offen {
    border-color: var(--warning-color, #FFA726);
    background: rgba(255, 167, 38, 0.15);
}

.tl-dot--ueberfaellig {
    border-color: var(--color-error, #ef4444);
    background: rgba(239, 68, 68, 0.15);
}

.tl-dot--geplant {
    border-color: var(--text-muted, #8aacac);
    background: rgba(138, 172, 172, 0.1);
}

/* Event Content */
.tl-content {
    flex: 1;
    min-width: 0;
}

.tl-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tl-datum {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 70px;
}

.tl-typ-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Typ-Farben */
.tl-typ-badge--anfrage {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.tl-typ-badge--angebot {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.tl-typ-badge--auftrag {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
}

.tl-typ-badge--rechnung {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.tl-typ-badge--mahnung {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.tl-typ-badge--bezahlt {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.tl-titel {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 4px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tl-betrag {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}

.tl-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Lifecycle Progress Bar */
.tl-lifecycle-bar {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm, 8px);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.tl-lifecycle-step {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    min-width: 0;
}

.tl-lifecycle-label {
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.tl-lifecycle-label--active {
    background: var(--accent-primary-light, rgba(200, 149, 108, 0.12));
    color: var(--accent-primary, #c8956c);
    font-weight: 600;
}

.tl-lifecycle-label--completed {
    background: rgba(34, 197, 94, 0.15);
    color: var(--color-success, #22c55e);
}

.tl-lifecycle-label--inactive {
    color: var(--text-muted);
    opacity: 0.5;
}

.tl-lifecycle-connector {
    flex: 1;
    height: 2px;
    min-width: 12px;
    background: var(--border-color);
    margin: 0 4px;
}

.tl-lifecycle-connector--completed {
    background: var(--color-success, #22c55e);
}

/* ============================================
   Visual Pipeline Timeline (Quick Win 5)
   ============================================ */

/* Pipeline Row */
.timeline-pipeline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 16px 16px;
    position: relative;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm, 8px);
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    overflow-x: auto;
}

.timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    min-width: 72px;
}

.timeline-node-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 3px solid;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-node-circle:hover {
    transform: scale(1.1);
}

.timeline-node-label {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted, #a1a1aa);
    white-space: nowrap;
}

.timeline-node-status {
    font-size: 10px;
    margin-top: 2px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.timeline-connector {
    flex: 1;
    height: 3px;
    background: var(--border-color, #374151);
    min-width: 16px;
    margin: 0 -4px;
    margin-top: 24px;
    border-radius: 2px;
}

.timeline-connector.active {
    background: var(--color-success, #22c55e);
}

/* Activity Feed */
.timeline-events {
    margin-top: 0;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.timeline-events-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #a1a1aa);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 0 8px 0;
}

.timeline-event {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-subtle-alpha, rgba(30, 58, 74, 0.15));
    color: var(--text-primary, #e4e4e7);
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.timeline-event:hover {
    background: rgba(200, 149, 108, 0.08);
}

.timeline-event:last-child {
    border-bottom: none;
}

.timeline-event-icon {
    font-size: 16px;
    min-width: 24px;
    text-align: center;
}

.timeline-event-date {
    color: var(--text-muted, #a1a1aa);
    min-width: 80px;
    font-size: 12px;
    white-space: nowrap;
}

.timeline-event-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-event-status {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
}

.timeline-event-betrag {
    color: var(--accent-primary, #c8956c);
    font-weight: 600;
    margin-left: auto;
    white-space: nowrap;
}

/* Summary Bar */
.timeline-summary {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm, 8px);
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.timeline-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.timeline-summary-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #e4e4e7);
}

.timeline-summary-label {
    font-size: 11px;
    color: var(--text-muted, #a1a1aa);
    margin-top: 2px;
}

/* ============================================
   Responsive: Mobile
   ============================================ */
@media (max-width: 600px) {
    .customer-timeline::before {
        left: 14px;
    }

    .tl-event {
        padding-left: 40px;
        padding-bottom: 18px;
    }

    .tl-dot {
        left: 6px;
        width: 16px;
        height: 16px;
        font-size: 8px;
    }

    .tl-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .tl-lifecycle-bar {
        padding: 8px 10px;
    }

    .tl-lifecycle-label {
        font-size: 10px;
        padding: 2px 4px;
    }

    .tl-titel {
        font-size: 12px;
    }

    /* Pipeline Mobile */
    .timeline-pipeline {
        padding: 16px 8px 12px;
        gap: 0;
    }

    .timeline-node {
        min-width: 56px;
    }

    .timeline-node-circle {
        width: 36px;
        height: 36px;
        font-size: 16px;
        border-width: 2px;
    }

    .timeline-node-label {
        font-size: 10px;
    }

    .timeline-connector {
        margin-top: 18px;
        min-width: 8px;
    }

    .timeline-event {
        gap: 8px;
        padding: 8px 4px;
        font-size: 12px;
    }

    .timeline-event-date {
        min-width: 64px;
        font-size: 11px;
    }

    .timeline-summary {
        gap: 8px;
        padding: 8px 10px;
    }

    .timeline-summary-value {
        font-size: 15px;
    }
}
