/**
 * EnergyExperts Task/Notes System - Styles
 * Liquid Glass Design basierend auf dem bestehenden Widget-Styling
 */

/* ============================================================================
   CSS VARIABLES
   ============================================================================ */

:root {
    --ee-tn-primary: var(--primary-color, #3B82F6);
    --ee-tn-primary-hover: var(--primary-color-70, rgba(59, 130, 246, 0.7));
    --ee-tn-success: #10B981;
    --ee-tn-warning: #F59E0B;
    --ee-tn-danger: #EF4444;
    --ee-tn-info: #3B82F6;

    --ee-tn-bg: rgba(255, 255, 255, 0.1);
    --ee-tn-bg-solid: rgba(255, 255, 255, 0.95);
    --ee-tn-bg-light-dark: rgba(255, 255, 255, 0.2);
    --ee-tn-surface: #F9FAFB;
    --ee-tn-border: rgba(0, 0, 0, 0.2);
    --ee-tn-text: #1F2937;
    --ee-tn-text-muted: #6B7280;
    --ee-tn-text-light: #9CA3AF;
    --ee-tn-text-secondary: #4B5563;

    --ee-tn-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --ee-tn-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --ee-tn-blur: blur(10px);
    --ee-tn-radius: 12px;
    --ee-tn-radius-sm: 8px;
    --ee-tn-radius-lg: 16px;
    --ee-tn-radius-pill: 999px;
    --ee-tn-transition: all 0.2s ease;

    /* Redesign-Tokens: ruhigere Flaechen, dezente Trenner, sanfte Hover */
    --ee-tn-border-soft: rgba(17, 24, 39, 0.08);   /* dezente Trennlinie */
    --ee-tn-border-strong: rgba(17, 24, 39, 0.14);  /* sichtbarer Rahmen */
    --ee-tn-hover: rgba(17, 24, 39, 0.035);          /* subtiler Hover-Untergrund */
    --ee-tn-focus-ring: rgba(59, 130, 246, 0.18);    /* einheitlicher Focus-Ring */
    --ee-tn-accent-soft: rgba(59, 130, 246, 0.10);   /* gedaempfter Akzent-Untergrund */
    /* Spacing-Scale */
    --ee-tn-space-1: 4px;
    --ee-tn-space-2: 8px;
    --ee-tn-space-3: 12px;
    --ee-tn-space-4: 16px;
    --ee-tn-space-5: 20px;
    --ee-tn-space-6: 24px;
}

/* Dark mode override for widget container context */
.ee-widget-container .ee-tn-preview,
.ee-tasks-widget-preview,
.ee-notes-widget-preview {
    --ee-tn-text: #ffffff;
    --ee-tn-text-muted: rgba(255, 255, 255, 0.7);
    --ee-tn-text-light: rgba(255, 255, 255, 0.5);
    --ee-tn-bg: transparent;
    --ee-tn-border: rgba(255, 255, 255, 0.15);
}

/* ============================================================================
   COMMON ELEMENTS
   ============================================================================ */

/* Widget Preview Container */
.ee-tasks-widget-preview,
.ee-notes-widget-preview {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ee-tasks-widget-preview .ee-tn-preview,
.ee-notes-widget-preview .ee-tn-preview {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: transparent;
    border: none;
    padding: 0;
}

.ee-tasks-widget-preview .ee-tn-preview-list,
.ee-notes-widget-preview .ee-tn-preview-list {
    flex: 1;
    overflow-y: auto;
}

.ee-tn-loading,
.ee-tn-empty,
.ee-tn-error {
    padding: 20px;
    text-align: center;
    color: var(--ee-tn-text-muted);
    font-size: 14px;
}

.ee-tn-error {
    color: var(--ee-tn-danger);
}

/* Dark mode adjustments for loading/empty/error states in widget context */
.ee-tasks-widget-preview .ee-tn-loading,
.ee-tasks-widget-preview .ee-tn-empty,
.ee-notes-widget-preview .ee-tn-loading,
.ee-notes-widget-preview .ee-tn-empty {
    color: rgba(255, 255, 255, 0.6);
}

/* Progress Bar */
.ee-tn-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.ee-tn-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--ee-tn-border);
    border-radius: 4px;
    overflow: hidden;
}

.ee-tn-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ee-tn-primary), var(--ee-tn-success));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.ee-tn-progress-text {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    min-width: 30px;
    text-align: right;
}

/* Buttons */
.ee-tn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: var(--ee-tn-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.ee-tn-btn-primary {
    background: var(--ee-tn-primary);
    color: white;
}

.ee-tn-btn-primary:hover {
    background: var(--ee-tn-primary-hover);
    box-shadow: 0 2px 8px -2px rgba(59, 130, 246, 0.5);
}

.ee-tn-btn-secondary {
    background: #fff;
    color: var(--ee-tn-text-secondary);
    border-color: var(--ee-tn-border-strong);
}

.ee-tn-btn-secondary:hover {
    background: var(--ee-tn-hover);
    color: var(--ee-tn-text);
}

.ee-tn-btn-danger {
    background: var(--ee-tn-danger);
    color: white;
}

.ee-tn-btn-danger:hover {
    background: #DC2626;
}

.ee-tn-btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.ee-tn-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status Colors */
.status-not_started { --status-color: var(--ee-tn-text-muted); }
.status-in_progress { --status-color: var(--ee-tn-warning); }
.status-completed { --status-color: var(--ee-tn-success); }

/* Widget context status colors */
.ee-tasks-widget-preview .status-not_started,
.ee-notes-widget-preview .status-not_started { --status-color: rgba(255, 255, 255, 0.5); }
.ee-tasks-widget-preview .status-in_progress,
.ee-notes-widget-preview .status-in_progress { --status-color: #FF9500; }
.ee-tasks-widget-preview .status-completed,
.ee-notes-widget-preview .status-completed { --status-color: #34C759; }

/* ============================================================================
   PREVIEW WIDGET
   ============================================================================ */

.ee-tn-preview {
    background: var(--ee-tn-bg);
    border: 1px solid var(--ee-tn-border);
    border-radius: var(--ee-tn-radius);
    padding: 12px;
    cursor: pointer;
    transition: var(--ee-tn-transition);
}

.ee-tn-preview-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

/* Preview Filter Button (Dashboard Mode) */
.ee-tn-preview-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 28px;
    height: 28px;
    background: var(--ee-tn-bg);
    border: 1px solid var(--ee-tn-border);
    border-radius: var(--ee-tn-border-radius);
    cursor: pointer;
    transition: var(--ee-tn-transition);
    color: var(--ee-tn-text-muted);
    flex-shrink: 0;
}

.ee-tn-preview-filter-btn:hover {
    border-color: var(--ee-tn-primary);
    color: var(--ee-tn-primary);
    background: rgba(37, 99, 235, 0.05);
}

.ee-tn-preview-filter-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 600;
    background: var(--ee-tn-primary);
    color: white;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Preview Filter Popup */
.ee-tn-preview-filter-popup {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    max-width: 280px;
    overflow: hidden;
}

.ee-tn-preview-filter-content {
    padding: 12px;
}

.ee-tn-preview-filter-section {
    margin-bottom: 12px;
}

.ee-tn-preview-filter-section:last-of-type {
    margin-bottom: 8px;
}

.ee-tn-preview-filter-section h5 {
    margin: 0 0 8px 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ee-tn-text-muted);
}

.ee-tn-preview-filter-actions {
    padding-top: 8px;
    border-top: 1px solid var(--ee-tn-border);
    display: flex;
    justify-content: flex-end;
}

.ee-tn-filter-empty {
    font-size: 12px;
    color: var(--ee-tn-text-muted);
    padding: 4px 0;
    font-style: italic;
}

.ee-tn-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--ee-tn-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--ee-tn-transition);
    flex-shrink: 0;
}

.ee-tn-add-btn:hover {
    background: var(--ee-tn-primary-hover);
    transform: scale(1.1);
}

/* Widget context styles for add button */
.ee-tasks-widget-preview .ee-tn-add-btn, .ee-notes-widget-preview .ee-tn-add-btn {
    background: var(--secondary-color, #007AFF);
    box-shadow: 0 2px 8px var(--secondary-color-50);
    z-index: 10;
    position: absolute;
    top: 10px;
    right: 50px;
}

.ee-tasks-widget-preview .ee-tn-add-btn:hover,
.ee-notes-widget-preview .ee-tn-add-btn:hover {
    background: var(--secondary-color, #007AFF);
    box-shadow: 0 2px 8px var(--secondary-color-50);
}

/* Progress bar in widget context */
.ee-tasks-widget-preview .ee-tn-progress-bar,
.ee-notes-widget-preview .ee-tn-progress-bar {
    background: rgba(255, 255, 255, 0.15);
}

.ee-tasks-widget-preview .ee-tn-progress-text,
.ee-notes-widget-preview .ee-tn-progress-text {
    color: rgba(255, 255, 255, 0.9);
}

.ee-tn-preview-list {
    /* Flexible height - controlled by parent widget container */
    flex: 1;
    min-height: 0; /* Important for flexbox overflow */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ee-tn-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    background: rgba(0, 0, 0, 0.16);
    border: 1px solid transparent;
    border-radius: var(--ee-tn-radius-sm);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ee-tn-preview-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.12);
}

.ee-tn-preview-item.overdue {
    border-left: 3px solid var(--ee-tn-danger);
    padding-left: 8px;
}

.ee-tn-preview-item-status {
    color: var(--status-color);
    flex-shrink: 0;
}

.ee-tn-preview-item-content {
    flex: 1;
    min-width: 0;
}

.ee-tn-preview-item-title {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--ee-tn-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ee-tn-preview-item-date {
    display: block;
    font-size: 11px;
    color: var(--ee-tn-text-muted);
}

.ee-tn-preview-item.overdue .ee-tn-preview-item-date {
    color: var(--ee-tn-danger);
}

.ee-tn-preview-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ee-tn-preview-item-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    background: #EF4444;
    color: white;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
    animation: pulse-unread 2s infinite;
}

.ee-tn-preview-item-responsible {
    font-size: 11px;
    color: var(--ee-tn-text-light);
    white-space: nowrap;
}

/* Preview Item Actions */
.ee-tn-preview-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.ee-tn-status-btn,
.ee-tn-delete-btn,
.ee-tn-info-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
    color: var(--ee-tn-text-muted);
}

.ee-tn-status-btn:hover,
.ee-tn-delete-btn:hover,
.ee-tn-info-btn:hover {
    transform: scale(1.1);
}

.ee-tn-status-btn.start {
    background: rgba(16, 185, 129, 0.2);
    color: #10B981;
}

.ee-tn-status-btn.start:hover {
    background: rgba(16, 185, 129, 0.4);
}

.ee-tn-status-btn.complete {
    background: rgba(59, 130, 246, 0.2);
    color: #3B82F6;
}

.ee-tn-status-btn.complete:hover {
    background: rgba(59, 130, 246, 0.4);
}

.ee-tn-status-btn.reset {
    background: rgba(245, 158, 11, 0.2);
    color: #F59E0B;
}

.ee-tn-status-btn.reset:hover {
    background: rgba(245, 158, 11, 0.4);
}

.ee-tn-delete-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.ee-tn-delete-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

.ee-tn-info-btn {
    background: rgba(59, 130, 246, 0.15);
    color: #3B82F6;
}

.ee-tn-info-btn:hover {
    background: rgba(59, 130, 246, 0.3);
}

.ee-tn-status-btn:disabled,
.ee-tn-delete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================================
   BUTTON WIDGET
   ============================================================================ */

.ee-tn-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--ee-tn-bg);
    backdrop-filter: var(--ee-tn-blur);
    border: 1px solid var(--ee-tn-border);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--ee-tn-transition);
}

.ee-tn-button:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: var(--ee-tn-shadow);
}

.ee-tn-button-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ee-tn-text);
}

.ee-tn-button-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--ee-tn-text-muted);
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.ee-tn-button-badge.has-items {
    background: var(--ee-tn-primary);
}

.ee-tn-button-badge.error {
    background: var(--ee-tn-danger);
}

.ee-tn-button-add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--ee-tn-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--ee-tn-transition);
}

.ee-tn-button-add:hover {
    transform: scale(1.1);
}

/* ============================================================================
   KANBAN BOARD
   ============================================================================ */

.ee-tn-kanban {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ee-tn-kanban-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 0 10px;
}

.ee-tn-kanban-add {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--ee-tn-primary);
    color: white;
    border: none;
    border-radius: var(--ee-tn-radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ee-tn-transition);
    white-space: nowrap;
}

.ee-tn-kanban-add:hover {
    background: var(--ee-tn-primary-hover);
    transform: translateY(-1px);
}

/* External Toggle */
.ee-tn-external-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--ee-tn-surface);
    border: 1px solid var(--ee-tn-border);
    border-radius: var(--ee-tn-radius-sm);
    cursor: pointer;
    font-size: 12px;
    color: var(--ee-tn-text-muted);
    transition: var(--ee-tn-transition);
    user-select: none;
}

