/**
 * EE Activity Panel Styles
 *
 * v2.11.0 (Stufen 8+9):
 *  - Quick-Add raus, neue Add-Buttons-Reihe (4 Type-Quickbuttons)
 *  - Hover-Actions auf Cards (Edit / Delete)
 *  - Neue Meta-Items: Mood-Emoji, Direction-Pfeil, Files-Count, Kontakt
 *  - Titel-Zeile (faerbt sich nach Type)
 *
 * Design-Tokens (analog zu ee-organization-styles.css):
 *  - Primary green: var(--primary-color, #2d7a3e)
 *  - Card radius: 12px
 *
 * Breakpoints: 768 / 1024 / 1440
 *
 * @package energyExperts
 * @since v2.11.0
 */

/* =========================================================
 * Container
 * ========================================================= */
.ee-activity-panel {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 360px;
}

/* =========================================================
 * Header
 * ========================================================= */
.ee-act-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid #eef0f3;
    background: linear-gradient(180deg, #f8faf9 0%, #ffffff 100%);
}

.ee-act-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.ee-act-title-text {
    font-size: 14px;
    font-weight: 600;
    color: #1f2933;
}

.ee-act-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #e8eef0;
    color: #4a5568;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.ee-act-score {
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1.4;
}

.ee-act-score-num { font-size: 12px; }
.ee-act-score-unit { font-size: 10px; opacity: 0.85; }

.ee-act-score.is-good { background: #dcfce7; color: #166534; }
.ee-act-score.is-mid  { background: #fef9c3; color: #854d0e; }
.ee-act-score.is-low  { background: #fee2e2; color: #991b1b; }

.ee-act-header-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.ee-act-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.ee-act-icon-btn:hover:not(:disabled) {
    background: #eef2f7;
    color: #1f2933;
}
.ee-act-icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.ee-act-icon-btn svg {
    width: 16px;
    height: 16px;
}

/* =========================================================
 * Unified Icon Bar — all tabs equal, no separator
 * ========================================================= */
.ee-act-icon-bar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    background: #f8faf9;
    border-bottom: 1px solid #eef0f3;
}

/* Icon tab buttons (all unified) */
.ee-act-icon-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1.5px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}
.ee-act-icon-tab:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #374151;
}
.ee-act-icon-tab.is-active {
    background: #ffffff;
    color: var(--primary-color, #2d7a3e);
    border-color: var(--primary-color, #2d7a3e);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.ee-act-icon-tab-svg {
    display: flex;
    width: 18px;
    height: 18px;
}
.ee-act-icon-tab-svg svg {
    width: 100%;
    height: 100%;
}

/* Badge count on icon tabs */
.ee-act-icon-tab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 7px;
    background: #ef4444;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    display: none;
}
.ee-act-icon-tab-badge:empty {
    display: none;
}

/* "+ Neu" button in content area */
.ee-act-content-add {
    display: flex;
    padding: 8px 12px;
    border-bottom: 1px solid #eef0f3;
    background: #fdfdfd;
}
.ee-act-content-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: none;
    border-radius: 8px;
    background: var(--primary-color, #2d7a3e);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: inherit;
}
.ee-act-content-add-btn:hover {
    background: #245f31;
}
.ee-act-content-add-btn svg {
    width: 14px;
    height: 14px;
}

/* =========================================================
 * Tabs (Filter Chips) — compact
 * ========================================================= */
.ee-act-tabs {
    display: flex;
    gap: 3px;
    padding: 5px 12px;
    overflow-x: auto;
    scrollbar-width: thin;
    border-bottom: 1px solid #eef0f3;
    background: #fdfdfd;
}
.ee-act-tabs::-webkit-scrollbar { height: 3px; }
.ee-act-tabs::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

.ee-act-tab {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #4b5563;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ee-act-tab:hover {
    background: #f3f4f6;
    color: #1f2933;
}
.ee-act-tab.is-active {
    background: var(--primary-color, #2d7a3e);
    color: #ffffff;
    border-color: var(--primary-color, #2d7a3e);
}

.ee-act-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.08);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}
.ee-act-tab.is-active .ee-act-tab-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* =========================================================
 * Timeline
 * ========================================================= */
.ee-act-timeline {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 6px 10px 10px;
    background: #fafbfc;
    min-height: 120px;
}

.ee-act-loading,
.ee-act-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 16px;
    color: #6b7280;
    font-size: 13px;
}

