        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            --success-color: #10b981;
            --warning-color: #f59e0b;
            --danger-color: #ef4444;
            --gray-100: #f7fafc;
            --gray-200: #edf2f7;
            --gray-300: #e2e8f0;
            --gray-400: #cbd5e0;
            --gray-500: #a0aec0;
            --gray-600: #718096;
            --gray-700: #4a5568;
            --gray-800: #2d3748;
            --gray-900: #1a202c;
        }

        :root[data-theme='dark'] {
            --primary-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
            --success-color: #34d399;
            --warning-color: #fbbf24;
            --danger-color: #f87171;
            --gray-100: #1f2937;
            --gray-200: #374151;
            --gray-300: #4b5563;
            --gray-400: #6b7280;
            --gray-500: #9ca3af;
            --gray-600: #d1d5db;
            --gray-700: #e5e7eb;
            --gray-800: #f3f4f6;
            --gray-900: #ffffff;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background: var(--primary-gradient);
            min-height: 100vh;
            color: var(--gray-800);
            line-height: 1.6;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 20px;
        }

        /* Header Styles */
        .dashboard-header {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(15px);
            border-radius: 24px;
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 20px;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .header-title h1 {
            font-size: 2.75em;
            font-weight: 800;
            background: var(--primary-gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 8px;
        }

        .header-subtitle {
            color: var(--gray-600);
            font-size: 1.1em;
            font-weight: 500;
        }

        .sync-controls {
            display: flex;
            gap: 15px;
            align-items: center;
            flex-wrap: wrap;
        }

        .btn {
            padding: 12px 24px;
            background: var(--primary-gradient);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
        }

        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .btn-secondary {
            background: rgba(255, 255, 255, 0.9);
            color: var(--gray-700);
            border: 2px solid var(--gray-300);
        }

        .btn-secondary:hover {
            background: white;
            border-color: var(--gray-400);
        }

        .btn-success {
            background: linear-gradient(135deg, var(--success-color), #059669);
        }

        .btn-danger {
            background: linear-gradient(135deg, var(--danger-color), #dc2626);
        }

        .hidden { display: none !important; }

        /* Connection Bar */
        .connection-bar {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(15px);
            border-radius: 24px;
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .connections-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }

        .service-connection {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 25px;
            background: var(--gray-100);
            border-radius: 16px;
            border: 2px solid transparent;
            transition: all 0.3s ease;
        }

        .service-connection:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }

        .service-connection.connected {
            background: linear-gradient(135deg, #d1fae5, #a7f3d0);
            border-color: var(--success-color);
        }

        .service-info {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .service-icon {
            font-size: 28px;
            width: 50px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 12px;
            background: white;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .service-icon img {
            width: 28px;
            height: 28px;
        }

        .service-name {
            font-weight: 700;
            font-size: 18px;
            color: var(--gray-800);
        }

        .service-desc {
            font-size: 14px;
            color: var(--gray-600);
            margin-top: 4px;
        }

        .connect-btn {
            padding: 10px 20px;
            border: 2px solid #667eea;
            background: transparent;
            color: #667eea;
            border-radius: 10px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s ease;
        }

        .connect-btn:hover {
            background: #667eea;
            color: white;
            transform: translateY(-1px);
        }

        .connect-btn.connected {
            background: var(--success-color);
            border-color: var(--success-color);
            color: white;
        }

        /* AI Summary Section */
        .ai-summary-section {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(15px);
            border-radius: 24px;
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .ai-summary {
            background: linear-gradient(135deg, #fef3c7, #fde68a);
            border-radius: 16px;
            padding: 25px;
            border-left: 4px solid var(--warning-color);
        }

        .ai-summary h3 {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 15px;
            color: var(--gray-800);
        }

        .ai-summary-content {
            color: var(--gray-700);
            line-height: 1.7;
        }

        /* Filters Section */
        .filters-section {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(15px);
            border-radius: 24px;
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .filters-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 25px;
            align-items: end;
        }

        .filter-group {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .filter-label {
            font-weight: 700;
            color: var(--gray-700);
            font-size: 14px;
            text-transform: uppercase;
            letter-spacing: 0.8px;
        }

        .filter-select, .filter-input {
            padding: 14px 18px;
            border: 2px solid var(--gray-300);
            border-radius: 12px;
            font-size: 16px;
            background: white;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 500;
        }

        .filter-select:focus, .filter-input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

        /* Tasks Section */
        .tasks-section {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(15px);
            border-radius: 24px;
            padding: 35px;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            min-height: 500px;
        }

        .tasks-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 2px solid var(--gray-200);
        }

        .tasks-title {
            color: var(--gray-800);
            font-size: 24px;
            font-weight: 800;
            margin-bottom: 8px;
        }

        .tasks-count {
            color: var(--gray-600);
            font-size: 16px;
            font-weight: 500;
        }

        .view-toggle {
            display: flex;
            gap: 12px;
        }

        .view-btn {
            padding: 10px 18px;
            border: 2px solid var(--gray-300);
            background: white;
            border-radius: 10px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .view-btn.active {
            background: #667eea;
            border-color: #667eea;
            color: white;
        }

        /* Stats Bar */
        .stats-bar {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .stat-card {
            background: var(--primary-gradient);
            color: white;
            padding: 25px;
            border-radius: 16px;
            text-align: center;
            transition: transform 0.3s ease;
        }

        .stat-card:hover {
            transform: translateY(-5px);
        }

        .stat-number {
            font-size: 36px;
            font-weight: 800;
            margin-bottom: 8px;
            display: block;
        }

        .stat-label {
            font-size: 14px;
            opacity: 0.9;
            text-transform: uppercase;
            letter-spacing: 0.8px;
            font-weight: 600;
        }

        /* Task Cards */
        .tasks-grid {
            display: grid;
            gap: 25px;
            grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
        }

        .task-card {
            background: white;
            border-radius: 20px;
            padding: 25px;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
            border: 2px solid transparent;
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }

        .task-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
            border-color: #667eea;
        }

        .task-card.completed {
            opacity: 0.6;
            background: var(--gray-100);
        }

        .task-card.completed .task-title {
            text-decoration: line-through;
            color: var(--gray-500);
        }

        .task-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 18px;
        }

        .task-source {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 14px;
            background: var(--gray-100);
            border-radius: 25px;
            font-size: 13px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .task-source.gmail { background: #fef3e2; color: #b45309; }
        .task-source.trello { background: #e0f2fe; color: #0277bd; }
        .task-source.notion { background: #f3e8ff; color: #7c3aed; }
        .task-source.gcal { background: #e8f5e8; color: #2e7d32; }

        .task-checkbox {
            width: 24px;
            height: 24px;
            cursor: pointer;
            border-radius: 6px;
            border: 2px solid var(--gray-400);
            transition: all 0.3s ease;
        }

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

        .task-priority {
            padding: 6px 12px;
            border-radius: 15px;
            font-size: 11px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .priority-high { background: #fee2e2; color: #dc2626; }
        .priority-medium { background: #fef3c7; color: #d97706; }
        .priority-low { background: #e0f2fe; color: #0284c7; }

        .task-title {
            font-size: 20px;
            font-weight: 700;
            color: var(--gray-800);
            margin-bottom: 12px;
            line-height: 1.4;
        }

        .task-description {
            color: var(--gray-600);
            font-size: 15px;
            line-height: 1.6;
            margin-bottom: 18px;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .task-ai-summary {
            background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
            border-radius: 12px;
            padding: 15px;
            margin-bottom: 15px;
            border-left: 3px solid #0284c7;
        }

        .task-ai-summary h4 {
            font-size: 12px;
            color: #0284c7;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 8px;
        }

        .task-ai-content {
            font-size: 14px;
            color: var(--gray-700);
            line-height: 1.5;
        }

        .task-suggestions {
            margin-top: 15px;
        }

        .task-suggestions h4 {
            font-size: 12px;
            color: var(--gray-600);
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 8px;
        }

        .suggestion-list {
            list-style: none;
        }

        .suggestion-list li {
            font-size: 13px;
            color: var(--gray-600);
            margin-bottom: 4px;
            padding-left: 15px;
            position: relative;
        }

        .suggestion-list li:before {
            content: "💡";
            position: absolute;
            left: 0;
        }

        .task-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 14px;
            color: var(--gray-500);
            margin-top: auto;
        }

        .task-due {
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 600;
        }

        .due-today { color: var(--danger-color); font-weight: 800; }
        .due-tomorrow { color: var(--warning-color); font-weight: 700; }
        .due-week { color: var(--success-color); }
        .due-overdue { color: var(--danger-color); font-weight: 800; }

        .task-labels {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 12px;
        }

        .task-label {
            padding: 6px 12px;
            background: var(--gray-200);
            border-radius: 15px;
            font-size: 12px;
            color: var(--gray-700);
            font-weight: 600;
        }

        /* Loading and Empty States */
        .loading-state, .empty-state {
            text-align: center;
            padding: 80px 20px;
            color: var(--gray-600);
        }

        .loading-spinner {
            width: 48px;
            height: 48px;
            border: 4px solid var(--gray-300);
            border-top: 4px solid #667eea;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 25px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .empty-state-icon {
            font-size: 64px;
            margin-bottom: 25px;
        }

        .empty-state h3 {
            font-size: 24px;
            color: var(--gray-700);
            margin-bottom: 12px;
        }

        /* Timeline View */
        .timeline-view {
            display: none;
        }

        .timeline-view.active {
            display: block;
        }

        .timeline-day {
            margin-bottom: 40px;
        }

        .timeline-date {
            font-size: 22px;
            font-weight: 800;
            color: var(--gray-800);
            margin-bottom: 20px;
            padding-bottom: 12px;
            border-bottom: 3px solid var(--gray-300);
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .timeline-tasks {
            display: grid;
            gap: 20px;
        }

        /* Custom Endpoint Modal */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(5px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }

        .modal-content {
            background: white;
            border-radius: 20px;
            padding: 35px;
            max-width: 500px;
            width: 90%;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 25px;
        }

        .modal-title {
            font-size: 24px;
            font-weight: 800;
            color: var(--gray-800);
        }

        .task-modal-body p {
            margin-bottom: 10px;
            color: var(--gray-700);
        }

        .close-btn {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: var(--gray-500);
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-label {
            display: block;
            font-weight: 600;
            color: var(--gray-700);
            margin-bottom: 8px;
        }

        .form-input {
            width: 100%;
            padding: 12px 16px;
            border: 2px solid var(--gray-300);
            border-radius: 10px;
            font-size: 16px;
            transition: border-color 0.3s ease;
        }

        .form-input:focus {
            outline: none;
            border-color: #667eea;
        }

        /* Notifications */
        .notification {
            position: fixed;
            top: 20px;
            right: 20px;
            padding: 15px 25px;
            background: white;
            border-radius: 12px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
            z-index: 1001;
            transform: translateX(100%);
            transition: transform 0.3s ease;
        }

        .notification.show {
            transform: translateX(0);
        }

        .notification.success {
            border-left: 4px solid var(--success-color);
        }

        .notification.error {
            border-left: 4px solid var(--danger-color);
        }

        /* Responsive Design */
        @media (max-width: 768px) {
            .container {
                padding: 15px;
            }

            .dashboard-header {
                flex-direction: column;
                text-align: center;
                padding: 25px;
            }

            .header-title h1 {
                font-size: 2.2em;
            }

            .connections-grid, .tasks-grid {
                grid-template-columns: 1fr;
            }

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

            .stats-bar {
                grid-template-columns: repeat(2, 1fr);
            }

            .task-card {
                padding: 20px;
            }

            .sync-controls {
                width: 100%;
                justify-content: center;
            }
        }

        @media (max-width: 480px) {
            .header-title h1 {
                font-size: 1.8em;
            }

            .stats-bar {
                grid-template-columns: 1fr;
            }

            .task-header {
                flex-direction: column;
                gap: 12px;
                align-items: flex-start;
            }
        }