.ee-tn-external-toggle:hover {
    border-color: #3B82F6;
    color: #3B82F6;
}

.ee-tn-external-toggle input {
    accent-color: #3B82F6;
    cursor: pointer;
}

.ee-tn-external-toggle input:checked + .ee-tn-external-toggle-label {
    color: #3B82F6;
    font-weight: 500;
}

.ee-tn-kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    flex: 1;
    min-height: 0;
}

.ee-tn-kanban-column {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: var(--ee-tn-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Farbige Kopfleiste je Status */
.ee-tn-kanban-column[data-status="not_started"] {
    border-top: 4px solid #6B7280;
}
.ee-tn-kanban-column[data-status="in_progress"] {
    border-top: 4px solid #F59E0B;
}
.ee-tn-kanban-column[data-status="completed"] {
    border-top: 4px solid #10B981;
}

.ee-tn-kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #F3F4F6;
}

/* Status-specific header backgrounds */
.ee-tn-kanban-column[data-status="not_started"] .ee-tn-kanban-column-header {
    background: #F9FAFB;
}
.ee-tn-kanban-column[data-status="in_progress"] .ee-tn-kanban-column-header {
    background: #FFFBEB;
}
.ee-tn-kanban-column[data-status="completed"] .ee-tn-kanban-column-header {
    background: #F0FDF4;
}

.ee-tn-kanban-column-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Status-Icon + Textfarbe je Spalte */
.ee-tn-kanban-column[data-status="not_started"] .ee-tn-kanban-column-title {
    color: #4B5563;
}
.ee-tn-kanban-column[data-status="not_started"] .ee-tn-kanban-column-title::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6B7280;
    flex-shrink: 0;
}
.ee-tn-kanban-column[data-status="in_progress"] .ee-tn-kanban-column-title {
    color: #92400E;
}
.ee-tn-kanban-column[data-status="in_progress"] .ee-tn-kanban-column-title::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #F59E0B;
    flex-shrink: 0;
}
.ee-tn-kanban-column[data-status="completed"] .ee-tn-kanban-column-title {
    color: #065F46;
}
.ee-tn-kanban-column[data-status="completed"] .ee-tn-kanban-column-title::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10B981;
    flex-shrink: 0;
}

.ee-tn-kanban-column-count {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
}

/* Count-Badge Farben je Status */
.ee-tn-kanban-column[data-status="not_started"] .ee-tn-kanban-column-count {
    background: #6B7280;
    color: #ffffff;
}
.ee-tn-kanban-column[data-status="in_progress"] .ee-tn-kanban-column-count {
    background: #F59E0B;
    color: #ffffff;
}
.ee-tn-kanban-column[data-status="completed"] .ee-tn-kanban-column-count {
    background: #10B981;
    color: #ffffff;
}

.ee-tn-kanban-column-items {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100px;
    background: #F9FAFB;
}

.ee-tn-kanban-column-items.drag-over {
    background: rgba(59, 130, 246, 0.1);
}

/* Kanban Card */
.ee-tn-kanban-card {
    background: #ffffff;
    border: 1px solid var(--ee-tn-border-soft);
    border-radius: var(--ee-tn-radius-sm);
    padding: var(--ee-tn-space-3) var(--ee-tn-space-4);
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
    position: relative;
}

.ee-tn-kanban-card:hover {
    box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.18);
    border-color: var(--ee-tn-border-strong);
    transform: translateY(-1px);
}

.ee-tn-kanban-card.dragging {
    opacity: 0.5;
}

.ee-tn-kanban-card.system-task {
    border-left: 3px solid var(--ee-tn-info);
    cursor: default;
}

.ee-tn-kanban-card.overdue {
    border-left: 3px solid var(--ee-tn-danger);
}

.ee-tn-kanban-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.ee-tn-kanban-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ee-tn-text);
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.ee-tn-kanban-card-score {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: var(--ee-tn-primary);
    color: white;
    border-radius: 11px;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.ee-tn-kanban-card-unread-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: #EF4444;
    color: white;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
    animation: pulse-unread 2s infinite;
}

.ee-tn-kanban-card-org {
    font-size: 10px;
    font-weight: 600;
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.09);
    padding: 2px 8px;
    border-radius: var(--ee-tn-radius-pill);
    margin-bottom: 4px;
    display: inline-block;
}

.ee-tn-kanban-card-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--ee-tn-text-muted);
    margin-bottom: 4px;
}

.ee-tn-kanban-card.overdue .ee-tn-kanban-card-date {
    color: var(--ee-tn-danger);
    font-weight: 500;
}

.ee-tn-kanban-card-responsible {
    font-size: 11px;
    color: var(--ee-tn-text-light);
}

.ee-tn-kanban-card-system-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 6px;
    background: var(--ee-tn-info);
    color: white;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.ee-tn-kanban-card-external-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 6px;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Externe Aufgaben (von Externen erstellt) - Blau */
.ee-tn-kanban-card.external-created {
    border-left: 3px solid #3B82F6;
}

/* Kanban Card Action Buttons */
.ee-tn-kanban-card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
}

.ee-tn-kanban-action-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ee-tn-kanban-action-btn.start {
    background: var(--ee-tn-success);
    color: white;
}

.ee-tn-kanban-action-btn.complete {
    background: var(--ee-tn-success);
    color: white;
}

.ee-tn-kanban-action-btn.restore {
    background: var(--ee-tn-warning);
    color: white;
}

.ee-tn-kanban-action-btn:hover {
    transform: scale(1.1);
}

.ee-tn-kanban-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Hide system/external badge when actions visible */
.ee-tn-kanban-card:hover .ee-tn-kanban-card-system-badge,
.ee-tn-kanban-card:hover .ee-tn-kanban-card-external-badge {
    opacity: 0;
}

/* ============================================================================
   LIST VIEW
   ============================================================================ */

.ee-tn-list {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ee-tn-list-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 16px;
    padding: 0 10px;
}

/* Notes header: elements right-aligned */
.ee-tn-list-header-notes {
    justify-content: flex-end;
}

.ee-tn-list-add {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--ee-tn-primary);
    color: white;
    border: none;
    border-radius: var(--ee-tn-radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ee-tn-transition);
    white-space: nowrap;
}

.ee-tn-list-add:hover {
    background: var(--ee-tn-primary-hover);
    transform: translateY(-1px);
}

.ee-tn-list-items {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--ee-tn-space-1);
}

.ee-tn-list-item {
    display: flex;
    align-items: center;
    gap: var(--ee-tn-space-3);
    padding: var(--ee-tn-space-3) var(--ee-tn-space-4);
    background: var(--ee-tn-bg-solid);
    border: 1px solid transparent;
    border-bottom: 1px solid var(--ee-tn-border-soft);
    border-radius: var(--ee-tn-radius-sm);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.ee-tn-list-item:hover {
    background: var(--ee-tn-hover);
    border-color: var(--ee-tn-border-soft);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ee-tn-list-item.overdue {
    border-left: 3px solid var(--ee-tn-danger);
    padding-left: calc(var(--ee-tn-space-4) - 3px);
}

.ee-tn-list-item-status {
    color: var(--status-color);
    flex-shrink: 0;
    height: 14px;
}

/* Info button for explanation in list */
.ee-tn-list-info-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #3B82F6;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.ee-tn-list-info-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.1);
}

.ee-tn-list-info-btn svg {
    width: 16px;
    height: 16px;
}

.ee-tn-list-item-content {
    flex: 1;
    min-width: 0;
}

.ee-tn-list-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ee-tn-text);
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.ee-tn-list-item-desc {
    font-size: 12px;
    color: var(--ee-tn-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ee-tn-list-item-meta {
    display: flex;
    align-items: center;
    gap: var(--ee-tn-space-2);
    flex-shrink: 0;
}

.ee-tn-list-item-date {
    font-size: 11px;
    font-weight: 500;
    color: var(--ee-tn-text-light);
    white-space: nowrap;
}

.ee-tn-list-item.overdue .ee-tn-list-item-date {
    color: var(--ee-tn-danger);
    font-weight: 500;
}

.ee-tn-list-item-responsible {
    font-size: 11px;
    color: var(--ee-tn-text-light);
}

.ee-tn-list-item-comments {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    background: var(--ee-tn-hover);
    color: var(--ee-tn-text-muted);
    border: 1px solid var(--ee-tn-border-soft);
    border-radius: var(--ee-tn-radius-pill);
    font-size: 10px;
    font-weight: 600;
}

/* Private icon for notes */
.ee-tn-list-item-private {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ee-tn-warning, #f59e0b);
    margin-right: 8px;
    flex-shrink: 0;
}

.ee-tn-list-item.private {
    border-left: 3px solid var(--ee-tn-warning, #f59e0b);
    padding-left: calc(var(--ee-tn-space-4) - 3px);
}

/* ============================================================================
   List Category (for notes internal/external)
   ============================================================================ */

.ee-tn-list-category {
    margin-bottom: 16px;
}

.ee-tn-list-category:last-child {
    margin-bottom: 0;
}

.ee-tn-list-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--ee-tn-bg-secondary, #f8f9fa);
    border-radius: 8px;
    margin-bottom: 8px;
}

.ee-tn-list-category-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--ee-tn-text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ee-tn-list-category-count {
    font-size: 11px;
    font-weight: 600;
    color: white;
    background: var(--ee-tn-text-muted, #6b7280);
    padding: 2px 8px;
    border-radius: 10px;
}

.ee-tn-list-category.internal .ee-tn-list-category-header {
    background: linear-gradient(to right, rgba(59, 130, 246, 0.1), transparent);
}

.ee-tn-list-category.internal .ee-tn-list-category-count {
    background: var(--ee-tn-primary, #3b82f6);
}

.ee-tn-list-category.external .ee-tn-list-category-header {
    background: linear-gradient(to right, rgba(34, 197, 94, 0.1), transparent);
}

.ee-tn-list-category.external .ee-tn-list-category-count {
    background: var(--ee-tn-success, #22c55e);
}

.ee-tn-list-category-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ============================================================================
   POPUP
   ============================================================================ */

.ee-tn-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100300;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ee-tn-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ee-tn-popup-container {
    background: var(--ee-tn-bg-solid);
    border-radius: var(--ee-tn-radius);
    box-shadow: var(--ee-tn-shadow-lg);
    width: 90%;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.ee-tn-popup-overlay.active .ee-tn-popup-container {
    transform: translateY(0);
}

.ee-tn-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--ee-tn-space-4) var(--ee-tn-space-5);
    border-bottom: 1px solid var(--ee-tn-border-soft);
}

.ee-tn-popup-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ee-tn-text);
    letter-spacing: -0.01em;
    margin: 0;
    padding: 0;
}

.ee-tn-popup-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: 50%;
    color: var(--ee-tn-text-muted);
    cursor: pointer;
    transition: var(--ee-tn-transition);
}

.ee-tn-popup-close:hover {
    background: var(--ee-tn-hover);
    color: var(--ee-tn-text);
}

.ee-tn-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ee-tn-popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: var(--ee-tn-space-4) var(--ee-tn-space-5);
    border-top: 1px solid var(--ee-tn-border-soft);
    background: var(--ee-tn-surface);
}

.ee-tn-popup-footer-left {
    display: flex;
    gap: 8px;
}

.ee-tn-popup-footer-right {
    display: flex;
    gap: 8px;
}

.ee-tn-view-only-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--ee-tn-radius-sm);
    font-size: 12px;
    color: #3B82F6;
}

.ee-tn-view-only-hint svg {
    opacity: 0.8;
}

/* Success Button */
.ee-tn-btn-success {
    background: var(--ee-tn-success);
    color: white;
}

.ee-tn-btn-success:hover {
    background: #059669;
    box-shadow: 0 2px 8px -2px rgba(16, 185, 129, 0.5);
}

/* Warning Button */
.ee-tn-btn-warning {
    background: var(--ee-tn-warning);
    color: white;
}

.ee-tn-btn-warning:hover {
    background: #D97706;
    box-shadow: 0 2px 8px -2px rgba(245, 158, 11, 0.5);
}

/* Danger Outline Button (destruktiv = Loeschen) */
.ee-tn-btn-danger-outline {
    background: transparent;
    color: var(--ee-tn-danger);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.ee-tn-btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: var(--ee-tn-danger);
}

body.ee-tn-popup-open {
    overflow: hidden;
}

/* ============================================================================
   FORM
   ============================================================================ */

.ee-tn-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ee-tn-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ee-tn-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: var(--ee-tn-space-4);
}

.ee-tn-form-section .ee-tn-form-group:last-child {
    margin-bottom: 0;
}

.ee-tn-form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ee-tn-text);
}