.ee-act-empty-icon {
    width: 40px;
    height: 40px;
    color: #cbd5e1;
    margin-bottom: 8px;
}
.ee-act-empty-icon svg { width: 100%; height: 100%; }

.ee-act-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 4px;
}
.ee-act-empty-text {
    font-size: 12px;
    line-height: 1.4;
    max-width: 240px;
}

/* Group (Datum-Header) */
.ee-act-group + .ee-act-group { margin-top: 8px; }

.ee-act-group-header {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 4px 6px;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6b7280;
    background: #fafbfc;
}

.ee-act-group-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* =========================================================
 * Activity Card (mit Hover-Actions, Stufe 9)
 * ========================================================= */
.ee-act-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: #ffffff;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.ee-act-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.ee-act-card-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eef2f7;
    color: #6b7280;
}
.ee-act-card-icon svg { width: 14px; height: 14px; }

.ee-act-card.is-phone   .ee-act-card-icon { background: #dbeafe; color: #1e40af; }
.ee-act-card.is-meeting .ee-act-card-icon { background: #dcfce7; color: #166534; }
.ee-act-card.is-email   .ee-act-card-icon { background: #ede9fe; color: #6d28d9; }
.ee-act-card.is-other   .ee-act-card-icon { background: #e2e8f0; color: #475569; }
.ee-act-card.is-handover .ee-act-card-icon { background: #fed7aa; color: #9a3412; }
.ee-act-card.is-lost    .ee-act-card-icon { background: #fee2e2; color: #991b1b; }
.ee-act-card.is-ai      .ee-act-card-icon { background: #fef3c7; color: #854d0e; }

.ee-act-card-body {
    flex: 1 1 auto;
    min-width: 0;
}

.ee-act-card-head {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    font-size: 11px;
    color: #6b7280;
}

.ee-act-card-author {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color, #2d7a3e);
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.ee-act-card-type {
    font-weight: 600;
    color: #1f2933;
}

.ee-act-card-mood {
    font-size: 14px;
    line-height: 1;
}

.ee-act-card-time {
    margin-left: auto;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

.ee-act-source-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.ee-act-source-badge.is-sipgate { background: #ede9fe; color: #5b21b6; }
.ee-act-source-badge.is-outlook { background: #dbeafe; color: #1e40af; }
.ee-act-source-badge.is-system  { background: #e2e8f0; color: #475569; }

/* Title (neu, v2.11.0) */
.ee-act-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2933;
    margin-bottom: 2px;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ee-act-card-content {
    font-size: 13px;
    line-height: 1.45;
    color: #374151;
    word-wrap: break-word;
    overflow-wrap: break-word;
    /* Truncate auf 3 Zeilen in der Liste */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ee-act-card-content p { margin: 0 0 4px; }
.ee-act-card-content p:last-child { margin-bottom: 0; }
.ee-act-card-content a {
    color: var(--primary-color, #2d7a3e);
    text-decoration: underline;
}

.ee-act-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    font-size: 11px;
    color: #6b7280;
}

.ee-act-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    line-height: 1.4;
}
.ee-act-meta-item svg {
    width: 11px;
    height: 11px;
}

.ee-act-meta-direction.is-inbound  { background: #dcfce7; color: #166534; }
.ee-act-meta-direction.is-outbound { background: #dbeafe; color: #1e40af; }
.ee-act-meta-files                  { background: #fef3c7; color: #854d0e; }
.ee-act-meta-contact                { background: #e0f2fe; color: #075985; }
.ee-act-meta-followup               { background: #fde68a; color: #92400e; }

/* =========================================================
 * Hover-Actions (Stufe 9)
 * ========================================================= */
.ee-act-card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.ee-act-card:hover .ee-act-card-actions {
    opacity: 1;
    pointer-events: auto;
}
.ee-act-card:focus-within .ee-act-card-actions {
    opacity: 1;
    pointer-events: auto;
}

.ee-act-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.ee-act-card-action svg {
    width: 12px;
    height: 12px;
}
.ee-act-card-action.is-edit:hover {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}
.ee-act-card-action.is-delete:hover {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

/* =========================================================
 * Responsive (768 / 1024 / 1440)
 * ========================================================= */
@media (max-width: 1024px) {
    .ee-act-header { padding: 8px 10px; }
    .ee-act-icon-tab { width: 30px; height: 30px; }
    .ee-act-icon-tab-svg { width: 15px; height: 15px; }
}

@media (max-width: 768px) {
    .ee-activity-panel { min-height: 240px; }
    .ee-act-header-title { gap: 4px; }
    .ee-act-title-text { font-size: 12px; }
    .ee-act-card-time { font-size: 10px; }
    /* Auf Mobile sind Hover-Actions immer sichtbar */
    .ee-act-card-actions {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (min-width: 1440px) {
    .ee-act-card { padding: 12px 14px; }
    .ee-act-card-icon { width: 32px; height: 32px; }
    .ee-act-card-icon svg { width: 16px; height: 16px; }
}

/* =========================================================
 * Top-Level Tabs (Aktivitaeten / Aufgaben / Notizen / Uebergabe)
 * ========================================================= */
/* Old .ee-panel-top-tab styles removed — replaced by .ee-act-icon-tab in icon bar */

.ee-act-top-tab-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* =========================================================
 * TasksNotes Host (embedded widget)
 * ========================================================= */
.ee-panel-tn-host {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0;
    min-height: 200px;
}

/* =========================================================
 * Tasks/Notes Tab Styles (nutzt ee-tn-popup fuer CRUD)
 * ========================================================= */
.ee-panel-tn-tab {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    overflow: hidden;
}

.ee-panel-tn-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #eef0f3;
    background: #fdfdfd;
}

.ee-panel-tn-filters {
    display: flex;
    gap: 4px;
}
.ee-panel-task-filter {
    padding: 3px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    color: #4b5563;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.ee-panel-task-filter:hover {
    background: #f3f4f6;
}
.ee-panel-task-filter.is-active {
    background: var(--primary-color, #2d7a3e);
    color: #ffffff;
    border-color: var(--primary-color, #2d7a3e);
}

.ee-panel-tn-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.ee-panel-tn-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: none;
    border-radius: 8px;
    background: var(--primary-color, #2d7a3e);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.ee-panel-tn-add-btn:hover {
    background: #245f31;
}
.ee-panel-tn-add-btn svg {
    width: 14px;
    height: 14px;
}

.ee-panel-tn-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
}
.ee-panel-tn-expand-btn:hover {
    background: #f3f4f6;
    color: var(--primary-color, #2d7a3e);
}
.ee-panel-tn-expand-btn svg {
    width: 14px;
    height: 14px;
}

.ee-panel-tn-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 6px 12px;
    background: #fafbfc;
}

.ee-panel-tn-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #ffffff;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: box-shadow 0.15s ease;
    cursor: pointer;
}
.ee-panel-tn-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    border-color: #d1d5db;
}
.ee-panel-tn-item.is-done {
    opacity: 0.55;
}
.ee-panel-tn-item.is-done .ee-panel-tn-title {
    text-decoration: line-through;
    color: #94a3b8;
}

.ee-panel-tn-check {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    color: #6b7280;
    transition: color 0.15s ease;
}
.ee-panel-tn-check:hover {
    color: var(--primary-color, #2d7a3e);
}

.ee-panel-tn-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    color: #1f2933;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ee-panel-tn-title:hover {
    color: var(--primary-color, #2d7a3e);
}

.ee-panel-tn-due {
    flex-shrink: 0;
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
}
.ee-panel-tn-due.is-overdue {
    color: #dc2626;
    font-weight: 600;
}

/* =========================================================
 * Handover Tab — Action Buttons
 * ========================================================= */
.ee-handover-actions {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #eef0f3;
}
.ee-handover-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.ee-handover-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.ee-handover-btn:hover {
    background: #ede9fe;
    border-color: #c4b5fd;
    color: #6d28d9;
}
.ee-handover-btn.is-lost {
    color: #991b1b;
}
.ee-handover-btn.is-lost:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}
.ee-handover-btn.is-ai {
    color: #7c3aed;
}
.ee-handover-btn.is-ai:hover {
    background: #ede9fe;
    border-color: #c4b5fd;
    color: #6d28d9;
}

/* =========================================================
 * Icon Bar Responsive
 * ========================================================= */
@media (max-width: 768px) {
    .ee-act-icon-tab { width: 30px; height: 30px; }
    .ee-act-icon-tab-svg { width: 15px; height: 15px; }
    .ee-act-icon-bar { padding: 4px 6px; }
}

/* =========================================================
 * Follow-up Pill (Schritt 6 — Panel + Hub shared)
 * ========================================================= */
.ee-act-followup-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
    white-space: nowrap;
    transition: opacity 0.15s ease, box-shadow 0.15s ease;
}
.ee-act-followup-pill:hover {
    opacity: 0.9;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.ee-act-followup-pill.is-upcoming { background: #e8f5e9; color: #2e7d32; }
.ee-act-followup-pill.is-soon     { background: #fff3e0; color: #e65100; }
.ee-act-followup-pill.is-overdue  { background: #ffebee; color: #c62828; }
.ee-act-followup-pill.is-none     { background: #f5f5f5; color: #9e9e9e; }

.ee-act-followup-pill-icon {
    font-size: 13px;
    line-height: 1;
}
.ee-act-followup-pill-date {
    font-weight: 600;
}
.ee-act-followup-pill-cd {
    font-weight: 400;
    opacity: 0.85;
    font-size: 11px;
}

@media (max-width: 500px) {
    .ee-act-followup-pill-cd {
        display: none;
    }
}

/* AI Summary trigger button in panel header */
.ee-act-ai-btn {
    color: #7c3aed !important;
}
.ee-act-ai-btn:hover {
    background: #f5f3ff !important;
    color: #6d28d9 !important;
}
.ee-act-ai-btn.is-loading {
    opacity: 0.6;
    cursor: not-allowed;
}
.ee-act-ai-btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================================
 * KI-Aufgabenvorschlaege (Stufe 2: AI-Task Suggestions)
 * ============================================================ */

/* "Aufgabe erstellen"-Button auf Activity-Cards */
.ee-act-ai-task-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid #ddd6fe;
    border-radius: 6px;
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    color: #7c3aed;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    margin-left: auto;
    white-space: nowrap;
}
.ee-act-ai-task-btn:hover {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    border-color: #c4b5fd;
    box-shadow: 0 1px 3px rgba(124, 58, 237, 0.15);
}
.ee-act-ai-task-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}
.ee-act-ai-task-btn svg {
    width: 13px;
    height: 13px;
}
.ee-act-ai-task-btn span {
    line-height: 1;
}

/* Spinner fuer Loading-States */
.ee-act-ai-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #c4b5fd;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: eeAiSpin 0.6s linear infinite;
}
@keyframes eeAiSpin {
    to { transform: rotate(360deg); }
}

/* Vorschlags-Container unter einer Activity-Card */
.ee-act-ai-suggestions {
    margin: 0 0 8px 0;
    padding: 10px;
    background: linear-gradient(135deg, #faf5ff, #f5f3ff);
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    animation: eeAiSuggestionsIn 0.25s ease-out;
}
.ee-act-ai-suggestions.is-closing {
    animation: eeAiSuggestionsOut 0.2s ease-in forwards;
}
@keyframes eeAiSuggestionsIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes eeAiSuggestionsOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-8px); }
}

.ee-act-ai-sugg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e9e5f5;
}
.ee-act-ai-sugg-header-title {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #6d28d9;
}
.ee-act-ai-sugg-header-title svg {
    width: 14px;
    height: 14px;
}
.ee-act-ai-sugg-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.ee-act-ai-sugg-close:hover {
    color: #6b7280;
}

/* Einzelne Vorschlags-Card */
.ee-act-ai-suggestion-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 6px;
    transition: all 0.3s ease;
}
.ee-act-ai-suggestion-card:last-child {
    margin-bottom: 0;
}
.ee-act-ai-suggestion-card.is-accepted {
    background: #ecfdf5;
    border-color: #6ee7b7;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.4s ease;
}
.ee-act-ai-suggestion-card.is-rejected {
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.25s ease;
}

.ee-act-ai-sugg-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.ee-act-ai-sugg-title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}
.ee-act-ai-sugg-conf {
    font-size: 10px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 10px;
    white-space: nowrap;
}
.ee-act-ai-sugg-conf.is-high { background: #dcfce7; color: #166534; }
.ee-act-ai-sugg-conf.is-mid  { background: #fef3c7; color: #92400e; }
.ee-act-ai-sugg-conf.is-low  { background: #fee2e2; color: #991b1b; }

.ee-act-ai-sugg-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 4px;
}
.ee-act-ai-sugg-slug {
    padding: 1px 6px;
    background: #f3f4f6;
    border-radius: 4px;
    font-weight: 500;
}
.ee-act-ai-sugg-desc {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.4;
    margin-bottom: 8px;
}

/* Aktions-Buttons */
.ee-act-ai-sugg-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.ee-act-ai-sugg-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    transition: all 0.15s;
}
.ee-act-ai-sugg-btn svg {
    width: 12px;
    height: 12px;
}
.ee-act-ai-sugg-btn.is-accept {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #065f46;
}
.ee-act-ai-sugg-btn.is-accept:hover {
    background: #d1fae5;
}
.ee-act-ai-sugg-btn.is-reject {
    color: #991b1b;
}
.ee-act-ai-sugg-btn.is-reject:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}
.ee-act-ai-sugg-btn.is-edit:hover {
    background: #f5f3ff;
    border-color: #c4b5fd;
    color: #6d28d9;
}
.ee-act-ai-sugg-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Edit-Formular (inline) */
.ee-act-ai-sugg-edit {
    padding-top: 4px;
}
.ee-act-ai-sugg-edit label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 6px;
}
.ee-act-ai-input {
    display: block;
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 12px;
    margin-top: 2px;
    background: #fff;
    color: #1f2937;
    box-sizing: border-box;
}
.ee-act-ai-input:focus {
    outline: none;
    border-color: #a78bfa;
    box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.2);
}
textarea.ee-act-ai-input {
    resize: vertical;
    min-height: 48px;
}
.ee-act-ai-edit-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
}
.ee-act-ai-edit-row label {
    margin-bottom: 6px;
}
select.ee-act-ai-input {
    cursor: pointer;
}

/* =========================================================
 * Dark Mode — Activity Panel
 * Matches ee-activity-modal.css pattern (prefers-color-scheme)
 * ========================================================= */
@media (prefers-color-scheme: dark) {

    /* Container */
    .ee-activity-panel {
        background: #1e293b;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    }

    /* Header */
    .ee-act-header {
        border-bottom-color: #334155;
        background: linear-gradient(180deg, #1e293b 0%, #1e293b 100%);
    }
    .ee-act-title-text {
        color: #e2e8f0;
    }
    .ee-act-count {
        background: #334155;
        color: #cbd5e1;
    }

    /* Icon buttons */
    .ee-act-icon-btn {
        color: #94a3b8;
    }
    .ee-act-icon-btn:hover:not(:disabled) {
        background: #334155;
        color: #e2e8f0;
    }

    /* Icon bar */
    .ee-act-icon-bar {
        background: #1e293b;
        border-bottom-color: #334155;
    }
    .ee-act-icon-tab {
        color: #94a3b8;
    }
    .ee-act-icon-tab:hover {
        background: rgba(255, 255, 255, 0.06);
        color: #cbd5e1;
    }
    .ee-act-icon-tab.is-active {
        background: #0f172a;
        color: var(--primary-color, #4ade80);
        border-color: var(--primary-color, #4ade80);
    }

    /* Content add bar */
    .ee-act-content-add {
        border-bottom-color: #334155;
        background: #1e293b;
    }

    /* Filter tabs */
    .ee-act-tabs {
        border-bottom-color: #334155;
        background: #1e293b;
    }
    .ee-act-tabs::-webkit-scrollbar-thumb { background: #475569; }
    .ee-act-tab {
        border-color: #334155;
        background: #0f172a;
        color: #94a3b8;
    }
    .ee-act-tab:hover {
        background: #1e293b;
        color: #e2e8f0;
    }
    .ee-act-tab.is-active {
        /* primary color stays, text white — OK */
    }
    .ee-act-tab-count {
        background: rgba(255, 255, 255, 0.08);
    }

    /* Timeline */
    .ee-act-timeline {
        background: #0f172a;
    }
    .ee-act-loading,
    .ee-act-empty {
        color: #94a3b8;
    }
    .ee-act-empty-icon {
        color: #475569;
    }
    .ee-act-empty-title {
        color: #cbd5e1;
    }

    /* Group header */
    .ee-act-group-header {
        color: #94a3b8;
        background: #0f172a;
    }

    /* Activity Card */
    .ee-act-card {
        background: #1e293b;
        border-color: #334155;
    }
    .ee-act-card:hover {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        border-color: #475569;
    }
    .ee-act-card-icon {
        background: #334155;
        color: #94a3b8;
    }
    .ee-act-card.is-phone   .ee-act-card-icon { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
    .ee-act-card.is-meeting .ee-act-card-icon { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
    .ee-act-card.is-email   .ee-act-card-icon { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
    .ee-act-card.is-other   .ee-act-card-icon { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
    .ee-act-card.is-handover .ee-act-card-icon { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
    .ee-act-card.is-lost    .ee-act-card-icon { background: rgba(239, 68, 68, 0.15); color: #f87171; }
    .ee-act-card.is-ai      .ee-act-card-icon { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

    .ee-act-card-head {
        color: #94a3b8;
    }
    .ee-act-card-type {
        color: #e2e8f0;
    }
    .ee-act-card-time {
        color: #64748b;
    }

    /* Source badges */
    .ee-act-source-badge.is-sipgate { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
    .ee-act-source-badge.is-outlook { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
    .ee-act-source-badge.is-system  { background: rgba(148, 163, 184, 0.12); color: #94a3b8; }

    /* Card title + content */
    .ee-act-card-title {
        color: #e2e8f0;
    }
    .ee-act-card-content {
        color: #cbd5e1;
    }
    .ee-act-card-content a {
        color: #4ade80;
    }

    /* Meta items */
    .ee-act-card-meta {
        color: #94a3b8;
    }
    .ee-act-meta-item {
        background: #334155;
        color: #cbd5e1;
    }
    .ee-act-meta-direction.is-inbound  { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
    .ee-act-meta-direction.is-outbound { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
    .ee-act-meta-files                  { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
    .ee-act-meta-contact                { background: rgba(56, 189, 248, 0.12); color: #38bdf8; }
    .ee-act-meta-followup               { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }

    /* Hover actions */
    .ee-act-card-action {
        border-color: #475569;
        background: #1e293b;
        color: #94a3b8;
    }
    .ee-act-card-action.is-edit:hover {
        background: rgba(59, 130, 246, 0.15);
        color: #60a5fa;
        border-color: #3b82f6;
    }
    .ee-act-card-action.is-delete:hover {
        background: rgba(239, 68, 68, 0.15);
        color: #f87171;
        border-color: #ef4444;
    }

    /* Follow-up pill — adjust dark-safe colors */
    .ee-act-followup-pill.is-upcoming { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
    .ee-act-followup-pill.is-soon     { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
    .ee-act-followup-pill.is-overdue  { background: rgba(239, 68, 68, 0.15); color: #f87171; }
    .ee-act-followup-pill.is-none     { background: #334155; color: #64748b; }

    /* AI Summary button */
    .ee-act-ai-btn {
        color: #a78bfa !important;
    }
    .ee-act-ai-btn:hover {
        background: rgba(139, 92, 246, 0.12) !important;
        color: #c4b5fd !important;
    }

    /* Score badges — adjust for dark backgrounds */
    .ee-act-score.is-good { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
    .ee-act-score.is-mid  { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
    .ee-act-score.is-low  { background: rgba(239, 68, 68, 0.15); color: #f87171; }

    /* Tasks/Notes panels */
    .ee-panel-tn-header {
        border-bottom-color: #334155;
        background: #1e293b;
    }
    .ee-panel-task-filter {
        border-color: #334155;
        background: #0f172a;
        color: #94a3b8;
    }
    .ee-panel-task-filter:hover {
        background: #1e293b;
    }
    .ee-panel-tn-expand-btn {
        border-color: #475569;
        background: #1e293b;
        color: #94a3b8;
    }
    .ee-panel-tn-expand-btn:hover {
        background: #334155;
        color: #4ade80;
    }

    .ee-panel-tn-list {
        background: #0f172a;
    }
    .ee-panel-tn-item {
        background: #1e293b;
        border-color: #334155;
    }
    .ee-panel-tn-item:hover {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        border-color: #475569;
    }
    .ee-panel-tn-check {
        color: #94a3b8;
    }
    .ee-panel-tn-title {
        color: #e2e8f0;
    }
    .ee-panel-tn-due {
        color: #94a3b8;
    }
    .ee-panel-tn-due.is-overdue {
        color: #f87171;
    }

    /* Handover buttons */
    .ee-handover-btn {
        border-color: #334155;
        background: #0f172a;
        color: #cbd5e1;
    }
    .ee-handover-btn:hover {
        background: rgba(139, 92, 246, 0.1);
        border-color: #7c3aed;
        color: #a78bfa;
    }
    .ee-handover-btn.is-lost {
        color: #f87171;
    }
    .ee-handover-btn.is-lost:hover {
        background: rgba(239, 68, 68, 0.1);
        border-color: #ef4444;
        color: #f87171;
    }
    .ee-handover-btn.is-ai {
        color: #a78bfa;
    }
    .ee-handover-btn.is-ai:hover {
        background: rgba(139, 92, 246, 0.1);
        border-color: #7c3aed;
        color: #c4b5fd;
    }

    /* ---- AI Task Suggestions (Stufe 2) ---- */

    /* "Aufgabe erstellen" button on cards */
    .ee-act-ai-task-btn {
        border-color: #4c1d95;
        background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(99, 102, 241, 0.12));
        color: #a78bfa;
    }
    .ee-act-ai-task-btn:hover {
        background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.2));
        border-color: #6d28d9;
    }

    /* Suggestions container */
    .ee-act-ai-suggestions {
        background: linear-gradient(135deg, rgba(88, 28, 135, 0.12), rgba(79, 70, 229, 0.1));
        border-color: #4c1d95;
    }
    .ee-act-ai-sugg-header {
        border-bottom-color: rgba(139, 92, 246, 0.2);
    }
    .ee-act-ai-sugg-header-title {
        color: #a78bfa;
    }
    .ee-act-ai-sugg-close {
        color: #64748b;
    }
    .ee-act-ai-sugg-close:hover {
        color: #94a3b8;
    }

    /* Suggestion card */
    .ee-act-ai-suggestion-card {
        background: #1e293b;
        border-color: #334155;
    }
    .ee-act-ai-suggestion-card.is-accepted {
        background: rgba(16, 185, 129, 0.1);
        border-color: #10b981;
    }
    .ee-act-ai-sugg-title {
        color: #e2e8f0;
    }
    .ee-act-ai-sugg-meta {
        color: #94a3b8;
    }
    .ee-act-ai-sugg-slug {
        background: #334155;
        color: #cbd5e1;
    }
    .ee-act-ai-sugg-desc {
        color: #94a3b8;
    }

    /* Confidence badges — use semi-transparent in dark */
    .ee-act-ai-sugg-conf.is-high { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
    .ee-act-ai-sugg-conf.is-mid  { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
    .ee-act-ai-sugg-conf.is-low  { background: rgba(239, 68, 68, 0.15); color: #f87171; }

    /* Action buttons */
    .ee-act-ai-sugg-btn {
        border-color: #334155;
        background: #0f172a;
        color: #cbd5e1;
    }
    .ee-act-ai-sugg-btn.is-accept {
        background: rgba(16, 185, 129, 0.1);
        border-color: #10b981;
        color: #4ade80;
    }
    .ee-act-ai-sugg-btn.is-accept:hover {
        background: rgba(16, 185, 129, 0.2);
    }
    .ee-act-ai-sugg-btn.is-reject {
        color: #f87171;
    }
    .ee-act-ai-sugg-btn.is-reject:hover {
        background: rgba(239, 68, 68, 0.1);
        border-color: #ef4444;
    }
    .ee-act-ai-sugg-btn.is-edit:hover {
        background: rgba(139, 92, 246, 0.1);
        border-color: #7c3aed;
        color: #a78bfa;
    }

    /* Edit form (inline) */
    .ee-act-ai-sugg-edit label {
        color: #94a3b8;
    }
    .ee-act-ai-input {
        background: #0f172a;
        border-color: #334155;
        color: #e2e8f0;
    }
    .ee-act-ai-input:focus {
        border-color: #7c3aed;
        box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.25);
    }
}