.ee-tn-form-group input[type="text"],
.ee-tn-form-group input[type="number"],
.ee-tn-form-group input[type="date"],
.ee-tn-form-group textarea,
.ee-tn-form-group select {
    padding: 10px 12px;
    border: 1px solid var(--ee-tn-border-strong);
    border-radius: var(--ee-tn-radius-sm);
    font-size: 14px;
    color: var(--ee-tn-text);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ee-tn-form-group input::placeholder,
.ee-tn-form-group textarea::placeholder {
    color: var(--ee-tn-text-light);
}

.ee-tn-form-group input:focus,
.ee-tn-form-group textarea:focus,
.ee-tn-form-group select:focus {
    outline: none;
    border-color: var(--ee-tn-primary);
    box-shadow: 0 0 0 3px var(--ee-tn-focus-ring);
}

.ee-tn-form-group input[readonly],
.ee-tn-form-group textarea[readonly] {
    background: var(--ee-tn-surface);
    color: var(--ee-tn-text-muted);
    cursor: not-allowed;
}

.ee-tn-form-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.ee-tn-form-notice {
    padding: 10px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--ee-tn-radius-sm);
    font-size: 12px;
    color: var(--ee-tn-info);
}

/* ============================================================================
   VIEW
   ============================================================================ */

.ee-tn-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ee-tn-view-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ee-tn-view-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.ee-tn-view-status.status-not_started {
    background: var(--ee-tn-text-muted);
}

.ee-tn-view-status.status-in_progress {
    background: var(--ee-tn-warning);
}

.ee-tn-view-status.status-completed {
    background: var(--ee-tn-success);
}

.ee-tn-view-system-badge,
.ee-tn-view-private-badge,
.ee-tn-view-internal-badge,
.ee-tn-view-external-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.ee-tn-view-system-badge {
    background: var(--ee-tn-info);
    color: white;
}

.ee-tn-view-private-badge {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: white;
}

.ee-tn-view-internal-badge {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
}

.ee-tn-view-external-badge {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
}

.ee-tn-view-overdue-badge {
    background: var(--ee-tn-danger);
    color: white;
}

/* Modern View Styling */
.ee-tn-view-modern .ee-tn-view-title {
    font-size: 22px;
    margin: 16px 0 8px 0;
}

.ee-tn-view-modern .ee-tn-view-desc {
    background: var(--ee-tn-border);
    padding: 12px 14px;
    border-radius: var(--ee-tn-radius-sm);
    margin-bottom: 16px;
    white-space: pre-wrap;
}

.ee-tn-view-details-modern {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.ee-tn-view-detail-row .value.overdue {
    color: var(--ee-tn-danger);
    font-weight: 600;
}

/* New View Layout */
.ee-tn-view-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.ee-tn-view-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.ee-tn-view-info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--ee-tn-radius-sm);
    transition: all 0.2s ease;
}

.ee-tn-view-info-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.ee-tn-view-info-card.overdue {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.12) 100%);
    border-color: rgba(239, 68, 68, 0.25);
}

.ee-tn-view-info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: var(--ee-tn-radius-sm);
    color: var(--ee-tn-primary);
    flex-shrink: 0;
}

.ee-tn-view-info-card.overdue .ee-tn-view-info-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--ee-tn-danger);
}

.ee-tn-view-info-icon.score {
    background: linear-gradient(135deg, var(--ee-tn-primary) 0%, #8B5CF6 100%);
    color: white;
    font-size: 16px;
    font-weight: 700;
}

.ee-tn-view-info-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ee-tn-view-info-text .label {
    font-size: 11px;
    color: var(--ee-tn-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ee-tn-view-info-text .value {
    font-size: 14px;
    font-weight: 500;
    color: var(--ee-tn-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ee-tn-view-info-card.overdue .ee-tn-view-info-text .value {
    color: var(--ee-tn-danger);
}

/* View Footer */
.ee-tn-view-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 0;
    border-top: 1px solid var(--ee-tn-border);
    margin-top: 8px;
}

.ee-tn-view-footer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--ee-tn-text-muted);
}

.ee-tn-view-footer-item.edited {
    font-style: italic;
    opacity: 0.8;
}

.ee-tn-view-footer-item .ee-tn-avatar {
    width: 20px;
    height: 20px;
    font-size: 8px;
}

.ee-tn-view-info-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.15);
    color: #3B82F6;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.ee-tn-view-info-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: scale(1.1);
}

.ee-tn-view-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--ee-tn-text);
    margin: 0;
}

.ee-tn-view-desc {
    font-size: 14px;
    color: var(--ee-tn-text);
    line-height: 1.6;
    white-space: pre-wrap;
}

.ee-tn-view-section {
    padding: 12px;
    background: var(--ee-tn-border);
    border-radius: var(--ee-tn-radius-sm);
}

.ee-tn-view-section strong {
    display: block;
    font-size: 12px;
    color: var(--ee-tn-text-muted);
    margin-bottom: 4px;
}

.ee-tn-view-section p {
    margin: 0;
    font-size: 14px;
    color: var(--ee-tn-text);
    white-space: pre-wrap;
}

.ee-tn-view-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ee-tn-view-detail {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ee-tn-view-detail-label {
    font-size: 13px;
    color: var(--ee-tn-text-muted);
    min-width: 100px;
}

.ee-tn-view-detail-value {
    font-size: 13px;
    color: var(--ee-tn-text);
    font-weight: 500;
}

.ee-tn-view-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--ee-tn-border);
}

.ee-tn-view-meta span {
    font-size: 11px;
    color: var(--ee-tn-text-light);
}

/* ============================================================================
   COMMENTS
   ============================================================================ */

.ee-tn-comments {
    margin-top: 16px;
    padding-top: 16px;
}

.ee-tn-comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ee-tn-comments h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--ee-tn-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ee-tn-comments-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    background: #EF4444;
    color: white;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    animation: pulse-unread 2s infinite;
}

.ee-tn-btn-mark-read {
    background: #10B981 !important;
    color: white !important;
    border: none !important;
    font-size: 11px !important;
    padding: 4px 10px !important;
}

.ee-tn-btn-mark-read:hover {
    background: #059669 !important;
}

.ee-tn-comments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 12px;
    padding: 8px 4px;
}

/* Chat-style comment layout */
.ee-tn-comment {
    display: flex;
    max-width: 90%;
    min-width: 60%;
}

.ee-tn-comment-other {
    align-self: flex-start;
}

.ee-tn-comment-own {
    align-self: flex-end;
}

.ee-tn-comment-bubble {
    padding: 10px 12px;
    border-radius: 12px;
    position: relative;
    width: 100%;
}

.ee-tn-comment-other .ee-tn-comment-bubble {
    background: var(--ee-tn-border);
    border-bottom-left-radius: 4px;
}

.ee-tn-comment-own .ee-tn-comment-bubble {
    background: var(--ee-tn-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.ee-tn-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.ee-tn-comment-author {
    font-size: 11px;
    font-weight: 600;
}

.ee-tn-comment-other .ee-tn-comment-author {
    color: var(--ee-tn-text);
}

.ee-tn-comment-own .ee-tn-comment-author {
    color: rgba(255, 255, 255, 0.9);
}

.ee-tn-comment-date {
    font-size: 10px;
    margin-top: 4px;
    text-align: right;
}

.ee-tn-comment-other .ee-tn-comment-date {
    color: var(--ee-tn-text-light);
}

.ee-tn-comment-own .ee-tn-comment-date {
    color: rgba(255, 255, 255, 0.7);
}

.ee-tn-comment-text {
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
}

.ee-tn-comment-other .ee-tn-comment-text {
    color: var(--ee-tn-text);
}

.ee-tn-comment-own .ee-tn-comment-text {
    color: white;
}

/* Comment actions (edit/delete) */
.ee-tn-comment-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.ee-tn-comment:hover .ee-tn-comment-actions {
    opacity: 1;
}

.ee-tn-comment-action {
    background: none;
    border: none;
    padding: 2px 4px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.ee-tn-comment-action:hover {
    opacity: 1;
}

/* Inline edit mode */
.ee-tn-comment-edit {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.ee-tn-comment-edit-input {
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 13px;
    resize: vertical;
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
}

.ee-tn-comment-other .ee-tn-comment-edit-input {
    border-color: var(--ee-tn-border);
    background: white;
}

.ee-tn-comment-edit-input:focus {
    outline: none;
    border-color: var(--ee-tn-primary);
}

.ee-tn-comment-edit .ee-tn-btn {
    align-self: flex-end;
}

.ee-tn-comments-add {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.ee-tn-comments-add textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--ee-tn-border);
    border-radius: var(--ee-tn-radius-sm);
    font-size: 13px;
    resize: none;
    min-height: 40px;
    max-height: 100px;
}

.ee-tn-comments-add textarea:focus {
    outline: none;
    border-color: var(--ee-tn-primary);
}

.ee-tn-comments-add .ee-tn-btn {
    flex-shrink: 0;
}

/* Unread comments highlight */
.ee-tn-comment-unread .ee-tn-comment-bubble {
    border: 1px solid #000000;
}

.ee-tn-comment-unread .ee-tn-comment-author,
.ee-tn-comment-unread .ee-tn-comment-text {
    font-weight: 600;
}

.ee-tn-comment-unread .ee-tn-comment-date {
    font-weight: 600;
    color: #000000;
}

/* ============================================================================
   EXPANDED VIEW (Fullscreen Modal)
   ============================================================================ */

.ee-tn-expanded-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100250;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ee-tn-expanded-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ee-tn-expanded-container {
    background: var(--ee-tn-bg-solid);
    border-radius: var(--ee-tn-radius);
    box-shadow: var(--ee-tn-shadow-lg);
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.ee-tn-expanded-overlay.active .ee-tn-expanded-container {
    transform: scale(1);
}

.ee-tn-expanded-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--ee-tn-border);
    gap: 16px;
}

/* View Switch */
.ee-tn-view-switch {
    display: flex;
    gap: 4px;
    background: var(--ee-tn-border);
    padding: 4px;
    border-radius: var(--ee-tn-radius-sm);
}

.ee-tn-view-switch-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--ee-tn-text-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ee-tn-view-switch-btn:hover {
    color: var(--ee-tn-text);
    background: rgba(255, 255, 255, 0.5);
}

.ee-tn-view-switch-btn.active {
    background: var(--ee-tn-primary);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Header Right Container */
.ee-tn-expanded-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Header add button (for organization mode) */
.ee-tn-header-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--ee-tn-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.ee-tn-header-add-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ee-tn-header-add-btn:active {
    transform: scale(0.98);
}

.ee-tn-expanded-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--ee-tn-text);
    margin: 0;
}

.ee-tn-expanded-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: 50%;
    color: var(--ee-tn-text-muted);
    cursor: pointer;
    transition: var(--ee-tn-transition);
}

.ee-tn-expanded-close:hover {
    background: var(--ee-tn-border);
    color: var(--ee-tn-text);
}

.ee-tn-expanded-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

body.ee-tn-expanded-open {
    overflow: hidden;
}

/* ============================================================================
   EXPLANATION POPUP
   ============================================================================ */

.ee-tn-explanation-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100300;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ee-tn-explanation-popup.active {
    opacity: 1;
}

.ee-tn-explanation-content {
    background: var(--ee-tn-bg-solid);
    border-radius: var(--ee-tn-radius);
    box-shadow: var(--ee-tn-shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.ee-tn-explanation-popup.active .ee-tn-explanation-content {
    transform: scale(1);
}

.ee-tn-explanation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ee-tn-border);
}

.ee-tn-explanation-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
    color: #3B82F6;
}

.ee-tn-explanation-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--ee-tn-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ee-tn-explanation-close:hover {
    background: var(--ee-tn-border);
    color: var(--ee-tn-text);
}

.ee-tn-explanation-body {
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ee-tn-text);
    overflow-y: auto;
    white-space: pre-wrap;
}

/* ============================================================================
   TIMELINE VIEW (Gantt-Style)
   ============================================================================ */

.ee-tn-timeline {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ee-tn-timeline-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 16px;
    padding: 0 10px;
}

.ee-tn-timeline-add {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--ee-tn-primary);
    color: white;
    border: none;
    border-radius: var(--ee-tn-radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ee-tn-transition);
    white-space: nowrap;
}

.ee-tn-timeline-add:hover {
    background: var(--ee-tn-primary-hover);
    transform: translateY(-1px);
}

/* Legend */
.ee-tn-timeline-legend {
    display: flex;
    gap: 16px;
    padding: 8px 16px;
    background: var(--ee-tn-border);
    border-radius: var(--ee-tn-radius-sm);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ee-tn-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #ffffff;
}

.ee-tn-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.ee-tn-legend-item.not_started .ee-tn-legend-dot {
    background: #9CA3AF;
}

.ee-tn-legend-item.in_progress .ee-tn-legend-dot {
    background: #F59E0B;
}

.ee-tn-legend-item.completed .ee-tn-legend-dot {
    background: #10B981;
}

.ee-tn-legend-item.overdue .ee-tn-legend-dot {
    background: #EF4444;
}

.ee-tn-legend-item.external-created .ee-tn-legend-dot {
    background: #3B82F6;
}

/* Timeline Container */
.ee-tn-timeline-container {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: var(--ee-tn-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Timeline Scale */
.ee-tn-timeline-scale {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--ee-tn-bg-solid);
    border-bottom: 1px solid var(--ee-tn-border);
}

.ee-tn-timeline-months {
    display: flex;
    border-bottom: 1px solid var(--ee-tn-border);
}

.ee-tn-timeline-month {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ee-tn-text);
    background: rgba(59, 130, 246, 0.05);
    border-right: 1px solid var(--ee-tn-border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    flex-grow: 0;
    box-sizing: border-box;
}

.ee-tn-timeline-days {
    display: flex;
}

.ee-tn-timeline-day {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    font-size: 11px;
    color: var(--ee-tn-text-muted);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    flex-shrink: 0;
    flex-grow: 0;
}

.ee-tn-timeline-day.weekend {
    background: rgba(0, 0, 0, 0.03);
}

.ee-tn-timeline-day.today {
    background: rgba(59, 130, 246, 0.15);
    color: var(--ee-tn-primary);
    font-weight: 600;
}

/* Timeline Body */
.ee-tn-timeline-body {
    position: relative;
    min-height: 200px;
    padding: 16px 0;
}

/* ========== Row-based Timeline Structure (like account template) ========== */

.ee-tn-timeline-rows {
    background: var(--ee-tn-bg-solid);
    border-radius: var(--ee-tn-radius);
    overflow: hidden;
}

.ee-tn-timeline-header-row {
    display: flex;
    border-bottom: 2px solid var(--ee-tn-border);
    background: var(--ee-tn-bg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.ee-tn-timeline-rows-body {
    overflow-y: auto;
}

.ee-tn-timeline-row {
    display: flex;
    border-bottom: 1px solid #F3F4F6;
    transition: background 0.15s ease;
    min-height: 42px;
}

.ee-tn-timeline-row:hover {
    background: rgba(59, 130, 246, 0.04);
}

/* Status-Farbstreifen links am Task (Klassen, nicht data-status) */
.ee-tn-timeline-row.not_started .ee-tn-timeline-title-col {
    border-left: 3px solid #9CA3AF;
}
.ee-tn-timeline-row.in_progress .ee-tn-timeline-title-col {
    border-left: 3px solid #F59E0B;
}
.ee-tn-timeline-row.completed .ee-tn-timeline-title-col {
    border-left: 3px solid #10B981;
}
.ee-tn-timeline-row.overdue .ee-tn-timeline-title-col {
    border-left: 3px solid #EF4444;
}
.ee-tn-timeline-row.completed .ee-tn-timeline-task-title {
    color: #9CA3AF;
    text-decoration: line-through;
}
.ee-tn-timeline-row.overdue .ee-tn-timeline-task-dates {
    color: #EF4444;
    font-weight: 500;
}

.ee-tn-timeline-title-col {
    width: 300px;
    min-width: 300px;
    padding: 0.625rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-right: 1px solid var(--ee-tn-border, #e5e7eb);
    background: var(--ee-tn-bg-solid, #fff);
    position: relative;
    transition: background 0.15s ease;
}

/* Clickable title column - hover highlight */
.ee-tn-timeline-title-col[data-clickable] {
    cursor: pointer;
}

.ee-tn-timeline-title-col[data-clickable]:hover {
    background: rgba(59, 130, 246, 0.08);
}

.ee-tn-timeline-title-col[data-clickable]:hover .ee-tn-timeline-task-title {
    color: var(--ee-tn-primary, #3B82F6);
}

/* Info button positioned at top left of title column - shown on hover */
.ee-tn-timeline-info-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: none;
    background: var(--ee-tn-primary, #3B82F6);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    transition: all 0.15s
    ease;
    font-size: 10px;
    opacity: 0;
    padding: 0px;
}

.ee-tn-timeline-info-btn svg{
    width: 16px;
    height: 16px;
}

.ee-tn-timeline-row:hover .ee-tn-timeline-info-btn {
    opacity: 1;
}

.ee-tn-timeline-info-btn:hover {
    background: #2563EB;
    transform: scale(1.15);
}

/* Comment count badge inline next to date */
.ee-tn-timeline-comment-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 5px;
    margin-left: 6px;
    background: var(--ee-tn-text-light, #6B7280);
    color: white;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    vertical-align: middle;
}

.ee-tn-timeline-comment-badge.unread {
    background: #EF4444;
    animation: pulse-unread 2s infinite;
}

@keyframes pulse-unread {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}

.ee-tn-timeline-task-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ee-tn-timeline-task-text {
    flex: 1;
    min-width: 0;
}

.ee-tn-timeline-task-title {
    display: block;
    font-weight: 500;
    color: var(--ee-tn-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.875rem;
}

.ee-tn-timeline-task-dates {
    font-size: 0.75rem;
    color: var(--ee-tn-text-muted);
}

.ee-tn-timeline-module-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--ee-tn-primary);
    background: rgba(59, 130, 246, 0.1);
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 6px;
    white-space: nowrap;
}

/* Organization Group (for all_accessible view) */
.ee-tn-timeline-org-group {
    margin-bottom: 8px;
}

/* Kompakter, cleaner Org-Header — kein dominanter Gradient mehr */
.ee-tn-timeline-org-header {
    background: #F8FAFC;
    color: #374151;
    padding: 7px 12px 7px 14px;
    border-radius: 6px 6px 0 0;
    border-left: 4px solid #7c3aed;
    border-bottom: 1px solid #E5E7EB;
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.01em;
}

.ee-tn-timeline-org-header::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #7c3aed;
    border-radius: 50%;
    flex-shrink: 0;
}

.ee-tn-timeline-org-name {
    flex: 1;
}

.ee-tn-timeline-org-projects {
    border: 1px solid #E5E7EB;
    border-top: none;
    border-radius: 0 0 6px 6px;
    background: #ffffff;
}

.ee-tn-timeline-org-projects .ee-tn-timeline-category {
    border: none;
    border-bottom: 1px solid #F3F4F6;
}

.ee-tn-timeline-org-projects .ee-tn-timeline-category:last-child {
    border-bottom: none;
}

.ee-tn-timeline-org-projects .ee-tn-timeline-category-header {
    padding-left: 20px;
    background: #F9FAFB;
}

/* Organization Badge (for all_accessible view - kept for backwards compatibility) */
.ee-tn-timeline-org-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.1);
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 6px;
    white-space: nowrap;
}

/* Private Badge */
.ee-tn-private-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    color: var(--ee-tn-warning);
    opacity: 0.8;
}

.ee-tn-private-badge svg {
    fill: rgb(255 255 255);
    stroke: #000000;
    stroke-width: 2px;
}

/* Timeline Category Sections */
.ee-tn-timeline-category {
    margin-bottom: 1rem;
}

.ee-tn-timeline-category:last-child {
    margin-bottom: 0;
}

.ee-tn-timeline-category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: #F3F4F6;
    border-bottom: 1px solid #E5E7EB;
    position: sticky;
    top: 0;
    z-index: 5;
}

.ee-tn-timeline-category-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6B7280;
}

.ee-tn-timeline-category.internal .ee-tn-timeline-category-title {
    color: var(--ee-tn-primary);
}

.ee-tn-timeline-category.external .ee-tn-timeline-category-title {
    color: var(--ee-tn-text-muted);
}

.ee-tn-timeline-category-count {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--ee-tn-border);
    color: var(--ee-tn-text-secondary);
}

.ee-tn-timeline-category.internal .ee-tn-timeline-category-count {
    background: rgba(59, 130, 246, 0.1);
    color: var(--ee-tn-primary);
}

.ee-tn-timeline-category-rows {
    /* Contains the timeline rows for this category */
}

.ee-tn-timeline-task-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ee-tn-timeline-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--ee-tn-primary);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
}

/* Hervorgehobener Avatar wenn Aufgabe mir zugewiesen ist */
.ee-tn-timeline-avatar.self {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 0 0 2px #d1fae5, 0 2px 4px rgba(16, 185, 129, 0.3);
}

.ee-tn-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--ee-tn-text-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ee-tn-btn-icon:hover {
    background: var(--ee-tn-border);
    color: var(--ee-tn-text);
}

/* Timeline Action Buttons (Status buttons like Kanban) - always visible */
.ee-tn-timeline-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ee-tn-timeline-action-btn.start {
    background: var(--ee-tn-warning, #F59E0B);
    color: white;
}

.ee-tn-timeline-action-btn.start:hover {
    background: #D97706;
    transform: scale(1.1);
}

.ee-tn-timeline-action-btn.complete {
    background: var(--ee-tn-success, #10B981);
    color: white;
}

.ee-tn-timeline-action-btn.complete:hover {
    background: #059669;
    transform: scale(1.1);
}

.ee-tn-timeline-action-btn.restore {
    background: var(--ee-tn-primary, #3B82F6);
    color: white;
}

.ee-tn-timeline-action-btn.restore:hover {
    background: #2563EB;
    transform: scale(1.1);
}

.ee-tn-timeline-action-btn.external-indicator {
    background: #3B82F6;
    color: white;
    cursor: default;
}

.ee-tn-timeline-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.ee-tn-info-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    background: var(--ee-tn-primary);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.ee-tn-info-btn:hover {
    background: var(--ee-tn-primary-hover, #2563eb);
    transform: scale(1.1);
}

.ee-tn-timeline-chart-col {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    min-width: 0;
}

.ee-tn-timeline-chart-inner {
    min-width: 100%;
}

.ee-tn-timeline-bar-container {
    position: relative;
    height: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
}

/* Weekend column background - light gray */
.ee-tn-timeline-weekend-bg {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.03);
    pointer-events: none;
    z-index: 0;
}

/* Grid lines - subtle vertical separators */
.ee-tn-timeline-grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--ee-tn-border, #e5e7eb);
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

/* Weekend grid lines slightly darker */
.ee-tn-timeline-grid-line.weekend {
    background: var(--ee-tn-border, #d1d5db);
    opacity: 0.6;
}

.ee-tn-timeline-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--ee-tn-primary);
    opacity: 0.6;
    z-index: 3;
}

.ee-tn-timeline-bar {
    position: absolute;
    height: 26px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    z-index: 2;
    min-width: 8px;
}

.ee-tn-timeline-bar:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.ee-tn-timeline-bar.draggable {
    cursor: grab;
}

.ee-tn-timeline-bar.dragging {
    cursor: grabbing;
    opacity: 0.9;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    z-index: 100;
}

.ee-tn-timeline-bar.not_started {
    background: #9CA3AF;
    opacity: 0.85;
}

.ee-tn-timeline-bar.in_progress {
    background: #F59E0B;
}

.ee-tn-timeline-bar.completed {
    background: #10B981;
    opacity: 0.75;
}

.ee-tn-timeline-bar.overdue {
    background: #EF4444;
    animation: pulse-overdue 2s ease-in-out infinite;
}

@keyframes pulse-overdue {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.ee-tn-timeline-bar.external-created {
    border: 2px solid #3B82F6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
    cursor: not-allowed;
    opacity: 0.5;
}

.ee-tn-timeline-bar.external-created:hover {
    opacity: 0.6;
    filter: grayscale(30%);
}

.ee-tn-timeline-bar.system {
    border: 2px dashed rgba(255, 255, 255, 0.5);
}

.ee-tn-timeline-bar-label {
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 1rem;
    pointer-events: none;
}

/* Explanation Popup */
.ee-tn-explanation-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100300;
}

.ee-tn-explanation-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.ee-tn-explanation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--ee-tn-border, #e5e7eb);
    background: var(--ee-tn-bg, #f9fafb);
}

.ee-tn-explanation-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ee-tn-text, #1f2937);
}

.ee-tn-explanation-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    color: var(--ee-tn-text-muted, #6b7280);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.ee-tn-explanation-close:hover {
    background: var(--ee-tn-border, #e5e7eb);
    color: var(--ee-tn-text, #1f2937);
}

.ee-tn-explanation-body {
    padding: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--ee-tn-text, #1f2937);
    max-height: 60vh;
    overflow-y: auto;
}

/* ========== End Row-based Timeline Structure ========== */

/* Timeline Grid (vertikale Spaltenlinien) */
.ee-tn-timeline-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.ee-tn-timeline-grid-col {
    position: absolute;
    top: 0;
    bottom: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.ee-tn-timeline-grid-col.weekend {
    background: rgba(0, 0, 0, 0.02);
}

.ee-tn-timeline-today {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--ee-tn-primary);
    z-index: 5;
    opacity: 0.6;
}

.ee-tn-timeline-today::before {
    content: 'Heute';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--ee-tn-primary);
    font-weight: 600;
    white-space: nowrap;
}

/* Timeline Items */
.ee-tn-timeline-item {
    position: absolute;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ee-tn-timeline-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

/* Status Colors */
.ee-tn-timeline-item.not_started {
    background: linear-gradient(135deg, #9CA3AF 0%, #6B7280 100%);
    color: white;
}

.ee-tn-timeline-item.in_progress {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
}

.ee-tn-timeline-item.completed {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
}

.ee-tn-timeline-item.overdue {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5); }
}

.ee-tn-timeline-item.system {
    border: 2px dashed rgba(255, 255, 255, 0.5);
}

/* Externe Aufgaben (von Externen erstellt) - blauer Rand */
.ee-tn-timeline-item.external-created {
    border: 2px solid #3B82F6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
    cursor: not-allowed;
}

.ee-tn-timeline-item.external-created:hover {
    opacity: 0.6;
    filter: grayscale(30%);
}

.ee-tn-timeline-item-title {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ee-tn-timeline-item-avatar {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 6px;
}

.ee-tn-timeline-item-avatar .ee-tn-avatar {
    width: 20px;
    height: 20px;
    font-size: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Timeline Loading */
.ee-tn-timeline-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--ee-tn-text-muted);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

/* ============================================================================
   MODERN FORM STYLES
   ============================================================================ */

.ee-tn-form-modern {
    gap: 0;
    margin: -20px;   /* hebt das 20px-Padding der .ee-tn-popup-body auf, Sektionen liefern ihr eigenes Padding */
}

.ee-tn-form-section {
    padding: var(--ee-tn-space-5) var(--ee-tn-space-5);
    border-bottom: 1px solid var(--ee-tn-border-soft);
}

.ee-tn-form-section + .ee-tn-form-section {
    padding-top: var(--ee-tn-space-5);
}

.ee-tn-form-section:last-child {
    border-bottom: none;
}

.ee-tn-form-group.full {
    grid-column: 1 / -1;
}

.ee-tn-form-group textarea {
    min-height: 100px;
    max-height: 400px;
}

.ee-tn-form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ee-tn-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 12px;
}

.ee-tn-form-group label svg {
    opacity: 0.7;
}

.ee-tn-form-row.thirds {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.ee-tn-form-row.halves {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Select Wrapper with custom arrow */
.ee-tn-select-wrapper {
    position: relative;
}

.ee-tn-select-wrapper select {
    width: 100%;
    appearance: none;
    padding-right: 32px;
    cursor: pointer;
}

.ee-tn-select-wrapper::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--ee-tn-text-muted);
    pointer-events: none;
}

/* Toggle Switches */
.ee-tn-form-toggles {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.ee-tn-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.ee-tn-toggle input {
    display: none;
}

.ee-tn-toggle-slider {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--ee-tn-border);
    border-radius: 11px;
    transition: all 0.3s ease;
}

.ee-tn-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ee-tn-toggle input:checked + .ee-tn-toggle-slider {
    background: var(--ee-tn-primary);
}

.ee-tn-toggle input:checked + .ee-tn-toggle-slider::after {
    left: 21px;
}

.ee-tn-toggle-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-size: 13px;
    color: var(--ee-tn-text);
}

.ee-tn-toggle-label svg {
    opacity: 0.6;
    margin-bottom: 2px;
}

.ee-tn-toggle-hint {
    font-size: 10px;
    color: var(--ee-tn-text-muted);
    font-weight: 400;
}

.ee-tn-form-visibility-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: var(--ee-tn-radius-sm);
    font-size: 11px;
    color: var(--ee-tn-text-muted);
}

.ee-tn-form-visibility-hint.external {
    background: rgba(59, 130, 246, 0.12);
    color: #3B82F6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.ee-tn-form-visibility-hint svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.ee-tn-form-visibility-hint.external svg {
    opacity: 1;
}

/* System Notice in Form */
.ee-tn-form-notice.system {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: var(--ee-tn-space-5) var(--ee-tn-space-5) 0;
    padding: 10px 14px;
    background: var(--ee-tn-accent-soft);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--ee-tn-radius-sm);
    font-size: 13px;
    color: var(--ee-tn-info);
}

/* ============================================================================
   AVATAR STYLES
   ============================================================================ */

.ee-tn-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--ee-tn-primary) 0%, #8B5CF6 100%);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    cursor: default;
}

.ee-tn-avatar-lg {
    width: 36px;
    height: 36px;
    font-size: 13px;
}

.ee-tn-avatar-sm {
    width: 22px;
    height: 22px;
    font-size: 9px;
}

/* Hervorgehobener Avatar wenn Aufgabe mir zugewiesen ist */
.ee-tn-avatar.self {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 0 0 2px #d1fae5, 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Avatar in Preview Items */
.ee-tn-preview-item-responsible .ee-tn-avatar {
    width: 22px;
    height: 22px;
    font-size: 9px;
}

/* Avatar in View Details */
.ee-tn-view-detail-value .ee-tn-avatar {
    margin-right: 8px;
}

.ee-tn-view-detail-value.with-avatar {
    display: flex;
    align-items: center;
}

/* Avatar in Comments */
.ee-tn-comment-author-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Avatar in Kanban Cards */
.ee-tn-kanban-card-responsible .ee-tn-avatar {
    width: 20px;
    height: 20px;
    font-size: 8px;
}

.ee-tn-kanban-card-responsible {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================================================
   MODERN VIEW STYLES
   ============================================================================ */

.ee-tn-view-detail-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--ee-tn-border);
}

.ee-tn-view-detail-row:last-child {
    border-bottom: none;
}

.ee-tn-view-detail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--ee-tn-border);
    border-radius: var(--ee-tn-radius-sm);
    color: var(--ee-tn-text-muted);
    flex-shrink: 0;
}

.ee-tn-view-detail-content {
    flex: 1;
}

.ee-tn-view-detail-content .label {
    font-size: 11px;
    color: var(--ee-tn-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.ee-tn-view-detail-content .value {
    font-size: 14px;
    font-weight: 500;
    color: var(--ee-tn-text);
}

/* Meta Info with Avatars */
.ee-tn-view-meta-modern {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--ee-tn-border);
}

.ee-tn-view-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--ee-tn-text-muted);
}

.ee-tn-view-meta-item .ee-tn-avatar {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .ee-tn-kanban-board {
        grid-template-columns: 1fr;
    }

    .ee-tn-popup-container {
        width: 95%;
        max-height: 95vh;
    }

    .ee-tn-form-row,
    .ee-tn-form-row.thirds,
    .ee-tn-form-row.halves {
        grid-template-columns: 1fr;
    }

    .ee-tn-form-toggles {
        flex-direction: column;
        gap: 12px;
    }

    .ee-tn-expanded-container {
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
    }

    .ee-tn-list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .ee-tn-list-item-meta {
        width: 100%;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid var(--ee-tn-border-soft);
    }

    .ee-tn-list-item-actions {
        width: 100%;
        margin-left: 0;
        padding-left: 0;
        justify-content: flex-end;
    }
}

/* ========================================================================
   INLINE VIEW (for widget fullscreen)
   ======================================================================== */

.ee-tn-inline-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(0,0,0,0.2);
    border-radius: var(--ee-tn-radius-lg);
    overflow: hidden;
}

.ee-tn-inline-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
}

.ee-tn-inline-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    padding: 0;
}

.ee-tn-inline-content {
    flex: 1;
    overflow: auto;
    padding: 16px;
}

/* ========================================================================
   TIMELINE DRAG & DROP
   ======================================================================== */

.ee-tn-timeline-item {
    cursor: grab;
}

.ee-tn-timeline-item.system {
    cursor: not-allowed;
}

.ee-tn-timeline-item.external-created {
    cursor: default;
}

.ee-tn-timeline-item.dragging {
    cursor: grabbing !important;
    opacity: 0.9;
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: none;
}

.ee-tn-timeline-body {
    user-select: none;
}

/* Timeline Item Draggable State */
.ee-tn-timeline-item.draggable {
    cursor: grab;
}

.ee-tn-timeline-item.draggable:hover {
    cursor: grab;
}

/* Resize Handles */
.ee-tn-resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: ew-resize;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 5;
}

.ee-tn-timeline-bar.draggable:hover .ee-tn-resize-handle,
.ee-tn-timeline-bar.dragging .ee-tn-resize-handle {
    opacity: 1;
}

.ee-tn-resize-left {
    left: 0;
    border-radius: 4px 0 0 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.3) 0%, transparent 100%);
}

.ee-tn-resize-right {
    right: 0;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(270deg, rgba(255,255,255,0.3) 0%, transparent 100%);
}

.ee-tn-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 12px;
    background: rgba(255,255,255,0.6);
    border-radius: 1px;
}

/* ========================================================================
   FLATPICKR CUSTOMIZATION
   ======================================================================== */

/* Flatpickr Input Styling */
.ee-tn-form input.flatpickr-input {
    background: var(--ee-tn-bg-solid);
    cursor: pointer;
}

.ee-tn-form input.flatpickr-input:focus {
    border-color: var(--ee-tn-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Flatpickr Calendar Styling */
.flatpickr-calendar {
    font-family: inherit;
    border-radius: var(--ee-tn-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--ee-tn-border);
    z-index: 200000 !important; /* Must be above popup overlay (100300) and task dropdown (100400) */
}

.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after {
    border-bottom-color: var(--ee-tn-surface);
}

.flatpickr-months {
    background: var(--ee-tn-surface);
    border-radius: var(--ee-tn-radius) var(--ee-tn-radius) 0 0;
}

.flatpickr-months .flatpickr-month {
    background: transparent;
    color: var(--ee-tn-text);
}

.flatpickr-current-month {
    font-weight: 600;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    font-weight: 600;
}

.flatpickr-weekdays {
    background: var(--ee-tn-surface);
}

.flatpickr-weekday {
    color: var(--ee-tn-text-muted);
    font-weight: 600;
    font-size: 11px;
}

.flatpickr-day {
    color: var(--ee-tn-text);
    border-radius: 6px;
    transition: all 0.15s ease;
}

.flatpickr-day:hover {
    background: var(--ee-tn-border);
    border-color: transparent;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--ee-tn-primary);
    border-color: var(--ee-tn-primary);
    color: white;
}

.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: var(--ee-tn-primary-hover);
    border-color: var(--ee-tn-primary-hover);
}

.flatpickr-day.today {
    border-color: var(--ee-tn-primary);
}

.flatpickr-day.today:hover {
    background: var(--ee-tn-primary);
    color: white;
}

.flatpickr-day.disabled {
    color: var(--ee-tn-text-muted);
    opacity: 0.5;
}

/* Week numbers styling */
.flatpickr-weekwrapper {
    padding-right: 5px;
}

.flatpickr-weekwrapper .flatpickr-weekday {
    color: var(--ee-tn-text-muted);
}

.flatpickr-weekwrapper .flatpickr-weeks {
    box-shadow: none;
}

.flatpickr-week {
    font-size: 10px;
    color: var(--ee-tn-text-muted);
}

/* ========================================================================
   TIMELINE HOVER TOOLTIP
   ======================================================================== */

.ee-tn-timeline-tooltip {
    position: fixed;
    z-index: 10000;
    background: var(--ee-tn-surface);
    border: 1px solid var(--ee-tn-border);
    border-radius: var(--ee-tn-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 12px 16px;
    min-width: 220px;
    max-width: 320px;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(-100%);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.ee-tn-timeline-tooltip.active {
    opacity: 1;
    transform: translateX(-50%) translateY(-100%) translateY(-5px);
}

.ee-tn-tooltip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ee-tn-tooltip-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.ee-tn-tooltip-status.status-not_started {
    background: rgba(156, 163, 175, 0.2);
    color: #6B7280;
}

.ee-tn-tooltip-status.status-in_progress {
    background: rgba(245, 158, 11, 0.2);
    color: #D97706;
}

.ee-tn-tooltip-status.status-completed {
    background: rgba(16, 185, 129, 0.2);
    color: #059669;
}

.ee-tn-tooltip-overdue {
    font-size: 11px;
    color: var(--ee-tn-danger);
    font-weight: 500;
}

.ee-tn-tooltip-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ee-tn-text);
    margin-bottom: 6px;
    line-height: 1.3;
}

.ee-tn-tooltip-desc {
    font-size: 12px;
    color: var(--ee-tn-text-muted);
    line-height: 1.4;
    margin-bottom: 8px;
}

.ee-tn-tooltip-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--ee-tn-border);
}

.ee-tn-tooltip-meta span {
    font-size: 11px;
    color: var(--ee-tn-text-muted);
}

/* Tooltip Arrow */
.ee-tn-timeline-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--ee-tn-surface);
}

/* ========================================================================
   APPLE-STYLE SWITCH (for external toggle)
   ======================================================================== */

.ee-tn-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 6px 12px;
    background: var(--ee-tn-bg-solid);
    border: 1px solid var(--ee-tn-border);
    border-radius: var(--ee-tn-radius-sm);
    transition: all 0.2s ease;
}

.ee-tn-switch:hover {
    border-color: #3B82F6;
}

.ee-tn-switch input[type="checkbox"] {
    display: none;
}

.ee-tn-switch-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #E5E7EB;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.ee-tn-switch-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active state - Apple Blue */
.ee-tn-switch input:checked + .ee-tn-switch-slider {
    background: #3B82F6;
}

.ee-tn-switch input:checked + .ee-tn-switch-slider::after {
    left: 22px;
}

/* Focus ring for accessibility */
.ee-tn-switch input:focus-visible + .ee-tn-switch-slider {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.ee-tn-switch-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ee-tn-text);
    white-space: nowrap;
}

/* Active state label color */
.ee-tn-switch input:checked ~ .ee-tn-switch-label {
    color: #3B82F6;
}

/* ========================================================================
   TASK COUNT BADGE
   ======================================================================== */

.ee-tn-task-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--ee-tn-bg-solid);
    border: 1px solid var(--ee-tn-border);
    border-radius: var(--ee-tn-radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--ee-tn-text);
}

.ee-tn-task-count svg {
    color: var(--ee-tn-primary);
    opacity: 0.8;
}

.ee-tn-task-count-number {
    font-weight: 600;
    color: var(--ee-tn-primary);
}

/* ========================================================================
   NOTE ACTION BUTTONS (Check/Delete)
   ======================================================================== */

.ee-tn-list-item-actions {
    display: flex;
    gap: var(--ee-tn-space-1);
    margin-left: auto;
    padding-left: var(--ee-tn-space-2);
}

.ee-tn-note-complete-btn,
.ee-tn-note-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: var(--ee-tn-radius-sm);
    background: transparent;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    color: var(--ee-tn-text-light);
}

.ee-tn-note-complete-btn:hover {
    background: rgba(52, 199, 89, 0.12);
    border-color: rgba(52, 199, 89, 0.25);
    color: #34C759;
}

.ee-tn-note-complete-btn.completed {
    color: #34C759;
    background: rgba(52, 199, 89, 0.1);
}

.ee-tn-note-complete-btn.completed:hover {
    background: rgba(52, 199, 89, 0.2);
}

.ee-tn-note-delete-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
    color: #EF4444;
}

.ee-tn-note-complete-btn:disabled,
.ee-tn-note-delete-btn:disabled,
.ee-tn-note-restore-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Restore button for completed notes */
.ee-tn-note-restore-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: var(--ee-tn-radius-sm);
    background: transparent;
    color: var(--ee-tn-warning);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ee-tn-note-restore-btn:hover {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.25);
    color: #b45309;
}

/* Task action buttons in list view
   Standard = dezenter Ghost-Icon-Button (sichtbar, aber zurueckhaltend).
   complete/restore behalten ihre Statusfarbe. */
.ee-tn-task-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: var(--ee-tn-radius-sm);
    background: transparent;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    color: var(--ee-tn-text-light);
}

.ee-tn-task-action-btn:hover {
    background: var(--ee-tn-hover);
    border-color: var(--ee-tn-border-soft);
    color: var(--ee-tn-text-secondary);
}

/* Primaere Status-Aktionen: dezente Farbflaeche statt Vollton */
.ee-tn-task-action-btn.start,
.ee-tn-task-action-btn.complete {
    color: var(--ee-tn-success);
}

.ee-tn-task-action-btn.start:hover,
.ee-tn-task-action-btn.complete:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
    color: #059669;
}

.ee-tn-task-action-btn.restore {
    color: var(--ee-tn-warning);
}

.ee-tn-task-action-btn.restore:hover {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.25);
    color: #b45309;
}

.ee-tn-task-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Completed note styling */
.ee-tn-list-item.status-completed {
    opacity: 0.7;
}

.ee-tn-list-item.status-completed .ee-tn-list-item-title {
    text-decoration: line-through;
    color: var(--ee-tn-text-secondary);
}

/* ============================================================================
   FILTER POPUP
   ============================================================================ */

.ee-tn-timeline-filter {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: var(--ee-tn-bg-solid, #fff);
    border: 1px solid var(--ee-tn-border, #e5e7eb);
    border-radius: 6px;
    color: var(--ee-tn-text, #374151);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.ee-tn-timeline-filter:hover {
    background: var(--ee-tn-bg, #f9fafb);
    border-color: var(--ee-tn-primary, #3B82F6);
    color: var(--ee-tn-primary, #3B82F6);
}

.ee-tn-filter-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--ee-tn-primary, #3B82F6);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 9px;
}

.ee-tn-filter-popup {
    background: var(--ee-tn-bg-solid, #fff);
    border: 1px solid var(--ee-tn-border, #e5e7eb);
    border-radius: 8px;
    box-shadow: var(--ee-tn-shadow-lg);
    min-width: 240px;
    max-width: 320px;
}

.ee-tn-filter-popup-content {
    padding: 1rem;
}

.ee-tn-filter-section {
    margin-bottom: 1rem;
}

.ee-tn-filter-section:last-of-type {
    margin-bottom: 0.75rem;
}

.ee-tn-filter-section h5 {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ee-tn-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ee-tn-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ee-tn-filter-checkbox:hover {
    background: rgba(59, 130, 246, 0.05);
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: 4px;
}

.ee-tn-filter-checkbox input[type="checkbox"] {
    display: none;
}

.ee-tn-checkbox-mark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--ee-tn-border, #d1d5db);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.ee-tn-filter-checkbox input:checked + .ee-tn-checkbox-mark {
    background: var(--ee-tn-primary, #3B82F6);
    border-color: var(--ee-tn-primary, #3B82F6);
}

.ee-tn-filter-checkbox input:checked + .ee-tn-checkbox-mark::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.ee-tn-filter-label {
    font-size: 0.8125rem;
    color: var(--ee-tn-text);
}

.ee-tn-filter-label.not_started::before,
.ee-tn-filter-label.in_progress::before,
.ee-tn-filter-label.completed::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.ee-tn-filter-label.not_started::before {
    background: #9CA3AF;
}

.ee-tn-filter-label.in_progress::before {
    background: #F59E0B;
}

.ee-tn-filter-label.completed::before {
    background: #10B981;
}

.ee-tn-filter-owners {
    max-height: 150px;
    overflow-y: auto;
}

.ee-tn-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--ee-tn-border, #e5e7eb);
}

.ee-tn-loading-small,
.ee-tn-empty-small,
.ee-tn-error-small {
    padding: 0.5rem;
    font-size: 0.75rem;
    color: var(--ee-tn-text-muted);
    text-align: center;
}

/* Kategorie-Dropdown */
.ee-tn-select {
    width: 100%;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.ee-tn-select:disabled {
    background-color: var(--ee-tn-border, #e5e7eb);
    cursor: not-allowed;
    opacity: 0.6;
}

/* ============================================================================
   KATEGORIE-FARBEN (Module Colors)
   ============================================================================ */

/* Kategorie-Farben Variablen */
:root {
    --ee-module-grid: #F97316; /* Orange - Netzanschluss */
    --ee-module-finance: #3B82F6;      /* Blau - Finanzierung */
    --ee-module-permit: #8B5CF6;       /* Lila - Genehmigung */
    --ee-module-construction: #1E3A5F; /* Navy Blau - Bau */
    --ee-module-operation: #06B6D4;    /* Cyan - Betrieb */

    /* Status-Farben */
    --ee-status-progress: #F59E0B;     /* Orange - In Bearbeitung */
    --ee-status-completed: #22C55E;    /* Green - completed */
    --ee-status-overdue: #EF4444;      /* Red - overdue */
}

/* Preview Items - Kategorie-Farben als linker Rand */
.ee-tn-preview-item.module-grid {
    border-left: 4px solid var(--ee-module-grid);
}
.ee-tn-preview-item.module-finance {
    border-left: 4px solid var(--ee-module-finance);
}
.ee-tn-preview-item.module-permit {
    border-left: 4px solid var(--ee-module-permit);
}
.ee-tn-preview-item.module-construction {
    border-left: 4px solid var(--ee-module-construction);
}
.ee-tn-preview-item.module-operation {
    border-left: 4px solid var(--ee-module-operation);
}

/* Preview Items - In Progress: 70% Orange → 30% Kategorie Verlauf */
.ee-tn-preview-item.module-grid.in_progress {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.4) 0%, rgba(245, 158, 11, 0.3) 70%, rgba(249, 115, 22, 0.2) 100%);
    border-left-color: var(--ee-status-progress);
}
.ee-tn-preview-item.module-finance.in_progress {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.4) 0%, rgba(245, 158, 11, 0.3) 70%, rgba(59, 130, 246, 0.2) 100%);
    border-left-color: var(--ee-status-progress);
}
.ee-tn-preview-item.module-permit.in_progress {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.4) 0%, rgba(245, 158, 11, 0.3) 70%, rgba(139, 92, 246, 0.2) 100%);
    border-left-color: var(--ee-status-progress);
}
.ee-tn-preview-item.module-construction.in_progress {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.4) 0%, rgba(245, 158, 11, 0.3) 70%, rgba(30, 58, 95, 0.2) 100%);
    border-left-color: var(--ee-status-progress);
}
.ee-tn-preview-item.module-operation.in_progress {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.4) 0%, rgba(245, 158, 11, 0.3) 70%, rgba(6, 182, 212, 0.2) 100%);
    border-left-color: var(--ee-status-progress);
}

/* Preview items - Completed: 70% green -> 30% category gradient */
.ee-tn-preview-item.module-grid.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.4) 0%, rgba(34, 197, 94, 0.3) 70%, rgba(249, 115, 22, 0.2) 100%);
    border-left-color: var(--ee-status-completed);
}
.ee-tn-preview-item.module-finance.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.4) 0%, rgba(34, 197, 94, 0.3) 70%, rgba(59, 130, 246, 0.2) 100%);
    border-left-color: var(--ee-status-completed);
}
.ee-tn-preview-item.module-permit.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.4) 0%, rgba(34, 197, 94, 0.3) 70%, rgba(139, 92, 246, 0.2) 100%);
    border-left-color: var(--ee-status-completed);
}
.ee-tn-preview-item.module-construction.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.4) 0%, rgba(34, 197, 94, 0.3) 70%, rgba(30, 58, 95, 0.2) 100%);
    border-left-color: var(--ee-status-completed);
}
.ee-tn-preview-item.module-operation.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.4) 0%, rgba(34, 197, 94, 0.3) 70%, rgba(6, 182, 212, 0.2) 100%);
    border-left-color: var(--ee-status-completed);
}

/* Preview Items - Overdue: 70% Rot → 30% Kategorie Verlauf */
.ee-tn-preview-item.module-grid.overdue {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4) 0%, rgba(239, 68, 68, 0.3) 70%, rgba(249, 115, 22, 0.2) 100%);
    border-left-color: var(--ee-status-overdue);
}
.ee-tn-preview-item.module-finance.overdue {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4) 0%, rgba(239, 68, 68, 0.3) 70%, rgba(59, 130, 246, 0.2) 100%);
    border-left-color: var(--ee-status-overdue);
}
.ee-tn-preview-item.module-permit.overdue {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4) 0%, rgba(239, 68, 68, 0.3) 70%, rgba(139, 92, 246, 0.2) 100%);
    border-left-color: var(--ee-status-overdue);
}
.ee-tn-preview-item.module-construction.overdue {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4) 0%, rgba(239, 68, 68, 0.3) 70%, rgba(30, 58, 95, 0.2) 100%);
    border-left-color: var(--ee-status-overdue);
}
.ee-tn-preview-item.module-operation.overdue {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4) 0%, rgba(239, 68, 68, 0.3) 70%, rgba(6, 182, 212, 0.2) 100%);
    border-left-color: var(--ee-status-overdue);
}

/* Kanban Cards - Kategorie-Farben als linker Rand */
.ee-tn-kanban-card.module-grid {
    border-left: 4px solid var(--ee-module-grid);
}
.ee-tn-kanban-card.module-finance {
    border-left: 4px solid var(--ee-module-finance);
}
.ee-tn-kanban-card.module-permit {
    border-left: 4px solid var(--ee-module-permit);
}
.ee-tn-kanban-card.module-construction {
    border-left: 4px solid var(--ee-module-construction);
}
.ee-tn-kanban-card.module-operation {
    border-left: 4px solid var(--ee-module-operation);
}

/* Kanban Cards - In Progress: 70% Orange → 30% Kategorie Verlauf */
.ee-tn-kanban-card.module-grid.in_progress {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.4) 0%, rgba(245, 158, 11, 0.3) 70%, rgba(249, 115, 22, 0.2) 100%);
    border-left-color: var(--ee-status-progress);
}
.ee-tn-kanban-card.module-finance.in_progress {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.4) 0%, rgba(245, 158, 11, 0.3) 70%, rgba(59, 130, 246, 0.2) 100%);
    border-left-color: var(--ee-status-progress);
}
.ee-tn-kanban-card.module-permit.in_progress {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.4) 0%, rgba(245, 158, 11, 0.3) 70%, rgba(139, 92, 246, 0.2) 100%);
    border-left-color: var(--ee-status-progress);
}
.ee-tn-kanban-card.module-construction.in_progress {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.4) 0%, rgba(245, 158, 11, 0.3) 70%, rgba(30, 58, 95, 0.2) 100%);
    border-left-color: var(--ee-status-progress);
}
.ee-tn-kanban-card.module-operation.in_progress {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.4) 0%, rgba(245, 158, 11, 0.3) 70%, rgba(6, 182, 212, 0.2) 100%);
    border-left-color: var(--ee-status-progress);
}

/* Kanban cards - Completed: 70% green -> 30% category gradient */
.ee-tn-kanban-card.module-grid.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.4) 0%, rgba(34, 197, 94, 0.3) 70%, rgba(249, 115, 22, 0.2) 100%);
    border-left-color: var(--ee-status-completed);
}
.ee-tn-kanban-card.module-finance.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.4) 0%, rgba(34, 197, 94, 0.3) 70%, rgba(59, 130, 246, 0.2) 100%);
    border-left-color: var(--ee-status-completed);
}
.ee-tn-kanban-card.module-permit.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.4) 0%, rgba(34, 197, 94, 0.3) 70%, rgba(139, 92, 246, 0.2) 100%);
    border-left-color: var(--ee-status-completed);
}
.ee-tn-kanban-card.module-construction.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.4) 0%, rgba(34, 197, 94, 0.3) 70%, rgba(30, 58, 95, 0.2) 100%);
    border-left-color: var(--ee-status-completed);
}
.ee-tn-kanban-card.module-operation.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.4) 0%, rgba(34, 197, 94, 0.3) 70%, rgba(6, 182, 212, 0.2) 100%);
    border-left-color: var(--ee-status-completed);
}

/* Kanban Cards - Overdue: 70% Rot → 30% Kategorie Verlauf */
.ee-tn-kanban-card.module-grid.overdue {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4) 0%, rgba(239, 68, 68, 0.3) 70%, rgba(249, 115, 22, 0.2) 100%);
    border-left-color: var(--ee-status-overdue);
}
.ee-tn-kanban-card.module-finance.overdue {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4) 0%, rgba(239, 68, 68, 0.3) 70%, rgba(59, 130, 246, 0.2) 100%);
    border-left-color: var(--ee-status-overdue);
}
.ee-tn-kanban-card.module-permit.overdue {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4) 0%, rgba(239, 68, 68, 0.3) 70%, rgba(139, 92, 246, 0.2) 100%);
    border-left-color: var(--ee-status-overdue);
}
.ee-tn-kanban-card.module-construction.overdue {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4) 0%, rgba(239, 68, 68, 0.3) 70%, rgba(30, 58, 95, 0.2) 100%);
    border-left-color: var(--ee-status-overdue);
}
.ee-tn-kanban-card.module-operation.overdue {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4) 0%, rgba(239, 68, 68, 0.3) 70%, rgba(6, 182, 212, 0.2) 100%);
    border-left-color: var(--ee-status-overdue);
}

/* Timeline Bars - Kategorie-Grundfarben (not_started) */
.ee-tn-timeline-bar.module-grid {
    background: var(--ee-module-grid);
}
.ee-tn-timeline-bar.module-finance {
    background: var(--ee-module-finance);
}
.ee-tn-timeline-bar.module-permit {
    background: var(--ee-module-permit);
}
.ee-tn-timeline-bar.module-construction {
    background: var(--ee-module-construction);
}
.ee-tn-timeline-bar.module-operation {
    background: var(--ee-module-operation);
}

/* Timeline Bars - In Progress: 70% Orange → 30% Kategorie Verlauf */
.ee-tn-timeline-bar.module-grid.in_progress {
    background: linear-gradient(90deg, var(--ee-module-grid) 0%, var(--ee-status-progress) 60%);
    animation: pulse-progress 2s ease-in-out infinite;
}
.ee-tn-timeline-bar.module-finance.in_progress {
    background: linear-gradient(90deg, var(--ee-module-finance) 0%, var(--ee-status-progress) 60%);
    animation: pulse-progress 2s ease-in-out infinite;
}
.ee-tn-timeline-bar.module-permit.in_progress {
    background: linear-gradient(90deg, var(--ee-module-permit) 0%, var(--ee-status-progress) 60%);
    animation: pulse-progress 2s ease-in-out infinite;
}
.ee-tn-timeline-bar.module-construction.in_progress {
    background: linear-gradient(90deg, var(--ee-module-construction) 0%, var(--ee-status-progress) 60%);
    animation: pulse-progress 2s ease-in-out infinite;
}
.ee-tn-timeline-bar.module-operation.in_progress {
    background: linear-gradient(90deg, var(--ee-module-operation) 0%, var(--ee-status-progress) 60%);
    animation: pulse-progress 2s ease-in-out infinite;
}

/* Timeline bars - Completed: 70% green -> 30% category gradient */
.ee-tn-timeline-bar.module-grid.completed {
    background: linear-gradient(90deg, var(--ee-module-grid) 0%, var(--ee-status-completed) 60%);
}
.ee-tn-timeline-bar.module-finance.completed {
    background: linear-gradient(90deg, var(--ee-module-finance) 0%, var(--ee-status-completed) 60%);
}
.ee-tn-timeline-bar.module-permit.completed {
    background: linear-gradient(90deg, var(--ee-module-permit) 0%, var(--ee-status-completed) 60%);
}
.ee-tn-timeline-bar.module-construction.completed {
    background: linear-gradient(90deg, var(--ee-module-construction) 0%, var(--ee-status-completed) 60%);
}
.ee-tn-timeline-bar.module-operation.completed {
    background: linear-gradient(90deg, var(--ee-module-operation) 0%, var(--ee-status-completed) 60%);
}

/* Timeline Bars - Overdue: 70% Rot → 30% Kategorie Verlauf */
.ee-tn-timeline-bar.module-grid.overdue {
    background: linear-gradient(90deg, var(--ee-module-grid) 0%, var(--ee-status-overdue) 60%);
}
.ee-tn-timeline-bar.module-finance.overdue {
    background: linear-gradient(90deg, var(--ee-module-finance) 0%, var(--ee-status-overdue) 60%);
}
.ee-tn-timeline-bar.module-permit.overdue {
    background: linear-gradient(90deg, var(--ee-module-permit) 0%, var(--ee-status-overdue) 60%);
}
.ee-tn-timeline-bar.module-construction.overdue {
    background: linear-gradient(90deg, var(--ee-module-construction) 0%, var(--ee-status-overdue) 60%);
}
.ee-tn-timeline-bar.module-operation.overdue {
    background: linear-gradient(90deg, var(--ee-module-operation) 0%, var(--ee-status-overdue) 60%);
}

/* Timeline Rows - Kategorie linker Rand */
.ee-tn-timeline-row.module-grid .ee-tn-timeline-title-col {
    border-left: 3px solid var(--ee-module-grid);
}
.ee-tn-timeline-row.module-finance .ee-tn-timeline-title-col {
    border-left: 3px solid var(--ee-module-finance);
}
.ee-tn-timeline-row.module-permit .ee-tn-timeline-title-col {
    border-left: 3px solid var(--ee-module-permit);
}
.ee-tn-timeline-row.module-construction .ee-tn-timeline-title-col {
    border-left: 3px solid var(--ee-module-construction);
}
.ee-tn-timeline-row.module-operation .ee-tn-timeline-title-col {
    border-left: 3px solid var(--ee-module-operation);
}

/* Timeline rows - status changes left border */
.ee-tn-timeline-row.in_progress .ee-tn-timeline-title-col {
    border-left-color: var(--ee-status-progress);
}
.ee-tn-timeline-row.completed .ee-tn-timeline-title-col {
    border-left-color: var(--ee-status-completed);
}
.ee-tn-timeline-row.overdue .ee-tn-timeline-title-col {
    border-left-color: var(--ee-status-overdue);
}

/* Pulse animation for in-progress */
@keyframes pulse-progress {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
    50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0); }
}

/* ========================================================================
   ORGANIZATION MODE - Gruppierung nach Organisation > Projekt
   ======================================================================== */

.ee-tn-timeline-org-group {
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.ee-tn-timeline-org-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ee-tn-timeline-org-title {
    font-size: 15px;
    font-weight: 600;
}

.ee-tn-timeline-org-count {
    font-size: 12px;
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 12px;
}

.ee-tn-timeline-org-projects {
    padding: 8px;
}

.ee-tn-timeline-org-projects .ee-tn-timeline-category {
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
}

.ee-tn-timeline-org-projects .ee-tn-timeline-category-header {
    background: #f1f5f9;
    padding: 8px 12px;
}

.ee-tn-timeline-org-projects .ee-tn-timeline-category-title {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
}

/* Inline header layout for add button in project view fullscreen */
.ee-tn-inline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ee-tn-inline-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ee-tn-inline-header-right .ee-tn-header-add-btn,
.ee-tn-header-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--secondary-color, #3FA14D);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ee-tn-header-add-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

/* ========================================================================
   PHASE 3 + 4: Time-effort buttons, priority pills, completion dialog
   ======================================================================== */

/* --- F1: Zeitaufwand-Buttons --- */
.ee-tn-time-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.ee-tn-time-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ee-tn-time-btn {
    min-width: 38px;
    padding: 7px 12px;
    border: 1px solid var(--ee-tn-border-strong);
    border-radius: var(--ee-tn-radius-sm);
    background: #fff;
    color: var(--ee-tn-text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ee-tn-time-btn:hover:not(:disabled) {
    border-color: var(--ee-tn-primary);
    color: var(--ee-tn-primary);
}
.ee-tn-time-btn.active {
    background: var(--ee-tn-primary);
    border-color: var(--ee-tn-primary);
    color: #fff;
}
.ee-tn-time-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.ee-tn-time-custom-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ee-tn-time-custom {
    width: 80px;
    padding: 7px 10px;
    border: 1px solid var(--ee-tn-border-strong);
    border-radius: var(--ee-tn-radius-sm);
    background: #fff;
    color: var(--ee-tn-text);
    font-size: 13px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ee-tn-time-custom:focus {
    outline: none;
    border-color: var(--ee-tn-primary);
    box-shadow: 0 0 0 3px var(--ee-tn-focus-ring);
}
.ee-tn-time-custom-unit {
    font-size: 12px;
    color: var(--ee-tn-text-muted);
}

/* Zeitaufwand-Badge auf Cards */
.ee-tn-list-item-time {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--ee-tn-radius-pill);
    background: var(--ee-tn-hover);
    border: 1px solid var(--ee-tn-border-soft);
    color: var(--ee-tn-text-secondary);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* --- F6: Priority pills --- */
.ee-tn-priority-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ee-tn-prio-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--ee-tn-border-strong);
    border-radius: var(--ee-tn-radius-pill);
    background: #fff;
    color: var(--ee-tn-text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
/* Monochrom: einheitlicher, gedaempfter Dot. Auswahl ueber gefuellten Zustand,
   nur ein winziger Status-Akzent fuer high/urgent. */
.ee-tn-prio-pill .ee-tn-prio-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ee-tn-text-light);
}
.ee-tn-prio-pill.prio-low    .ee-tn-prio-dot { background: var(--ee-tn-text-light); }
.ee-tn-prio-pill.prio-normal .ee-tn-prio-dot { background: var(--ee-tn-text-muted); }
.ee-tn-prio-pill.prio-high   .ee-tn-prio-dot { background: var(--ee-tn-text-secondary); }
.ee-tn-prio-pill.prio-urgent .ee-tn-prio-dot { background: var(--ee-tn-text); }
.ee-tn-prio-pill:hover:not(:disabled) {
    border-color: var(--ee-tn-primary);
    color: var(--ee-tn-primary);
}
.ee-tn-prio-pill.active {
    border-color: var(--ee-tn-primary);
    background: var(--ee-tn-accent-soft);
    color: var(--ee-tn-primary);
    font-weight: 700;
}
.ee-tn-prio-pill.active .ee-tn-prio-dot { background: var(--ee-tn-primary); }
.ee-tn-prio-pill:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Priority dot on cards */
.ee-tn-prio-indicator {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #9CA3AF;
}
.ee-tn-prio-indicator.prio-low    { background: #CBD5E1; }
.ee-tn-prio-indicator.prio-high   { background: #F59E0B; }
.ee-tn-prio-indicator.prio-urgent { background: #EF4444; }

/* ============================================================================
   POPUP-REDESIGN: kompakt, monochrom, mit Icons (Editor-Formular)
   ============================================================================ */

/* Kompaktere Sektionen + ruhigere Trenner */
.ee-tn-form-modern .ee-tn-form-section {
    padding: var(--ee-tn-space-4) var(--ee-tn-space-5);
}
.ee-tn-form-modern .ee-tn-form-section + .ee-tn-form-section {
    padding-top: var(--ee-tn-space-4);
}
/* Weniger Abstand zwischen Feldern innerhalb einer Sektion */
.ee-tn-form-modern .ee-tn-form-group {
    margin-bottom: var(--ee-tn-space-3);
    gap: 5px;
}
.ee-tn-form-modern .ee-tn-form-section > .ee-tn-form-group:last-child,
.ee-tn-form-modern .ee-tn-form-row:last-child {
    margin-bottom: 0;
}
.ee-tn-form-modern .ee-tn-form-row {
    margin-bottom: var(--ee-tn-space-3);
}
.ee-tn-form-modern .ee-tn-form-row .ee-tn-form-group {
    margin-bottom: 0;
}

/* Titel prominent */
.ee-tn-form-modern .ee-tn-title-input {
    font-size: 15px;
    font-weight: 600;
}

/* Beschreibung kompakt + auto-grow */
.ee-tn-form-modern .ee-tn-form-group textarea.ee-tn-autogrow {
    min-height: 52px;
    max-height: 220px;
    line-height: 1.45;
    resize: vertical;
    overflow-y: auto;
}

/* Icons konsistent monochrom/gedaempft */
.ee-tn-form-modern .ee-tn-form-group label svg,
.ee-tn-form-modern .ee-tn-link-label svg {
    opacity: 0.55;
    color: var(--ee-tn-text-muted);
    flex-shrink: 0;
}

/* Dezenter Herkunfts-Hinweis fuer die Zeitaufwand-Schaetzung */
.ee-tn-time-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: var(--ee-tn-radius-pill);
    background: var(--ee-tn-hover);
    color: var(--ee-tn-text-muted);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}
.ee-tn-time-hint.db,
.ee-tn-time-hint.ai {
    background: var(--ee-tn-accent-soft);
    color: var(--ee-tn-primary);
}
.ee-tn-time-hint.loading {
    opacity: 0.7;
}

/* Kompaktere Pills/Buttons im Editor */
.ee-tn-form-modern .ee-tn-time-btn {
    min-width: 34px;
    padding: 6px 10px;
    font-size: 12px;
}
.ee-tn-form-modern .ee-tn-prio-pill {
    padding: 6px 12px;
    font-size: 12px;
}
.ee-tn-form-modern .ee-tn-time-buttons,
.ee-tn-form-modern .ee-tn-priority-pills {
    gap: 6px;
}

/* Footer-Buttons: ruhige, einfarbig-orientierte Palette
   - Loeschen = dezenter Ghost (kein knalliges Rot)
   - Erledigt = Akzent statt Vollgruen */
.ee-tn-popup-footer .ee-tn-btn-danger {
    background: transparent;
    color: var(--ee-tn-text-muted);
    border-color: var(--ee-tn-border-soft);
}
.ee-tn-popup-footer .ee-tn-btn-danger:hover {
    background: var(--ee-tn-hover);
    color: var(--ee-tn-danger);
    border-color: rgba(239, 68, 68, 0.35);
}
.ee-tn-popup-footer .ee-tn-btn-success {
    background: var(--ee-tn-primary);
    color: #fff;
}
.ee-tn-popup-footer .ee-tn-btn-success:hover {
    background: var(--ee-tn-primary-hover);
    box-shadow: 0 2px 8px -2px var(--ee-tn-focus-ring);
}
.ee-tn-popup-footer .ee-tn-btn-warning {
    background: #fff;
    color: var(--ee-tn-text-secondary);
    border-color: var(--ee-tn-border-strong);
}
.ee-tn-popup-footer .ee-tn-btn-warning:hover {
    background: var(--ee-tn-hover);
    color: var(--ee-tn-text);
    box-shadow: none;
}

/* --- PHASE 4: Completion-Zeit-Dialog --- */
.ee-tn-completion-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100500;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.ee-tn-completion-overlay.active {
    opacity: 1;
}
.ee-tn-completion-dialog {
    background: var(--ee-tn-bg-solid, #fff);
    color: var(--ee-tn-text);
    border-radius: var(--ee-tn-radius-lg, 16px);
    width: 90%;
    max-width: 440px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    transform: translateY(12px) scale(0.98);
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ee-tn-completion-overlay.active .ee-tn-completion-dialog {
    transform: translateY(0) scale(1);
}
.ee-tn-completion-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 22px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.10), rgba(16, 185, 129, 0.02));
    border-bottom: 1px solid var(--ee-tn-border-soft);
}
.ee-tn-completion-header svg {
    color: var(--ee-tn-success);
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    padding: 7px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    box-sizing: border-box;
}
.ee-tn-completion-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}
.ee-tn-completion-body {
    padding: 20px 22px;
}
.ee-tn-completion-text {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ee-tn-text-secondary);
}
.ee-tn-completion-optional {
    color: var(--ee-tn-text-muted);
    font-weight: 400;
    font-style: italic;
}
.ee-tn-completion-date {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--ee-tn-border-soft);
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.ee-tn-completion-date-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ee-tn-text);
}
.ee-tn-completion-date-label::before {
    content: "";
    width: 14px;
    height: 14px;
    background-color: currentColor;
    opacity: 0.55;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ee-tn-completion-date input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ee-tn-border-strong);
    border-radius: var(--ee-tn-radius-sm, 8px);
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ee-tn-completion-date input:focus {
    outline: none;
    border-color: var(--ee-tn-success, #10B981);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.ee-tn-completion-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    background: var(--ee-tn-surface, rgba(0, 0, 0, 0.02));
    border-top: 1px solid var(--ee-tn-border-soft);
}
@media (max-width: 480px) {
    .ee-tn-completion-footer { flex-direction: column-reverse; }
    .ee-tn-completion-footer .ee-tn-btn { width: 100%; justify-content: center; }
}

/* --- Toast (Hinweise, z.B. fehlender Zeitaufwand) --- */
.ee-tn-toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100600;
    pointer-events: none;
}
.ee-tn-toast {
    padding: 12px 18px;
    border-radius: 8px;
    background: #1F2937;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    max-width: 420px;
}
.ee-tn-toast.active {
    opacity: 1;
    transform: translateY(0);
}
.ee-tn-toast-warning { background: #B45309; }
.ee-tn-toast-error   { background: #B91C1C; }
.ee-tn-toast-info    { background: #1F2937; }

/* ============================================================================
   PHASE 5/6: Org/Projekt-Verknuepfung + Folge-Aufgaben
   ============================================================================ */

/* Parent-Banner im Editor (Folge-Aufgabe von ...) */
.ee-tn-form-notice.followup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: var(--ee-tn-space-5) var(--ee-tn-space-5) 0;
    padding: 10px 14px;
    border-radius: var(--ee-tn-radius-sm);
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.22);
    color: #6D28D9;
}
.ee-tn-form-notice.followup strong {
    font-weight: 700;
}
.ee-tn-followup-notice-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

/* KI-Vorschlag-Button im Folge-Aufgaben-Banner (Phase 7) */
.ee-tn-btn-ai {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
    box-shadow: 0 1px 2px rgba(109, 40, 217, 0.3);
    transition: filter .15s ease, opacity .15s ease;
    white-space: nowrap;
}
.ee-tn-btn-ai:hover:not(:disabled) {
    filter: brightness(1.08);
}
.ee-tn-btn-ai:disabled {
    opacity: .65;
    cursor: default;
}
.ee-tn-btn-ai.loading .ee-tn-ai-icon {
    animation: ee-tn-ai-spin .9s linear infinite;
}
@keyframes ee-tn-ai-spin {
    to { transform: rotate(360deg); }
}

/* Verknuepfungs-Sektion (Organisation & Projekt) */
.ee-tn-link-section {
    background: var(--ee-tn-surface, rgba(0, 0, 0, 0.025));
    border: 1px solid var(--ee-tn-border-soft);
    border-radius: var(--ee-tn-radius, 12px);
    padding: 14px 16px;
}
.ee-tn-link-section .ee-tn-link-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--ee-tn-text-muted, #6B7280);
    margin-bottom: 12px;
}
.ee-tn-link-section .ee-tn-link-label svg { opacity: 0.8; }

/* Navigations-Buttons: Zur Organisation / Zum Projekt */
.ee-tn-link-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.ee-tn-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 0;
    min-width: 150px;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid var(--ee-tn-border, rgba(0, 0, 0, 0.15));
    border-radius: var(--ee-tn-radius-sm, 8px);
    background: var(--ee-tn-bg-solid, #fff);
    color: var(--ee-tn-text, #1F2937);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ee-tn-transition, all 0.2s ease);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.ee-tn-nav-btn .ee-tn-nav-btn-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ee-tn-nav-btn > svg:first-child {
    flex-shrink: 0;
    color: var(--ee-tn-primary, #3B82F6);
}
.ee-tn-nav-btn .ee-tn-nav-ext {
    flex-shrink: 0;
    margin-left: auto;
    opacity: 0.45;
    transition: opacity 0.15s ease;
}
.ee-tn-nav-btn:hover {
    border-color: var(--ee-tn-primary, #3B82F6);
    background: var(--ee-tn-primary, #3B82F6);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px -2px rgba(59, 130, 246, 0.4);
}
.ee-tn-nav-btn:hover > svg:first-child { color: #fff; }
.ee-tn-nav-btn:hover .ee-tn-nav-ext { opacity: 0.9; }
.ee-tn-nav-btn:active { transform: translateY(0); }
.ee-tn-nav-org-btn:hover {
    background: var(--ee-tn-success, #10B981);
    border-color: var(--ee-tn-success, #10B981);
    box-shadow: 0 4px 10px -2px rgba(16, 185, 129, 0.4);
}
@media (max-width: 480px) {
    .ee-tn-link-nav { flex-direction: column; }
    .ee-tn-nav-btn { width: 100%; flex: 1 1 100%; }
}

/* "Folge-Aufgabe erstellen"-Button-Sektion im Editor */
.ee-tn-followup-section {
    border-top: 1px dashed var(--ee-tn-border, #E5E7EB);
    padding-top: 12px;
}
.ee-tn-create-followup-btn {
    width: 100%;
    justify-content: center;
}

/* Folge-Aufgabe-Button auf der Card */
.ee-tn-task-action-btn.followup:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.25);
    color: #6D28D9;
}

/* Verknuepfungs-Buttons auf der Card (Projekt / Organisation, neuer Tab) */
.ee-tn-task-action-btn.ee-tn-project-link-btn:hover {
    background: var(--ee-tn-accent-soft);
    border-color: rgba(59, 130, 246, 0.25);
    color: var(--ee-tn-primary, #2563EB);
}
.ee-tn-task-action-btn.ee-tn-org-link-btn:hover {
    background: rgba(14, 116, 144, 0.10);
    border-color: rgba(14, 116, 144, 0.22);
    color: #0E7490;
}

/* ============================================================================
   KI-Folge-Vorschlaege als Chips ueber dem Eingabefeld (Create-Modus)
   ============================================================================ */
.ee-tn-ai-suggestions {
    margin: var(--ee-tn-space-3) var(--ee-tn-space-5) 0;
    padding: var(--ee-tn-space-3);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--ee-tn-radius-sm);
    background: rgba(139, 92, 246, 0.05);
}
.ee-tn-ai-suggestions-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #6D28D9;
}
.ee-tn-ai-suggestions-head .ee-tn-ai-icon {
    flex: 0 0 auto;
}
.ee-tn-ai-suggestions-chips,
.ee-tn-ai-suggestions-loading {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ee-tn-ai-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    max-width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--ee-tn-radius-sm);
    background: #fff;
    color: #4C1D95;
    cursor: pointer;
    text-align: left;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.ee-tn-ai-chip:hover {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.45);
}
.ee-tn-ai-chip.active {
    background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
    border-color: #6D28D9;
    color: #fff;
    box-shadow: 0 1px 3px rgba(109, 40, 217, 0.35);
}
.ee-tn-ai-chip-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
}
.ee-tn-ai-chip-meta {
    font-size: 11px;
    font-weight: 500;
    opacity: .75;
}
.ee-tn-ai-suggestions-empty {
    font-size: 12px;
    color: var(--ee-tn-text-muted, #6B7280);
    font-style: italic;
}
/* Skeleton-Lade-Chips */
.ee-tn-ai-chip-skeleton {
    width: 130px;
    height: 38px;
    border: none;
    border-radius: var(--ee-tn-radius-sm);
    background: linear-gradient(90deg, rgba(139,92,246,0.12) 25%, rgba(139,92,246,0.22) 37%, rgba(139,92,246,0.12) 63%);
    background-size: 400% 100%;
    animation: ee-tn-ai-skeleton 1.2s ease-in-out infinite;
    cursor: default;
}
.ee-tn-ai-chip-skeleton:nth-child(2) { width: 160px; }
.ee-tn-ai-chip-skeleton:nth-child(3) { width: 110px; }
@keyframes ee-tn-ai-skeleton {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}
