/* ===================================
   HQ Dashboard - Styles
   OpenAI-inspired dark mode aesthetic
   =================================== */

:root {
    /* Core colors */
    --bg-primary: #0d0d0f;
    --bg-secondary: #161618;
    --bg-tertiary: #1e1e21;
    --bg-elevated: #232326;

    /* Text colors */
    --text-primary: #ececf1;
    --text-secondary: #8e8ea0;
    --text-tertiary: #6e6e80;

    /* Accent colors */
    --accent-primary: #10a37f;
    --accent-primary-hover: #1a7f64;
    --accent-amber: #f59e0b;
    --accent-purple: #a855f7;
    --accent-blue: #3b82f6;
    --accent-green: #22c55e;
    --accent-red: #ef4444;

    /* Horizon colors */
    --horizon-today: #f59e0b;
    --horizon-week: #3b82f6;
    --horizon-month: #22c55e;
    --horizon-feb28: #a855f7;
    --horizon-2026: #6e6e80;

    /* Project colors */
    --project-stage: #f97316;
    --project-revenue: #10a37f;
    --project-antigravity: #8b5cf6;
    --project-next: #06b6d4;
    --project-uni: #6b7280;

    /* Borders & shadows - softened for cleaner look */
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-default: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-default: 250ms ease;

    /* Typography Scale */
    --font-xs: 0.75rem;
    /* 12px - Small labels, hints */
    --font-sm: 0.875rem;
    /* 14px - Secondary text, metadata */
    --font-base: 1rem;
    /* 16px - Body text */
    --font-md: 1.125rem;
    /* 18px - Emphasized text */
    --font-lg: 1.25rem;
    /* 20px - Section headers */
    --font-xl: 1.5rem;
    /* 24px - Main headers */
    --font-2xl: 2rem;
    /* 32px - Page titles */
    --font-3xl: 2.5rem;
    /* 40px - Hero text */

    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Line Heights */
    --line-tight: 1.25;
    --line-normal: 1.5;
    --line-relaxed: 1.75;
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   Accessibility Improvements
   =================================== */

/* Smooth scrolling - respects user preference */
html {
    scroll-behavior: smooth;
}

/* Global focus-visible ring for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Remove default outline for mouse users, keep for keyboard */
:focus:not(:focus-visible) {
    outline: none;
}

/* Improved button focus state */
button:focus-visible,
.btn:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(16, 163, 127, 0.2);
}

/* Skip link for keyboard users */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    z-index: 9999;
    text-decoration: none;
    font-weight: 500;
}

.skip-link:focus {
    top: 8px;
}

/* Reduced motion for motion-sensitive users */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Improved color contrast for tertiary text */
.low-contrast-text,
.text-tertiary {
    color: #9e9eb0;
    /* Improved from #6e6e80 for WCAG AA */
}

/* App Container */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===================================
   Header
   =================================== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 100;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 150px;
    flex-shrink: 0;
}

.header-right {
    justify-content: flex-end;
}

.user-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-initial {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.header-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
}

/* Horizon Tabs */
.horizon-tabs {
    display: flex;
    gap: var(--space-xs);
    background: var(--bg-secondary);
    padding: var(--space-xs);
    border-radius: var(--radius-lg);
}

.tab {
    padding: var(--space-sm) var(--space-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.tab.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.tab.featured {
    position: relative;
}

.tab.featured::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--horizon-feb28);
    border-radius: 2px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.tab.featured:hover::after,
.tab.featured.active::after {
    opacity: 1;
}

/* Icon Button */
.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ===================================
   Sync Status Indicator
   =================================== */
.sync-status {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: default;
}

.sync-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.sync-icon.synced {
    background: var(--accent-primary);
    box-shadow: 0 0 6px var(--accent-primary);
}

.sync-status.synced .sync-text {
    color: var(--accent-primary);
}

.sync-icon.syncing {
    background: var(--accent-yellow);
    box-shadow: 0 0 6px var(--accent-yellow);
    animation: pulse 1.2s ease-in-out infinite;
}

.sync-status.syncing .sync-text {
    color: var(--accent-yellow);
}

.sync-icon.offline {
    background: var(--accent-red);
    box-shadow: 0 0 6px var(--accent-red);
}

.sync-status.offline .sync-text {
    color: var(--accent-red);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(0.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.sync-text {
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* ===================================
   Main Content
   =================================== */
.main {
    flex: 1;
    padding: var(--space-xl);
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.section-header h2,
.main h2 {
    font-size: var(--font-md);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.projects-section h2 {
    margin-bottom: var(--space-lg);
}

/* Add Button */
.btn-add {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-default);
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--font-sm);
    font-weight: var(--font-medium);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-add:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-default);
}

/* ===================================
   Tasks Section
   =================================== */
.tasks-section {
    margin-bottom: var(--space-2xl);
}

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

/* Task Item */
.task-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.task-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border-subtle);
}

.task-item:focus-within {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.task-item.completed {
    opacity: 0.45;
}

.task-item.completed .task-title {
    text-decoration: line-through;
}

/* Overdue Task Styling */
.task-item.overdue {
    border-left: 3px solid #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.task-item.overdue .due-date-badge {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    font-weight: 600;
}

/* Overdue Indicator in Header */
.overdue-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 20px;
    color: #ef4444;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 12px;
}

.overdue-indicator:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: scale(1.02);
}

/* ===================================
   Consolidated Create Menu (+)
   =================================== */
.create-menu-container {
    position: relative;
    margin-right: 12px;
}

.btn-create-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-create-menu:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-create-menu:active {
    transform: scale(0.95);
}

.create-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

.create-menu-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.create-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
}

.create-menu-item:hover {
    background: var(--bg-hover);
}

.create-menu-item:active {
    background: var(--bg-active);
}

.create-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.create-label {
    flex: 1;
    font-weight: 500;
}

.create-shortcut {
    font-size: 11px;
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    color: var(--text-tertiary);
    font-family: monospace;
}

/* ===================================
   Open Project Button (Icon style)
   =================================== */
.btn-open-project {
    color: var(--text-secondary);
    opacity: 0.6;
    transition: all 0.15s ease;
}

.btn-open-project:hover {
    color: var(--accent-primary, #6366f1);
    opacity: 1;
}

.project-menu-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Task Checkbox */
.task-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--text-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 2px;
}

.task-checkbox:hover {
    border-color: var(--accent-primary);
}

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

.task-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: 600;
}

/* Task Content */
.task-content {
    flex: 1;
    min-width: 0;
}

.task-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

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

/* Task Assignee */
.task-assignee {
    display: flex;
    align-items: center;
    margin-right: var(--space-sm);
}

.task-assignee-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-primary);
}

.task-assignee-initial {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
}

/* Tags */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: 4px;
    letter-spacing: 0.01em;
}

.tag.horizon-today {
    background: rgba(245, 158, 11, 0.10);
    color: var(--horizon-today);
}

.tag.horizon-week {
    background: rgba(59, 130, 246, 0.10);
    color: var(--horizon-week);
}

.tag.horizon-month {
    background: rgba(34, 197, 94, 0.10);
    color: var(--horizon-month);
}

.tag.horizon-feb28 {
    background: rgba(168, 85, 247, 0.10);
    color: var(--horizon-feb28);
}

.tag.horizon-2026 {
    background: rgba(110, 110, 128, 0.10);
    color: var(--horizon-2026);
}

.tag.project-stage2026 {
    background: rgba(249, 115, 22, 0.15);
    color: var(--project-stage);
}

.tag.project-revenue {
    background: rgba(16, 163, 127, 0.15);
    color: var(--project-revenue);
}

.tag.project-antigravity {
    background: rgba(139, 92, 246, 0.15);
    color: var(--project-antigravity);
}

.tag.project-nextautomation {
    background: rgba(6, 182, 212, 0.15);
    color: var(--project-next);
}

.tag.project-university {
    background: rgba(107, 114, 128, 0.15);
    color: var(--project-uni);
}

/* Task Actions (Swipe) */
.task-actions {
    display: flex;
    gap: var(--space-xs);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.task-item:hover .task-actions {
    opacity: 1;
}

.task-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.task-action-btn:hover {
    background: var(--bg-primary);
}

.task-action-btn.complete:hover {
    color: var(--accent-green);
}

.task-action-btn.reschedule:hover {
    color: var(--accent-blue);
}

/* Subtask indicator */
.subtask-indicator {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Due Date Badge */
.due-date-badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: rgba(16, 163, 127, 0.15);
    color: var(--accent-primary);
}

.due-date-badge.overdue {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

/* Form date input */
.form-date-input {
    padding: var(--space-sm);
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* ===================================
   Projects Grid
   =================================== */
.projects-section {
    margin-top: var(--space-xl);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
}

/* Project Card */
.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all var(--transition-default);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--project-color, var(--accent-primary));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--project-color, transparent) 0%, transparent 50%);
    opacity: 0.03;
    pointer-events: none;
}

.project-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-default);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 20px color-mix(in srgb, var(--project-color, var(--accent-primary)) 15%, transparent);
}

.project-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.project-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    font-size: 1.25rem;
}

.project-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: var(--space-xs);
}

.project-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.project-collaborators-list {
    display: flex;
    align-items: center;
    margin-left: var(--space-sm);
}

.collab-avatar-tiny {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-subtle);
    margin-left: -5px;
}

.collab-initial-tiny {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle);
    margin-left: -5px;
    font-weight: 600;
}

.project-collaborators-list :first-child {
    margin-left: 0;
}

.project-info p {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

.project-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

.project-stat {
    text-align: center;
}

.project-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.project-stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.project-next-task {
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.project-next-task span {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

/* Project Velocity Bar */
.project-velocity {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.velocity-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
}

.velocity-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--project-color, var(--accent-primary)), color-mix(in srgb, var(--project-color, var(--accent-primary)) 70%, white));
    border-radius: 3px;
    transition: width 0.4s ease;
    min-width: 2px;
}

.velocity-label {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* ===================================
   Modals
   =================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-default);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform var(--transition-default);
}

.modal.active .modal-content {
    transform: translateY(0);
}

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

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.btn-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ===================================
   Forms
   =================================== */
.form-group {
    margin-bottom: var(--space-md);
}

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

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

input[type="text"],
textarea,
select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.15);
}

textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.6;
}

/* Enhanced notes textarea for more context space */
textarea.notes-expanded,
#projectNotes,
#fullscreenNewNoteInput,
#agentPlaybook,
#agentPrompt {
    min-height: 180px;
    font-size: 0.9375rem;
    line-height: 1.7;
    padding: var(--space-md);
}

select {
    cursor: pointer;
    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='%238e8ea0' 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;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

/* Buttons */
.btn-primary {
    padding: var(--space-sm) var(--space-lg);
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
}

.btn-secondary {
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-danger {
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-danger:hover {
    background: var(--accent-red);
    color: white;
}

.btn-subtle {
    padding: var(--space-sm);
    background: transparent;
    color: var(--text-tertiary);
    border: none;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-subtle:hover {
    color: var(--text-primary);
}

/* ===================================
   Check-in Modal
   =================================== */
.checkin-content {
    max-width: 550px;
}

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

.checkin-greeting {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.checkin-date {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.checkin-section {
    margin-bottom: var(--space-lg);
}

.checkin-section label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.priority-input {
    margin-bottom: var(--space-sm);
}

/* ===================================
   Subtasks
   =================================== */
.subtask-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
}

.subtask-item input[type="text"] {
    flex: 1;
    background: transparent;
    border: none;
    padding: var(--space-xs);
}

.subtask-item input[type="text"]:focus {
    box-shadow: none;
}

.subtask-remove {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.subtask-remove:hover {
    background: var(--bg-tertiary);
    color: var(--accent-red);
}

/* ===================================
   Empty States
   =================================== */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-tertiary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state-text {
    font-size: 0.9375rem;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: var(--space-md);
        padding: var(--space-md);
    }

    .header-left,
    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .horizon-tabs {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
    }

    .main {
        padding: var(--space-md);
    }

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

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

/* ===================================
   Logo
   =================================== */
.logo-img {
    height: 48px;
    width: auto;
}

/* ===================================
   Inline Selects (Task Detail)
   =================================== */
.detail-meta {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.inline-select {
    flex: 1;
    margin-bottom: 0;
}

.inline-select label {
    font-size: 0.75rem;
    margin-bottom: var(--space-xs);
}

.inline-select select {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8125rem;
}

/* Linked Files Section */
.linked-files-section {
    margin-top: var(--space-md);
}

.linked-files-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
    max-height: 150px;
    overflow-y: auto;
}

.linked-file-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
}

.linked-file-item .file-icon {
    font-size: 1rem;
}

.linked-file-item .file-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.linked-file-item .unlink-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 2px;
    opacity: 0.6;
    transition: var(--transition-fast);
}

.linked-file-item .unlink-btn:hover {
    color: var(--accent-red);
    opacity: 1;
}

.empty-hint {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-style: italic;
}

/* File Selection Modal (for linking) */
.file-select-list {
    max-height: 300px;
    overflow-y: auto;
}

.file-select-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.file-select-item:hover {
    background: var(--bg-tertiary);
}

.file-select-item.selected {
    background: rgba(var(--accent-primary-rgb), 0.15);
}

/* ===================================
   Large Modal (Project Detail)
   =================================== */
.modal-large .modal-content {
    max-width: 900px;
    width: 95%;
    max-height: 95vh;
}

.project-modal-content {
    max-width: 900px;
    width: 95%;
}

.project-modal-title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.project-modal-icon {
    font-size: 2rem;
}

.project-modal-title h3 {
    margin: 0;
}

.project-modal-title p {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin: 0;
}

.project-modal-body {
    margin-top: var(--space-lg);
}

.project-modal-stats {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    flex: 1;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card.stat-warning {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.stat-card.stat-warning .stat-value {
    color: var(--accent-red);
}

.stat-card.stat-upcoming {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.stat-card.stat-upcoming .stat-value {
    color: var(--accent-yellow);
}

/* Project Agent Indicator */
.project-agent-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.project-agent-indicator .agent-icon {
    font-size: 1rem;
}

.project-agent-indicator .agent-name {
    color: var(--accent-primary);
    font-weight: 500;
}

.collaborative-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: var(--transition-fast);
    border-radius: 24px;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: var(--transition-fast);
    border-radius: 50%;
}

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

.toggle input:checked+.toggle-slider::before {
    transform: translateX(20px);
    background-color: white;
}

/* Toggle Switch (standalone version) */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: var(--transition-fast);
    border-radius: 24px;
}

.toggle-switch .toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: var(--transition-fast);
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--accent-primary);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
    background-color: white;
}

/* Toggle Group (label + toggle side by side) */
.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Account Settings Sections */
.notifications-section,
.calendar-export-section {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.notifications-section h4,
.calendar-export-section h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.section-hint {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}


/* Project Modal Sections */
.project-modal-section {
    margin-bottom: var(--space-lg);
}

.project-modal-section h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.project-tasks-list {
    max-height: 200px;
    overflow-y: auto;
}

.project-tasks-list .task-item {
    padding: var(--space-sm) var(--space-md);
}

/* Notes Editor */
.notes-hint {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
}

.notes-editor {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.notes-editor textarea {
    min-height: 300px;
    flex: 1;
    padding-right: 50px;
    resize: vertical;
}

.notes-save {
    position: absolute;
    bottom: var(--space-sm);
    right: var(--space-sm);
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-sm);
}

.notes-save:hover {
    background: var(--accent-primary-hover);
}

/* @Mention Autocomplete */
.mention-autocomplete {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10;
    margin-bottom: var(--space-xs);
}

.mention-autocomplete-item {
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transition: background var(--transition-fast);
}

.mention-autocomplete-item:hover,
.mention-autocomplete-item.active {
    background: var(--bg-tertiary);
}

.mention-autocomplete-item .task-name {
    flex: 1;
    color: var(--text-primary);
}

.mention-autocomplete-item .task-horizon {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.notes-mentions {
    margin-top: var(--space-sm);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.mention-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(16, 163, 127, 0.15);
    color: var(--accent-primary);
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
}

.mention-tag:hover {
    background: rgba(16, 163, 127, 0.25);
}

/* Color input */
input[type="color"] {
    width: 100%;
    height: 40px;
    padding: 4px;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: var(--radius-sm);
}

/* Checkbox label */
.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

/* ===================================
   Auth UI
   =================================== */
.sync-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary);
}

.sync-indicator.synced .sync-dot {
    background: var(--accent-green);
}

.sync-indicator.syncing .sync-dot {
    background: var(--accent-amber);
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.btn-auth {
    padding: var(--space-sm) var(--space-md);
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-auth:hover {
    background: var(--accent-primary-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
}

.auth-modal-content {
    max-width: 400px;
}

.auth-error {
    padding: var(--space-sm) var(--space-md);
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: var(--space-md);
}

.user-email {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-right: var(--space-sm);
}

/* Auth Required Prompt */
.auth-required {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.auth-prompt {
    text-align: center;
    padding: var(--space-2xl);
}

.auth-prompt h2 {
    font-size: 2rem;
    margin-bottom: var(--space-md);
}

.auth-prompt p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

/* Landing Page */
.landing-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}

.landing-content {
    text-align: center;
    max-width: 600px;
    padding: var(--space-2xl);
}

.landing-title {
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, #fff 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-xl);
}

.landing-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
}

/* Quick Notes - 80% smaller */
.quick-notes-label {
    font-size: 0.875rem !important;
    margin-bottom: var(--space-xs) !important;
}

.notes-hint-small {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
}

/* Project Modal - Horizon Grouping */
.project-horizon-group {
    margin-bottom: var(--space-md);
}

.horizon-header-small {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xs);
    font-weight: 600;
}

/* ===================================
   Collaboration UI
   =================================== */
.collaborators-section {
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.collaborators-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.collaborators-list {
    display: flex;
    align-items: center;
    gap: calc(var(--space-xs) * -1);
}

.collaborator-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    border: 2px solid var(--bg-elevated);
    margin-left: -6px;
}

.collaborator-avatar:first-child {
    margin-left: 0;
}

.btn-share {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-md);
}

.btn-share:hover {
    background: var(--accent-primary-hover);
}

/* Invite Modal */
.invite-modal-content {
    max-width: 450px;
}

.invite-project-name {
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

.invite-section {
    margin-bottom: var(--space-md);
}

.invite-section label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xs);
    display: block;
}

.share-link-group,
.email-invite-group {
    display: flex;
    gap: var(--space-xs);
}

.share-link-group input,
.email-invite-group input {
    flex: 1;
}

.pending-invites {
    max-height: 150px;
    overflow-y: auto;
}

.pending-invite-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
}

.pending-invite-email {
    font-size: 0.875rem;
}

.pending-invite-status {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.empty-state-small {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    font-style: italic;
}

/* Account Modal */
.account-modal-content {
    max-width: 400px;
}

.account-modal-content small {
    display: block;
    margin-top: var(--space-xs);
    color: var(--text-tertiary);
    font-size: 0.7rem;
}

/* Project Tabs */
.project-tabs {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-xs);
}

.project-tab {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.project-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.project-tab.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.tab-content {
    display: none;
}

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

/* Chat UI */
.project-chat-container {
    display: flex;
    flex-direction: column;
    height: 400px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.chat-messages-scroll {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.chat-message {
    display: flex;
    gap: var(--space-sm);
    max-width: 85%;
}

.chat-message.self {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    object-fit: cover;
}

.chat-bubble {
    background: var(--bg-primary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.4;
    position: relative;
}

.chat-message.self .chat-bubble {
    background: var(--accent-primary);
    color: white;
}

.chat-message.self .chat-bubble::after {
    border-left-color: var(--accent-primary);
}

.chat-meta {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.chat-message.self .chat-meta {
    text-align: right;
}

.chat-input-area {
    padding: var(--space-sm);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-primary);
    display: flex;
    gap: var(--space-sm);
    align-items: flex-end;
}

.chat-input-area textarea {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    color: var(--text-primary);
    resize: none;
    font-family: inherit;
    font-size: 0.875rem;
    min-height: 40px;
    max-height: 100px;
}

.chat-input-area textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.chat-input-area button {
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.profile-avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initial {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

.profile-avatar-upload {
    flex: 1;
}

.profile-avatar-upload label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--space-xs);
    display: block;
}

.profile-avatar-upload small {
    display: block;
    margin-top: var(--space-xs);
    color: var(--text-tertiary);
    font-size: 0.7rem;
}

.avatar-upload-options {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.avatar-upload-options input[type="url"] {
    flex: 1;
}

.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    white-space: nowrap;
}

.or-divider {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

/* Project Menu Dropdown */
.project-menu-wrapper {
    position: relative;
    margin-left: auto;
}

.project-menu-btn {
    opacity: 0;
    transition: opacity 0.2s;
    padding: var(--space-xs);
    color: var(--text-secondary);
}

.project-card:hover .project-menu-btn {
    opacity: 1;
}

.project-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    min-width: 120px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 100;
    display: none;
    overflow: hidden;
}

.project-menu-dropdown.show {
    display: block;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.menu-item:hover {
    background: var(--bg-hover);
}

.menu-item-danger {
    color: #ef4444;
}

.menu-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ===================================
   Redesigned Project Modal
   =================================== */
.project-modal-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.project-modal-stats {
    display: flex;
    gap: var(--space-md);
}

.project-modal-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.toggle-compact {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    cursor: pointer;
}

.toggle-compact input {
    display: none;
}

.toggle-slider-compact {
    width: 36px;
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    position: relative;
    transition: background 0.2s;
}

.toggle-slider-compact::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--text-tertiary);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s, background 0.2s;
}

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

.toggle-compact input:checked+.toggle-slider-compact::after {
    transform: translateX(16px);
    background: white;
}

.toggle-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.collaborators-inline {
    display: flex;
    gap: -4px;
}

.collab-avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    margin-left: -6px;
}

.collab-avatar-small:first-child {
    margin-left: 0;
}

.collab-initial-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 2px solid var(--bg-primary);
    margin-left: -6px;
}

.collab-initial-small:first-child {
    margin-left: 0;
}

/* Tasks Section */
.project-tasks-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    max-height: 300px;
    overflow: hidden;
}

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

.project-tasks-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-add-task {
    color: var(--text-tertiary);
}

.btn-add-task:hover {
    color: var(--primary);
}

.project-tasks-list {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
}

/* Bottom Section (Notes/Chat) */
.project-bottom-section {
    margin-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--space-md);
}

.notes-editor-compact {
    position: relative;
}

.notes-editor-compact textarea {
    width: 100%;
    min-height: 80px;
    max-height: 120px;
    resize: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    font-size: 0.875rem;
}

.chat-container-compact {
    display: flex;
    flex-direction: column;
    height: 200px;
}

.chat-container-compact .chat-messages-scroll {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.chat-input-compact {
    display: flex;
    gap: var(--space-xs);
}

.chat-input-compact textarea {
    flex: 1;
    resize: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    font-size: 0.875rem;
}

.btn-send {
    padding: var(--space-sm) var(--space-md);
}

/* ===================================
   Open Project Button & Collaborate Button
   =================================== */
.project-modal-stats-row {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.btn-open-project {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, var(--accent-primary) 0%, #0d8a6a 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(16, 163, 127, 0.3);
}

.btn-open-project:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.4);
}

.btn-collaborate {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-collaborate:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-collaborate svg {
    color: var(--accent-primary);
}

/* ===================================
   Fullscreen Project View
   =================================== */
.fullscreen-project {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-default);
}

.fullscreen-project.active {
    opacity: 1;
    visibility: visible;
}

.fullscreen-project-container {
    display: flex;
    height: calc(100vh - 56px);
    max-width: 100%;
    margin: 0;
}

/* ================================================
   NEW FLIPPED WORKSPACE LAYOUT V3
   Main Content (4 tabs) + Tasks Sidebar
   ================================================ */

.fullscreen-workspace-v2 {
    display: grid;
    grid-template-columns: 340px 1fr;
    height: calc(100vh - 56px);
    width: 100%;
    background: var(--bg-primary);
}

/* Main Content Area */
.content-main-area {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
}

/* Main Tab Navigation */
.main-tabs {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.main-tab {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.main-tab:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.main-tab.active {
    background: linear-gradient(135deg, var(--accent-primary), rgba(16, 163, 127, 0.85));
    color: white;
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.25);
}

.main-tab svg {
    width: 18px;
    height: 18px;
}

/* Main Tab Content */
.main-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl);
}

.main-tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Files Tab - Large Upload Zone */
.files-upload-zone-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xxl);
    margin-bottom: var(--space-xl);
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 180px;
}

.files-upload-zone-large:hover {
    border-color: var(--accent-primary);
    background: rgba(16, 163, 127, 0.05);
    transform: scale(1.01);
}

.files-upload-zone-large svg {
    color: var(--accent-primary);
    margin-bottom: var(--space-md);
    opacity: 0.8;
}

.files-upload-zone-large h3 {
    margin: 0 0 var(--space-sm);
    color: var(--text-primary);
    font-size: 1.25rem;
}

.files-upload-zone-large p {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* Files Grid */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-lg);
    flex: 1;
}

.files-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-xxl);
    color: var(--text-tertiary);
}

/* Notes Container */
.notes-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Notes Header Bar with Toolbar */
.notes-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: 1px solid var(--border-subtle);
}

.notes-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.notes-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.notes-format-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.notes-format-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.notes-preview-toggle {
    margin-left: var(--space-sm);
    padding-left: var(--space-sm);
    border-left: 1px solid var(--border-subtle);
}

.preview-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.preview-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

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

.notes-history-large {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-bottom: var(--space-lg);
    min-height: 300px;
}

/* Markdown Rendered Content */
.notes-history-large h1,
.notes-history-large h2,
.notes-history-large h3 {
    margin: var(--space-md) 0 var(--space-sm);
    color: var(--text-primary);
}

.notes-history-large h1 {
    font-size: 1.5rem;
}

.notes-history-large h2 {
    font-size: 1.25rem;
}

.notes-history-large h3 {
    font-size: 1.1rem;
}

.notes-history-large p {
    margin: var(--space-sm) 0;
    line-height: 1.6;
}

.notes-history-large code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
}

.notes-history-large pre {
    background: var(--bg-tertiary);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: var(--space-md) 0;
}

.notes-history-large pre code {
    background: transparent;
    padding: 0;
}

.notes-history-large ul,
.notes-history-large ol {
    margin: var(--space-sm) 0;
    padding-left: var(--space-xl);
}

.notes-history-large li {
    margin: var(--space-xs) 0;
}

.notes-history-large blockquote {
    border-left: 3px solid var(--accent-primary);
    padding-left: var(--space-md);
    margin: var(--space-md) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.notes-input-container-large {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: flex-end;
}

.notes-input-container-large textarea {
    flex: 1;
    min-width: 300px;
    min-height: 100px;
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Fira Code', 'Monaco', monospace;
    resize: vertical;
}

.notes-input-container-large textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Markdown Preview Pane */
.notes-preview-pane {
    flex: 1;
    min-width: 300px;
    min-height: 100px;
    max-height: 200px;
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-lg);
    overflow-y: auto;
}

.notes-preview-pane:empty::before {
    content: 'Preview will appear here...';
    color: var(--text-tertiary);
    font-style: italic;
}

.btn-save-note-large {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, var(--accent-primary), rgba(16, 163, 127, 0.85));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save-note-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
}

/* Agents Container */
.agents-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.agents-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.btn-assign-agent-large {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, var(--accent-primary), rgba(16, 163, 127, 0.85));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-assign-agent-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
    flex: 1;
}

.agents-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xxl);
    text-align: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    min-height: 200px;
}

.agents-empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.agents-empty-state h4 {
    margin: 0 0 var(--space-sm);
    color: var(--text-secondary);
}

.agents-empty-state p {
    margin: 0;
    color: var(--text-tertiary);
}

/* Agent Context Panel */
.agent-context-panel {
    margin-top: var(--space-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

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

.context-header h4 {
    margin: 0;
    color: var(--text-primary);
}

.btn-close-context {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-tertiary);
    cursor: pointer;
}

.context-content {
    padding: var(--space-lg);
    max-height: 300px;
    overflow-y: auto;
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages-area-large {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    min-height: 400px;
}

.empty-chat-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-tertiary);
}

.empty-chat-state .empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.empty-chat-state h4 {
    margin: 0 0 var(--space-sm);
    color: var(--text-secondary);
}

.empty-chat-state p {
    margin: 0;
}

.chat-input-container-large {
    display: flex;
    gap: var(--space-md);
}

.chat-input-container-large input {
    flex: 1;
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
}

.chat-input-container-large input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn-send-message-large {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-primary), rgba(16, 163, 127, 0.85));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-send-message-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
}

/* Tasks Sidebar */
.tasks-sidebar {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    height: 100%;
    overflow: hidden;
}

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

.tasks-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.tasks-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.task-count-badge-small {
    background: linear-gradient(135deg, var(--accent-primary), rgba(16, 163, 127, 0.7));
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

.btn-add-task-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-primary), rgba(16, 163, 127, 0.85));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-task-compact:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
}

/* Tasks List Compact */
.tasks-list-compact {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

.empty-tasks-state-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-tertiary);
}

.empty-tasks-state-compact span {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.empty-tasks-state-compact p {
    margin: 0;
    font-size: 0.85rem;
}

/* Compact Task Cards */
.task-card-compact {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-card-compact:hover {
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.task-card-compact .task-checkbox {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.task-card-compact .task-content {
    flex: 1;
    min-width: 0;
}

.task-card-compact .task-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-card-compact .task-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}


/* Sidebar Tabs */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
}

.sidebar-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.sidebar-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.sidebar-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.sidebar-tab svg {
    width: 16px;
    height: 16px;
}

/* Tab Content */
.sidebar-tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.sidebar-tab-content.active {
    display: flex;
}

/* Notes Area */
.notes-area {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.notes-history {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

.notes-input-container {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-top: 1px solid var(--border-subtle);
    align-items: flex-end;
}

.notes-input-container textarea {
    flex: 1;
    min-height: 60px;
    max-height: 120px;
    padding: var(--space-sm);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    resize: none;
}

.btn-save-note {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save-note:hover {
    background: var(--accent-primary-hover);
    transform: scale(1.05);
}

/* Chat Area */
.chat-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

.empty-chat-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    color: var(--text-tertiary);
}

.empty-chat-state p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 var(--space-xs);
}

.empty-chat-state span {
    font-size: 0.8rem;
}

.chat-input-container {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

.chat-input-container input {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.chat-input-container input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn-send-message {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-send-message:hover {
    background: var(--accent-primary-hover);
    transform: scale(1.05);
}

/* Agent Status Bar */
.agent-status-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
}

.agent-status-bar .agent-icon {
    font-size: 1.2rem;
}

.agent-status-bar .agent-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-assign-agent {
    font-size: 0.8rem;
    padding: 4px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-assign-agent:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Keep old layout CSS for backward compatibility */
/* New 3-Panel Workspace Layout */
.workspace-container {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 0;
}

/* Context Panel (Left) */
.context-panel {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.2s ease;
}

.context-panel.collapsed {
    width: 48px;
    min-width: 48px;
}

.context-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.context-panel .panel-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.panel-toggle {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.panel-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.context-agent-section {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.agent-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.agent-status .agent-icon {
    font-size: 1.2rem;
}

.agent-status .agent-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-primary);
}

.agent-thinking {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    min-height: 60px;
}

.thinking-placeholder {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    font-style: italic;
}

.context-notes-section,
.context-chat-section {
    padding: var(--space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.context-notes-section h4,
.context-chat-section h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.notes-history {
    flex: 1;
    overflow-y: auto;
    margin-bottom: var(--space-sm);
    max-height: 150px;
}

.notes-input-area {
    display: flex;
    gap: var(--space-xs);
    align-items: flex-end;
}

.notes-input-area textarea {
    flex: 1;
    resize: none;
    min-height: 60px;
    font-size: 0.85rem;
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
}

.mini-chat-messages {
    flex: 1;
    overflow-y: auto;
    max-height: 200px;
    margin-bottom: var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
}

.mini-chat-input {
    display: flex;
    gap: var(--space-xs);
}

.mini-chat-input input {
    flex: 1;
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.btn-icon {
    padding: var(--space-sm);
    background: var(--accent-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-icon:hover {
    filter: brightness(1.1);
}

/* Workspace Panel (Center) */
.workspace-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
}

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

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

.workspace-title h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.task-count {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* Task Cards Grid */
.task-cards-grid {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
    align-content: start;
}

.task-visual-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    cursor: pointer;
    transition: all 0.15s ease;
}

.task-visual-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.task-card-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.task-card-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-default);
    cursor: pointer;
    flex-shrink: 0;
}

.task-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.task-card-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.task-card-badge.due {
    background: rgba(251, 191, 36, 0.15);
    color: var(--accent-yellow);
}

.task-card-badge.overdue {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.task-card-badge.horizon {
    background: rgba(16, 163, 127, 0.15);
    color: var(--accent-primary);
}

/* Files Panel (Right) */
.files-panel {
    width: 300px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.2s ease;
}

.files-panel.collapsed {
    width: 48px;
    min-width: 48px;
}

.files-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(135deg,
            rgba(16, 163, 127, 0.05) 0%,
            transparent 100%);
}

.files-panel .panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.files-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    margin: var(--space-md);
    border: 2px dashed transparent;
    border-radius: var(--radius-xl, 16px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: var(--space-md);
    min-height: 140px;

    /* Glassmorphism effect */
    background: linear-gradient(135deg,
            rgba(16, 163, 127, 0.08) 0%,
            rgba(99, 102, 241, 0.06) 50%,
            rgba(16, 163, 127, 0.04) 100%);
    backdrop-filter: blur(8px);
    border-image: linear-gradient(135deg,
            rgba(16, 163, 127, 0.4),
            rgba(99, 102, 241, 0.3),
            rgba(16, 163, 127, 0.4)) 1;
    border-style: dashed;

    /* Subtle glow */
    box-shadow:
        0 0 20px rgba(16, 163, 127, 0.1),
        inset 0 0 20px rgba(16, 163, 127, 0.05);
}

.files-upload-zone svg {
    width: 40px;
    height: 40px;
    stroke: var(--accent-primary);
    transition: transform 0.3s ease;
}

.files-upload-zone:hover {
    background: linear-gradient(135deg,
            rgba(16, 163, 127, 0.15) 0%,
            rgba(99, 102, 241, 0.1) 50%,
            rgba(16, 163, 127, 0.08) 100%);
    box-shadow:
        0 0 30px rgba(16, 163, 127, 0.2),
        inset 0 0 30px rgba(16, 163, 127, 0.08);
    transform: scale(1.02);
}

.files-upload-zone:hover svg {
    transform: translateY(-3px);
}

.files-upload-zone.drag-over {
    background: linear-gradient(135deg,
            rgba(16, 163, 127, 0.25) 0%,
            rgba(99, 102, 241, 0.15) 50%,
            rgba(16, 163, 127, 0.12) 100%);
    box-shadow:
        0 0 40px rgba(16, 163, 127, 0.3),
        inset 0 0 40px rgba(16, 163, 127, 0.1);
    transform: scale(1.03);
}

.files-upload-zone span {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.files-upload-zone:hover span {
    color: var(--accent-primary);
}

/* Uploading state - animated */
.files-upload-zone.uploading {
    background: linear-gradient(135deg,
            rgba(245, 158, 11, 0.15) 0%,
            rgba(251, 191, 36, 0.1) 50%,
            rgba(245, 158, 11, 0.08) 100%);
    box-shadow:
        0 0 30px rgba(245, 158, 11, 0.2),
        inset 0 0 30px rgba(245, 158, 11, 0.08);
    pointer-events: none;
    animation: pulse-upload 1.5s ease-in-out infinite;
}

@keyframes pulse-upload {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.files-upload-zone.uploading span {
    color: var(--accent-amber);
}

.files-upload-zone.uploading svg {
    stroke: var(--accent-amber);
    animation: bounce-upload 1s ease-in-out infinite;
}

@keyframes bounce-upload {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Error state */
.files-upload-zone.error {
    background: linear-gradient(135deg,
            rgba(239, 68, 68, 0.15) 0%,
            rgba(248, 113, 113, 0.1) 50%,
            rgba(239, 68, 68, 0.08) 100%);
    box-shadow:
        0 0 30px rgba(239, 68, 68, 0.2),
        inset 0 0 30px rgba(239, 68, 68, 0.08);
}

.files-upload-zone.error span {
    color: var(--text-danger, #ef4444);
}

.files-upload-zone.error svg {
    stroke: var(--text-danger, #ef4444);
}

.files-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.file-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    border: 1px solid transparent;
}

.file-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-default);
    transform: translateX(4px);
}

.file-icon {
    font-size: 1.4rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
}

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

.file-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.file-actions {
    display: flex;
    gap: var(--space-xs);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.file-item:hover .file-actions {
    opacity: 1;
}

.file-view-btn,
.file-delete-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-size: 0.85rem;
    text-decoration: none;
}

.file-view-btn:hover {
    background: var(--accent-primary);
    color: white;
}

.file-delete-btn:hover {
    background: var(--text-danger, #ef4444);
}

/* Files empty state */
.files-empty-state {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-tertiary);
}

.file-item:hover .file-actions {
    opacity: 1;
}

.file-delete-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
}

.file-delete-btn:hover {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
}

/* Responsive */
@media (max-width: 1200px) {
    .workspace-container {
        grid-template-columns: 60px 1fr 60px;
    }

    .context-panel,
    .files-panel {
        width: 60px;
        min-width: 60px;
    }
}

/* Chat Sidebar */
.project-chat-sidebar {
    width: 320px;
    min-width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.chat-project-name {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.sidebar-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

.empty-state-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-tertiary);
    padding: var(--space-xl);
}

.empty-state-chat svg {
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state-chat p {
    font-size: 0.875rem;
}

.sidebar-chat-input {
    padding: var(--space-md);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: var(--space-sm);
}

.sidebar-chat-input textarea {
    flex: 1;
    resize: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
    font-family: inherit;
}

.sidebar-chat-input textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn-send-chat {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-send-chat:hover {
    background: var(--accent-primary-hover);
}

/* Main Content Area */
.project-main-content {
    flex: 1;
    padding: var(--space-xl);
    overflow-y: auto;
}

.project-main-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-xl);
}

.project-main-title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.project-main-icon {
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
}

.project-main-title h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs) 0;
}

.project-main-title p {
    font-size: 0.9375rem;
    color: var(--text-tertiary);
    margin: 0;
}

.btn-close-fullscreen {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-close-fullscreen:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

/* Project Stats in Fullscreen */
.project-main-stats {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

.main-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    min-width: 120px;
    text-align: center;
}

.main-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
}

.main-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: var(--space-xs);
}

.btn-collaborate-main {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, var(--accent-primary) 0%, #0d8a6a 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(16, 163, 127, 0.3);
    margin-left: auto;
}

.btn-collaborate-main:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(16, 163, 127, 0.4);
}

/* Tasks Section in Fullscreen */
.project-main-tasks {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.main-tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.main-tasks-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-add-main-task {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-add-main-task:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.main-tasks-list {
    max-height: 400px;
    overflow-y: auto;
}

.main-tasks-list .task-item {
    margin-bottom: var(--space-sm);
}

.main-tasks-list .empty-state-small {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-tertiary);
}

/* Notes Section in Fullscreen */
.project-main-notes {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.project-main-notes h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.project-main-notes textarea {
    width: 100%;
    min-height: 80px;
    max-height: 120px;
    resize: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    color: var(--text-primary);
    font-family: inherit;
}

.project-main-notes textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .fullscreen-project-container {
        flex-direction: column;
    }

    .project-chat-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 40vh;
    }

    .project-main-content {
        padding: var(--space-md);
    }
}

/* ===================================
   Fullscreen Header Bar (New Design)
   =================================== */
.fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-xl);
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

.fullscreen-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.fullscreen-logo-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.fullscreen-logo-btn:hover {
    background: var(--bg-hover);
}

.fullscreen-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

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

.fullscreen-project-icon {
    font-size: 1.5rem;
}

.fullscreen-project-meta h1 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.fullscreen-project-meta p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.fullscreen-stats {
    display: flex;
    gap: var(--space-sm);
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stat-badge strong {
    color: var(--text-primary);
    font-weight: 600;
}

.stat-badge.completed {
    background: rgba(16, 163, 127, 0.15);
}

.stat-badge.completed strong {
    color: var(--accent-green);
}

.fullscreen-collaborators {
    display: flex;
    align-items: center;
    gap: -8px;
}

.fullscreen-collaborators img,
.fullscreen-collaborators .collab-initial {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    margin-left: -6px;
}

.fullscreen-collaborators img:first-child,
.fullscreen-collaborators .collab-initial:first-child {
    margin-left: 0;
}

.fullscreen-collaborators .collab-initial {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    position: relative;
}

/* Presence indicator - online dot */
.presence-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    background: var(--text-tertiary);
}

.presence-indicator.online {
    background: var(--accent-green);
    animation: presence-pulse 2s ease-in-out infinite;
}

.presence-indicator.away {
    background: var(--accent-amber);
}

@keyframes presence-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.btn-invite-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--accent-green);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-invite-compact:hover {
    background: var(--accent-green-hover);
    transform: scale(1.05);
}

.btn-invite-compact svg {
    stroke: white;
}

/* Improved Notes Section */
.project-main-notes textarea {
    min-height: 200px;
}

.notes-mention-autocomplete,
.chat-mention-autocomplete {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    max-height: 150px;
    overflow-y: auto;
    z-index: 10;
    margin-bottom: 4px;
}

.notes-mentions-preview {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.notes-mentions-preview .mention-tag {
    padding: 2px 8px;
    background: rgba(16, 163, 127, 0.15);
    color: var(--accent-green);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

/* Chat message styling improvements */
.sidebar-chat-messages .chat-message {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.chat-message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-message-avatar.initial {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
}

.chat-message-content {
    flex: 1;
}

.chat-message-header {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    margin-bottom: 2px;
}

.chat-message-sender {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-message-time {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.chat-message-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.chat-message-text .task-mention {
    color: var(--accent-green);
    background: rgba(16, 163, 127, 0.1);
    padding: 0 4px;
    border-radius: 2px;
}

/* Chat avatar images */
.chat-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.chat-sender {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.chat-message.self .chat-sender {
    color: var(--accent-primary);
}

.chat-bubble {
    background: var(--bg-tertiary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-primary);
    max-width: 100%;
    word-wrap: break-word;
}

.chat-message.self .chat-bubble {
    background: rgba(16, 163, 127, 0.15);
}

.chat-meta {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.chat-message {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.chat-message.self {
    flex-direction: row-reverse;
}

.chat-message.self .chat-content {
    align-items: flex-end;
}

.chat-content {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

/* ===================================
   Expandable Task Detail View
   =================================== */
.task-item-expandable {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    overflow: hidden;
    transition: all 0.2s ease;
}

.task-item-expandable:hover {
    border-color: var(--border-hover);
}

.task-item-expandable.completed {
    opacity: 0.6;
}

.task-item-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    cursor: pointer;
}

.task-item-header:hover {
    background: var(--bg-hover);
}

.task-expand-icon {
    margin-left: auto;
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.task-item-expandable.expanded .task-expand-icon {
    transform: rotate(180deg);
}

.task-detail-panel {
    display: none;
    padding: var(--space-md);
    padding-top: 0;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
}

.task-item-expandable.expanded .task-detail-panel {
    display: block;
}

.task-detail-notes {
    margin-bottom: var(--space-md);
}

.task-detail-notes label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--space-xs);
}

.task-note-input {
    width: 100%;
    min-height: 80px;
    resize: vertical;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
    font-family: inherit;
}

.task-note-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.task-detail-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.task-horizon-select {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8125rem;
    cursor: pointer;
}

.task-horizon-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn-task-save {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--accent-green);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-task-save:hover {
    background: var(--accent-green-hover);
}

.btn-task-delete {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-xs) var(--space-sm);
    background: transparent;
    border: 1px solid var(--accent-red);
    border-radius: var(--radius-sm);
    color: var(--accent-red);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: auto;
}

.btn-task-delete:hover {
    background: var(--accent-red);
    color: white;
}

.btn-task-validate {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-xs) var(--space-sm);
    background: transparent;
    border: 1px solid var(--accent-green);
    border-radius: var(--radius-sm);
    color: var(--accent-green);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-task-validate:hover {
    background: var(--accent-green);
    color: white;
}

/* Notes header */
.notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.notes-header h3 {
    margin: 0;
}

.btn-save-notes {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-xs) var(--space-md);
    background: var(--accent-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-save-notes:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-1px);
}

/* ===================================
   @Mention Autocomplete Dropdown
   =================================== */
.chat-mention-autocomplete,
.notes-mention-autocomplete {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    margin-bottom: 4px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
}

.sidebar-chat-input {
    position: relative;
}

.project-main-notes {
    position: relative;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: background 0.15s ease;
}

.mention-item:hover,
.mention-item.selected {
    background: var(--bg-hover);
}

.mention-icon {
    font-size: 0.875rem;
}

.mention-title {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mention-horizon {
    font-size: 0.7rem;
    padding: 2px 6px;
}

/* ===================================
   Toast Notifications
   =================================== */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-info {
    border-left: 3px solid var(--accent-blue);
}

.toast-success {
    border-left: 3px solid var(--accent-green);
}

.toast-error {
    border-left: 3px solid var(--accent-red);
}

.toast-warning {
    border-left: 3px solid var(--accent-amber);
}

/* ===================================
   Split Project Notes
   =================================== */
.notes-history {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    color: var(--text-secondary);
}

.notes-history:empty::before {
    content: "No notes yet.";
    opacity: 0.5;
    font-style: italic;
}

.notes-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1rem 0;
    display: none;
    /* Hidden visually, just for structure */
}

#fullscreenNewNoteInput {
    min-height: 100px;
    resize: vertical;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    width: 100%;
    transition: border-color 0.2s;
}

#fullscreenNewNoteInput:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* ===================================
   Task Notes History Split
   =================================== */
.task-notes-history {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    min-height: 60px;
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.task-notes-history:empty::before,
.task-notes-history em {
    opacity: 0.5;
    font-style: italic;
}

/* ===================================
   Enhanced Task Panel & Mentions
   =================================== */

/* Larger task detail panel */
.task-detail-panel {
    padding: var(--space-lg) !important;
    padding-top: var(--space-md) !important;
}

/* Notes history styling with edit button */
.task-notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
}

.task-notes-header label {
    margin-bottom: 0;
}

.btn-edit-notes {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}

.btn-edit-notes:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.task-notes-history {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    min-height: 80px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.task-notes-history:empty::before,
.task-notes-history em {
    color: var(--text-tertiary);
    font-style: italic;
}

.task-notes-history[contenteditable="true"] {
    border-color: var(--accent-primary);
    outline: none;
}

/* @Mention highlighting - orange font color only */
.mention,
.task-mention {
    color: #f59e0b;
    font-weight: 600;
    background: transparent;
}

/* Mention in chat bubble - same orange */
.chat-bubble .mention {
    color: #fbbf24;
    background: transparent;
}

/* ===================================
   UI Polish Fixes
   =================================== */

/* Header profile closer to edge */
.fullscreen-header {
    padding-right: var(--space-md) !important;
}

.fullscreen-header-right {
    gap: var(--space-md);
}

/* Chat input improvements */
.sidebar-chat-input {
    padding: var(--space-sm) var(--space-md);
    align-items: flex-end;
}

.sidebar-chat-input textarea {
    min-height: 36px;
    max-height: 120px;
}

.btn-send-chat {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
}

/* Collaborator avatars in header - closer together */
.fullscreen-collaborators {
    gap: 0.25rem !important;
    margin-right: var(--space-sm);
}

/* Chat messages - tighter layout */
.chat-message {
    padding: var(--space-xs) 0;
}

.chat-message.self {
    flex-direction: row-reverse;
}

/* ===================================
   Task Assignee Styles
   =================================== */

/* Assignee badge in task header */
.task-assignee-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: auto;
    margin-right: var(--space-sm);
    border: 2px solid var(--accent-primary);
}

.task-assignee-initial {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: auto;
    margin-right: var(--space-sm);
}

/* Assignee dropdown */
.task-assignee-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8rem;
    color: var(--text-primary);
    min-width: 120px;
}

.task-assignee-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ===================================
   Main Sidebar Navigation
   =================================== */

.app-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.main-sidebar {
    width: 64px;
    min-width: 64px;
    background: rgba(0, 0, 0, 0.3);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: var(--space-sm);
    padding-top: var(--space-lg);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    align-items: center;
}

.sidebar-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: var(--space-sm);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    width: 100%;
}

.sidebar-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-tab.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-primary);
}

.sidebar-tab svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.sidebar-tab span {
    display: block;
    max-width: 56px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===================================
   Calendar Styles
   =================================== */

/* ================================================
   PREMIUM CALENDAR STYLES
   ================================================ */

.calendar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-xl);
    background: var(--bg-primary);
    overflow-y: auto;
}

/* Premium Header */
.calendar-header-premium {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.calendar-nav-premium {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.calendar-title-group {
    text-align: center;
    min-width: 220px;
}

.calendar-title-group h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.calendar-subtitle {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.calendar-nav-btn-premium {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-nav-btn-premium:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

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

.calendar-today-btn-premium {
    padding: var(--space-sm) var(--space-lg);
    background: linear-gradient(135deg, var(--accent-primary), rgba(16, 163, 127, 0.85));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
}

.calendar-today-btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 163, 127, 0.4);
}

.calendar-view-toggle-premium {
    display: flex;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 4px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.view-btn-premium {
    padding: var(--space-sm) var(--space-lg);
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn-premium:hover {
    color: var(--text-primary);
}

.view-btn-premium.active {
    background: linear-gradient(135deg, var(--accent-primary), rgba(16, 163, 127, 0.85));
    color: white;
    box-shadow: 0 2px 8px rgba(16, 163, 127, 0.3);
}

/* Day View */
.calendar-day-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.day-view-header {
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border-bottom: 1px solid var(--border-subtle);
    text-align: center;
}

.day-view-header .day-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.day-view-times {
    flex: 1;
    display: flex;
    overflow-y: auto;
}

.time-column {
    width: 70px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
}

.time-slot-label {
    height: 60px;
    padding: var(--space-sm);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: right;
}

.day-view-events {
    flex: 1;
    position: relative;
}

.day-time-row {
    height: 60px;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}

.day-time-row:hover {
    background: rgba(16, 163, 127, 0.03);
}

/* Week View Premium */
.calendar-week-view-premium {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.week-header-premium {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border-bottom: 1px solid var(--border-subtle);
}

.week-header-day {
    padding: var(--space-lg);
    text-align: center;
    border-right: 1px solid var(--border-subtle);
    transition: all 0.2s ease;
}

.week-header-day:last-child {
    border-right: none;
}

.week-header-day .day-name {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xs);
}

.week-header-day .day-date {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 auto;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.week-header-day.today .day-date {
    background: linear-gradient(135deg, var(--accent-primary), rgba(16, 163, 127, 0.85));
    color: white;
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
}

.week-header-day.today .day-name {
    color: var(--accent-primary);
}

.week-grid-premium {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex: 1;
    min-height: 400px;
}

.day-column {
    border-right: 1px solid var(--border-subtle);
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-height: 300px;
    transition: all 0.2s ease;
}

.day-column:last-child {
    border-right: none;
}

.day-column.today {
    background: rgba(16, 163, 127, 0.03);
}

.day-column:hover {
    background: rgba(16, 163, 127, 0.02);
}

/* Calendar Task Cards */
.calendar-task {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-primary);
    border-left: 4px solid var(--accent-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.calendar-task:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.calendar-task .task-title {
    font-weight: 500;
    line-height: 1.3;
}

.calendar-task.overdue {
    border-left-color: var(--accent-red);
    background: rgba(239, 68, 68, 0.08);
}

.calendar-task .task-project {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.calendar-task .task-project::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Month View Premium */
.calendar-month-view-premium {
    flex: 1;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.month-grid-premium {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-subtle);
}

.month-day-header {
    padding: var(--space-md);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
}

.month-day {
    min-height: 100px;
    padding: var(--space-sm);
    background: var(--bg-secondary);
    transition: all 0.2s ease;
    cursor: pointer;
}

.month-day:hover {
    background: var(--bg-tertiary);
}

.month-day.today {
    background: rgba(16, 163, 127, 0.05);
}

.month-day.today .month-day-number {
    background: linear-gradient(135deg, var(--accent-primary), rgba(16, 163, 127, 0.85));
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.month-day.other-month {
    opacity: 0.4;
}

.month-day-number {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.calendar-task-mini {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 2px solid var(--accent-primary);
}

.more-tasks {
    font-size: 0.7rem;
    color: var(--accent-primary);
    font-weight: 500;
}

/* Quick Add Premium */
.calendar-quick-add-premium {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.calendar-quick-add-premium input[type="text"] {
    width: 200px;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.calendar-quick-add-premium input[type="date"] {
    padding: var(--space-sm);
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.calendar-quick-add-premium input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Month View */
.calendar-month-view {
    flex: 1;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-subtle);
}

.month-day {
    background: var(--bg-secondary);
    min-height: 100px;
    padding: var(--space-xs);
}

.month-day.today {
    background: rgba(16, 163, 127, 0.1);
}

.month-day.other-month {
    opacity: 0.5;
}

.month-day-number {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.month-day.today .month-day-number {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Quick Add */
.calendar-quick-add {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    display: flex;
    gap: var(--space-sm);
    background: var(--bg-secondary);
    padding: var(--space-sm);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-default);
}

.calendar-quick-add input {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    min-width: 250px;
}

/* ===================================
   Agent Manager Styles
   =================================== */

.agent-manager-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--bg-primary);
}

.agent-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

.agent-manager-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
    padding: var(--space-xl);
    flex: 1;
}

.agents-grid .empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xxl);
    text-align: center;
    color: var(--text-tertiary);
}

.agents-grid .empty-state svg {
    margin-bottom: var(--space-lg);
    opacity: 0.5;
    color: var(--accent-primary);
}

.agents-grid .empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.agents-grid .empty-state p {
    margin-bottom: var(--space-lg);
    max-width: 300px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
}

/* Agent card (for future use) */
.agent-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all 0.2s ease;
}

.agent-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

/* ===================================
   OpenAI-Inspired Layout Overrides
   =================================== */

/* Minimal global header */
.header.header-minimal {
    padding: var(--space-sm) var(--space-lg);
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    max-width: none;
}

.header.header-minimal .logo-img {
    height: 32px;
}

.header.header-minimal .header-right {
    min-width: auto;
}

/* ChatGPT-style sidebar */
.main-sidebar {
    width: 200px;
    min-width: 200px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: var(--space-md);
    padding-top: var(--space-lg);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    align-items: stretch;
}

.sidebar-tab {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
}

.sidebar-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.sidebar-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.sidebar-tab svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.sidebar-tab.active svg {
    opacity: 1;
}

.sidebar-tab span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Content header with time horizons */
.content-header {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
}

.content-header .horizon-tabs {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 4px;
}

.content-header .horizon-tabs .tab {
    padding: 8px 16px;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
}

.content-header .header-date {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* Agent Manager minimal header adjustment */
.agent-manager-header {
    padding: var(--space-lg) var(--space-xl);
    background: rgba(0, 0, 0, 0.15);
}

/* ===================================
   Clean Full-Height Sidebar Layout
   =================================== */

/* App with no header - sidebar drives layout */
.app.app-no-header {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

/* Full-height sidebar */
.app-no-header .main-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 220px;
    min-width: 220px;
    background: #0d0d0d;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    padding: 0;
    z-index: 100;
}

/* Logo in sidebar */
.sidebar-logo {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo .logo-img {
    height: 28px;
}

/* Sidebar nav takes remaining space */
.app-no-header .sidebar-nav {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Clean sidebar tabs */
.app-no-header .sidebar-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
}

.app-no-header .sidebar-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
}

.app-no-header .sidebar-tab.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.app-no-header .sidebar-tab svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.app-no-header .sidebar-tab.active svg {
    opacity: 1;
}

.app-no-header .sidebar-tab span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* User menu at sidebar bottom */
.sidebar-bottom {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-bottom .user-menu {
    width: 100%;
}

.sidebar-bottom .btn-auth {
    width: 100%;
    justify-content: center;
}

/* App layout next to sidebar */
.app-no-header .app-layout {
    margin-left: 220px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Slim time horizon bar */
.content-header-slim {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.horizon-tabs-slim {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    padding: 3px;
}

.tab-slim {
    padding: 6px 14px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab-slim:hover {
    color: rgba(255, 255, 255, 0.8);
}

.tab-slim.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tab-slim.featured {
    color: var(--accent-primary);
}

.tab-slim.featured.active {
    background: var(--accent-primary);
    color: #fff;
}

.header-date-slim {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Main content area */
.app-no-header .main-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
}

.app-no-header .tasks-section,
.app-no-header .projects-section {
    padding: 24px 32px;
}

/* ===================================
   FINAL CLEAN LAYOUT
   Header + Sidebar + Content
   =================================== */

/* App body contains sidebar + content, below header */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar: starts at left edge, full height under header */
.app-body .main-sidebar {
    width: 200px;
    min-width: 200px;
    background: #0a0a0a;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
}

.app-body .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-body .sidebar-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
}

.app-body .sidebar-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
}

.app-body .sidebar-tab.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.app-body .sidebar-tab svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.app-body .sidebar-tab.active svg {
    opacity: 1;
}

/* Content fills rest of space */
.app-body .app-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-body .main-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Section header with inline time horizons */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    gap: 16px;
}

.section-header h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    white-space: nowrap;
}

.section-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Inline time horizon tabs */
.horizon-tabs-inline {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    padding: 2px;
}

.tab-inline {
    padding: 5px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab-inline:hover {
    color: rgba(255, 255, 255, 0.75);
}

.tab-inline.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tab-inline.featured {
    color: var(--accent-primary);
}

.tab-inline.featured.active {
    background: var(--accent-primary);
    color: #fff;
}

.header-date-inline {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
}

/* Tasks section padding */
.app-body .tasks-section {
    padding: 0;
}

.app-body .tasks-list {
    padding: 0 28px 28px;
}

/* Projects section */
.app-body .projects-section {
    padding: 0 28px 28px;
}

.app-body .projects-section .section-header {
    padding: 20px 0;
}

/* ===================================
   POLISHED FULL-SIDEBAR LAYOUT
   Sidebar full-height | Header slim | Centered horizons
   =================================== */

/* Full sidebar layout */
.app.app-full-sidebar {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

/* Sidebar: Full height, left edge, contains logo */
.app-full-sidebar .main-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 200px;
    background: #0a0a0a;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

/* Logo in sidebar - left aligned */
.app-full-sidebar .sidebar-logo {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.app-full-sidebar .sidebar-logo .logo-img {
    height: 26px;
    display: block;
}

/* Sidebar nav */
.app-full-sidebar .sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Sidebar tabs - left aligned, full text visible */
.app-full-sidebar .sidebar-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
    white-space: nowrap;
}

.app-full-sidebar .sidebar-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.85);
}

.app-full-sidebar .sidebar-tab.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.app-full-sidebar .sidebar-tab svg {
    flex-shrink: 0;
    opacity: 0.65;
}

.app-full-sidebar .sidebar-tab.active svg {
    opacity: 1;
}

/* Main area: right of sidebar */
.app-main {
    margin-left: 200px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Slim header */
.header.header-slim {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 20px;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.header.header-slim .header-right {
    min-width: auto;
}

/* Content layout */
.app-main .app-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-main .main-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Centered Time Horizon Bar */
.time-horizon-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.01);
}

.horizon-tabs-centered {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 4px;
}

.tab-hz {
    padding: 6px 14px;
    background: transparent;
    border: none;
    border-radius: 5px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab-hz:hover {
    color: rgba(255, 255, 255, 0.75);
}

.tab-hz.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tab-hz.featured {
    color: var(--accent-primary);
}

.tab-hz.featured.active {
    background: var(--accent-primary);
    color: #fff;
}

.hz-date {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
}

/* Sections */
.app-main .tasks-section,
.app-main .projects-section {
    padding: 0 28px 24px;
}

.app-main .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.app-main .section-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

/* ===================================
   FIX: Sidebar width, time horizon bg, logo alignment
   =================================== */

/* Wider sidebar for full text */
.app-full-sidebar .main-sidebar {
    width: 220px !important;
}

.app-main {
    margin-left: 220px !important;
}

/* Logo area aligned with header - same line as header bottom */
.app-full-sidebar .sidebar-logo {
    padding: 8px 16px;
    min-height: 40px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* No text truncation */
.app-full-sidebar .sidebar-tab span {
    white-space: nowrap;
    overflow: visible;
    text-overflow: unset;
}

/* Time horizon bar - transparent background like rest of content */
.time-horizon-bar {
    background: transparent !important;
    border-bottom: none;
    padding: 20px 28px 8px;
}

/* Header aligned with logo section */
.header.header-slim {
    min-height: 40px;
    padding: 8px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* ===================================
   FIX: Horizontal line alignment + vertical text alignment
   =================================== */

/* Logo and header must have same border-bottom position */
.app-full-sidebar .sidebar-logo {
    padding: 10px 16px !important;
    min-height: 44px !important;
    box-sizing: border-box;
}

.header.header-slim {
    min-height: 44px !important;
    padding: 10px 20px !important;
    box-sizing: border-box;
}

/* Sidebar nav padding - align with logo left edge */
.app-full-sidebar .sidebar-nav {
    padding: 12px 16px !important;
}

/* Tab buttons - reduce left padding so icon aligns with logo */
.app-full-sidebar .sidebar-tab {
    padding: 10px 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.app-full-sidebar .sidebar-tab:hover {
    background: rgba(255, 255, 255, 0.04) !important;
}

.app-full-sidebar .sidebar-tab.active {
    background: rgba(255, 255, 255, 0.06) !important;
}

/* ===================================
   FIX: Tab left alignment, rounded corners, line alignment
   =================================== */

/* Sidebar nav - no extra padding, just gap */
.app-full-sidebar .sidebar-nav {
    padding: 12px 8px !important;
}

/* Tab buttons - icon at left edge, rounded corners */
.app-full-sidebar .sidebar-tab {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 12px !important;
    border-radius: 8px !important;
}

/* Logo and header exact same height for line alignment */
.app-full-sidebar .sidebar-logo {
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    padding: 0 8px !important;
    display: flex !important;
    align-items: center !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.header.header-slim {
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    padding: 0 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* ===================================
   DEFINITIVE FINAL FIX - HIGHEST SPECIFICITY
   =================================== */

/* Force sidebar and header to have EXACT same visual height */
html body .app.app-full-sidebar .main-sidebar .sidebar-logo {
    height: 47px !important;
    min-height: 47px !important;
    max-height: 47px !important;
    padding: 0 8px !important;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html body .app.app-full-sidebar .app-main .header.header-slim {
    height: 47px !important;
    min-height: 47px !important;
    max-height: 47px !important;
    padding: 0 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    box-sizing: border-box !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Force sidebar tabs - NO inner padding, icon flush left */
html body .app.app-full-sidebar .main-sidebar .sidebar-nav {
    padding: 12px 10px !important;
}

html body .app.app-full-sidebar .main-sidebar .sidebar-nav .sidebar-tab {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 10px !important;
    margin: 0 !important;
    border-radius: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ===================================
   V2 LAYOUT: Full-width header, then sidebar + content
   ONE horizontal line across entire page
   =================================== */

.app.app-v2 {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* FULL WIDTH TOP BAR - ONE LINE */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 50px;
    background: #0a0a0a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
}

.top-bar-left .logo-img {
    height: 28px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* BODY: Sidebar + Content side by side */
.app-body-v2 {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* SIDEBAR V2 */
.sidebar-v2 {
    width: 220px;
    min-width: 220px;
    background: #0a0a0a;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.sidebar-nav-v2 {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* NAV BUTTONS - Icon and text LEFT ALIGNED */
.nav-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
}

.nav-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-btn.active svg {
    opacity: 1;
}

/* Content area */
.app-body-v2 .app-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-body-v2 .main-content {
    flex: 1;
    overflow-y: auto;
}

/* ===================================
   PAGE-SPECIFIC STYLES - START
   Organized by page/tab for easy maintenance
   =================================== */

/* ===================================
   PROJECTS & TASKS TAB
   =================================== */

/* Task horizon badges - more subtle, not bright colors */
#tabProjects .tag {
    font-size: 0.65rem;
    padding: 2px 6px;
    opacity: 0.7;
}

/* Only task title gets emphasis color */
#tabProjects .task-title {
    color: #fff;
    font-weight: 500;
}

/* ===================================
   PROJECT DETAIL MODAL (Team Chat Fix)
   =================================== */

/* Fix chat alignment - self messages on right */
.chat-messages-scroll {
    display: flex;
    flex-direction: column;
}

.chat-messages-scroll .chat-message {
    align-self: flex-start;
}

.chat-messages-scroll .chat-message.self {
    align-self: flex-end;
}

.chat-messages-scroll .chat-message.self .chat-content,
.chat-messages-scroll .chat-message.self .chat-bubble {
    align-items: flex-end;
    text-align: right;
}

.chat-messages-scroll .chat-message.self .chat-meta,
.chat-messages-scroll .chat-message.self .chat-sender {
    text-align: right;
    justify-content: flex-end;
}

/* ===================================
   AGENT MANAGER TAB
   Agent-specific styles only
   =================================== */

/* Agent tab specific overrides go here as needed */

/* ===================================
   LANDING PAGE (landing.html)
   Already has its own file, these are fallback styles
   =================================== */

/* Landing page specific overrides go here as needed */

/* ===================================
   PAGE-SPECIFIC STYLES - END
   =================================== */

/* ===================================
   AGENT MANAGER - Complete Styling
   =================================== */

/* Header */
#tabAgents .agents-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#tabAgents .agents-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

/* Agents Grid */
#tabAgents .agents-grid {
    padding: 28px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Empty State */
#tabAgents .agents-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

#tabAgents .agents-empty-state .empty-icon {
    margin-bottom: 20px;
    color: var(--accent-primary);
    opacity: 0.6;
}

#tabAgents .agents-empty-state h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

#tabAgents .agents-empty-state p {
    margin: 0 0 24px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
    max-width: 300px;
}

/* Outline button for empty state */
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* Agent Card */
.agent-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.agent-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.agent-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.agent-card-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.agent-card-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
}

.agent-card-status.inactive {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}

.agent-card-status.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-primary);
}

.agent-card-status.running {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.agent-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.agent-card-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
    margin-bottom: 16px;
}

.agent-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.agent-card-type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
}

/* Icon Picker */
.icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.icon-option {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.icon-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.icon-option.selected {
    border-color: var(--accent-primary);
    background: rgba(16, 185, 129, 0.1);
}

/* Modal medium size */
.modal-content.modal-md {
    max-width: 480px;
}

/* ===================================
   AGENT MANAGER - Two Column Layout
   =================================== */

/* Two column layout */
.agents-layout {
    display: flex;
    gap: 1px;
    background: rgba(255, 255, 255, 0.06);
    flex: 1;
    overflow: hidden;
}

/* Three-column v2 layout */
.agents-layout.agents-layout-v2 {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 1px;
}

/* Projects column (left) */
.projects-column {
    background: #0d0d0d;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.projects-agent-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.project-agent-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.project-agent-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.project-agent-card.selected {
    background: rgba(16, 163, 127, 0.1);
    border-color: rgba(16, 163, 127, 0.4);
    box-shadow: 0 0 20px rgba(16, 163, 127, 0.15);
}

.project-agent-card.selected .project-agent-name {
    color: #10a37f;
}

.project-agent-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.project-agent-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.project-agent-icon {
    font-size: 1.25rem;
}

.project-agent-name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.project-agent-count {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: rgba(16, 163, 127, 0.2);
    color: #10a37f;
    border-radius: 10px;
}

.project-agents-dropdown {
    padding: 8px 14px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: none;
}

.project-agents-dropdown.open {
    display: block;
}

.project-assigned-agent {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.project-assigned-agent:hover {
    background: rgba(16, 163, 127, 0.15);
}

.project-assigned-agent .agent-icon-sm {
    font-size: 0.9rem;
}

.project-assigned-agent .agent-name-sm {
    flex: 1;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.btn-assign-agent {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-assign-agent:hover {
    border-color: rgba(16, 163, 127, 0.5);
    color: #10a37f;
    background: rgba(16, 163, 127, 0.05);
}

/* Agent config column (center) */
.agent-config-column {
    background: #0d0d0d;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ============================================
   PROJECT WORKSPACE - New Center Column Design
   ============================================ */
.project-workspace-column {
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workspace-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
}

.workspace-empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.4;
}

.workspace-empty-state p {
    font-size: 1rem;
    margin: 0;
}

.workspace-empty-state p.subtle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 8px;
}

/* Project Workspace Main Container */
.project-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
}

/* Project Header */
.workspace-project-header {
    padding: 24px 20px 16px;
    background: linear-gradient(135deg, rgba(16, 163, 127, 0.08) 0%, rgba(16, 163, 127, 0.02) 100%);
    border-bottom: 1px solid rgba(16, 163, 127, 0.15);
}

.workspace-project-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.workspace-project-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 12px rgba(16, 163, 127, 0.3));
}

.workspace-project-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 0%, rgba(16, 163, 127, 0.6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Workspace Sections */
.workspace-section {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.workspace-section .section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.workspace-section .section-icon {
    font-size: 1.1rem;
    opacity: 0.8;
}

.workspace-section .section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex: 1;
}

/* Files Section */
.workspace-files-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 50px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.files-empty-hint {
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    padding: 8px;
}

.workspace-file-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.15s ease;
}

.workspace-file-chip:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.35);
}

.workspace-file-chip .file-remove {
    opacity: 0.5;
    cursor: pointer;
}

.workspace-file-chip .file-remove:hover {
    opacity: 1;
    color: #f87171;
}

/* Orchestrator Section */
.orchestrator-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.toggle-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.switch {
    position: relative;
    width: 42px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    transition: 0.3s;
}

.switch .slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transition: 0.3s;
}

.switch input:checked+.slider {
    background: rgba(16, 163, 127, 0.4);
}

.switch input:checked+.slider::before {
    transform: translateX(20px);
    background: #10a37f;
}

.orchestrator-config {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: rgba(16, 163, 127, 0.05);
    border: 1px solid rgba(16, 163, 127, 0.1);
    border-radius: 10px;
    margin-top: 12px;
    animation: fadeIn 0.2s ease;
}

/* Tasks Canvas Section */
.workspace-tasks-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.workspace-tasks-canvas {
    flex: 1;
    position: relative;
    min-height: 250px;
    background:
        radial-gradient(circle at 50% 50%, rgba(16, 163, 127, 0.03) 0%, transparent 70%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    border-radius: 12px;
    overflow: hidden;
}

/* Task Rectangle */
.workspace-task-card {
    position: absolute;
    min-width: 200px;
    max-width: 320px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    cursor: grab;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    user-select: none;
}

.workspace-task-card:hover {
    border-color: rgba(16, 163, 127, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.workspace-task-card.dragging {
    cursor: grabbing;
    opacity: 0.9;
    box-shadow: 0 12px 48px rgba(16, 163, 127, 0.2);
    border-color: rgba(16, 163, 127, 0.5);
    z-index: 100;
}

.task-card-header {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-card-title {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-card-horizon {
    font-size: 0.65rem;
    padding: 3px 8px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 4px;
    color: rgba(99, 102, 241, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Agent Chips Inside Task */
.task-card-agents {
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.task-agent-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(16, 163, 127, 0.1);
    border: 1px solid rgba(16, 163, 127, 0.2);
    border-radius: 8px;
    font-size: 0.75rem;
    color: rgba(16, 163, 127, 0.9);
    cursor: pointer;
    transition: all 0.15s ease;
}

.task-agent-chip:hover {
    background: rgba(16, 163, 127, 0.2);
    border-color: rgba(16, 163, 127, 0.4);
}

.task-agent-chip .agent-icon {
    font-size: 0.85rem;
}

.task-add-agent-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.15s ease;
}

.task-add-agent-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.6);
}

.tasks-empty-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
}

.agent-config-panel {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.config-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
}

.config-empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.config-empty-state p {
    font-size: 0.9rem;
    margin: 0;
}

.config-empty-state p.subtle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 8px;
}

/* Agent config form */
.agent-config-form {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.config-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 16px;
}

.config-icon {
    font-size: 2rem;
}

.config-title-group {
    flex: 1;
}

.config-agent-name {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0;
    margin-bottom: 4px;
}

.config-agent-name:focus {
    outline: none;
}

.config-type {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: rgba(16, 163, 127, 0.15);
    color: #10a37f;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.config-actions {
    display: flex;
    gap: 8px;
}

.config-section {
    margin-bottom: 20px;
}

.config-section label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
}

.config-select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
}

.config-section textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    resize: vertical;
    font-family: inherit;
}

.config-section textarea:focus {
    outline: none;
    border-color: rgba(16, 163, 127, 0.5);
}

/* Capabilities grid */
.capabilities-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cap-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.cap-chip:hover {
    background: rgba(255, 255, 255, 0.06);
}

.cap-chip input[type="checkbox"] {
    display: none;
}

.cap-chip:has(input:checked) {
    background: rgba(16, 163, 127, 0.15);
    border-color: rgba(16, 163, 127, 0.3);
    color: #10a37f;
}

.config-footer {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Project Context Section */
.project-context-section {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.2s ease;
}

.context-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(16, 163, 127, 0.1);
    border-radius: 8px;
    margin-bottom: 12px;
}

.context-project-icon {
    font-size: 1.25rem;
}

.context-project-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

/* Project Files List */
.project-files-list {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    min-height: 60px;
    margin-bottom: 8px;
}

.files-empty {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
}

.project-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.project-file-item .file-icon {
    font-size: 1rem;
}

.project-file-item .file-name {
    flex: 1;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-file-item .file-remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 4px;
    font-size: 0.9rem;
}

.project-file-item .file-remove:hover {
    color: #ef4444;
}

/* File Upload Zone */
.file-upload-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}

.file-upload-zone:hover {
    border-color: rgba(16, 163, 127, 0.4);
    background: rgba(16, 163, 127, 0.05);
    color: #10a37f;
}

.file-upload-zone.drag-over {
    border-color: #10a37f;
    background: rgba(16, 163, 127, 0.1);
    color: #10a37f;
}

/* Button styles */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-delete {
    color: rgba(239, 68, 68, 0.7);
}

.btn-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Agent Rules Modal */
.agent-rules-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    max-width: 90vw;
    background: #1a1a1d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.rules-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rules-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.rules-body {
    padding: 20px;
}

.rules-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 16px;
}

.rules-list {
    margin-bottom: 12px;
}

.rules-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: right;
}

/* Left column - Agents */
.agents-column {
    width: 320px;
    min-width: 280px;
    background: #0d0d0d;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.agents-layout-v2 .agents-column {
    width: auto;
}

/* Right column - Projects & Tasks */
.tasks-column {
    flex: 1;
    background: #0d0d0d;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Column headers */
.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.column-header h3 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.column-hint {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
}

/* Agents list */
.agents-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.agents-list .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.agents-list .empty-state p {
    margin: 8px 0 16px;
    font-size: 0.8rem;
}

/* Agent item in list */
.agent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.agent-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.agent-item.selected {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--accent-primary);
}

.agent-item-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.agent-item-info {
    flex: 1;
    min-width: 0;
}

.agent-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-item-type {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    text-transform: capitalize;
}

.agent-item-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.agent-item-status.active {
    background: var(--accent-primary);
}

.agent-item-status.running {
    background: #3b82f6;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Projects tree */
.projects-tree {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px;
}

.project-tree-item {
    margin-bottom: 16px;
}

.project-tree-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.9rem;
}

.project-tree-header .project-icon {
    font-size: 1rem;
}

.task-tree-list {
    margin-left: 24px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding-left: 12px;
}

.task-tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

.task-tree-item:hover {
    color: #fff;
}

.task-tree-checkbox {
    width: 14px;
    height: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.task-tree-checkbox.completed {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.task-tree-title {
    flex: 1;
}

.task-tree-title.completed {
    text-decoration: line-through;
    opacity: 0.5;
}

.task-assign-btn {
    opacity: 0;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.task-tree-item:hover .task-assign-btn {
    opacity: 1;
}

.task-assign-btn:hover {
    background: var(--accent-primary);
    color: #fff;
}

.task-agent-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--accent-primary);
}

/* Agent Detail Panel */
.agent-detail-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 400px;
    background: #0d0d0d;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 200;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-icon {
    font-size: 2rem;
}

.detail-title h3 {
    margin: 0 0 4px;
    font-size: 1.1rem;
    color: #fff;
}

.detail-type {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    text-transform: capitalize;
}

.detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h4 {
    margin: 0 0 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.config-row {
    margin-bottom: 16px;
}

.config-row label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.config-row select,
.config-row textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.875rem;
}

.config-row textarea {
    resize: vertical;
    min-height: 80px;
}

.linked-tasks {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 12px;
}

.linked-tasks .empty-hint {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.8rem;
    text-align: center;
    margin: 0;
}

.detail-actions {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-actions .btn-subtle {
    flex: 1;
}

.detail-actions .btn-primary {
    flex: 2;
}

/* ===================================
   AGENT MANAGER - Enhanced Styling
   =================================== */

/* Project tree expand icon */
.project-tree-header .expand-icon {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.project-tree-header {
    cursor: pointer;
    padding: 10px 0;
}

.project-tree-header:hover {
    color: #fff;
}

.project-name {
    flex: 1;
}

.project-count {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    margin-left: auto;
}

/* Agent Detail Panel - FULL SCREEN */
.agent-detail-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    background: #0d0d0d;
    z-index: 100;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.agent-detail-panel .detail-header {
    padding: 20px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.agent-detail-panel .detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.agent-detail-panel .detail-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 20px;
}

.agent-detail-panel .detail-section.full-width {
    grid-column: 1 / -1;
}

/* Make agents-layout relative for full-screen panel */
.agent-manager-content {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.agents-layout {
    flex: 1;
    overflow: hidden;
}

/* Detail header actions */
.detail-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Temperature slider */
.config-row input[type="range"] {
    flex: 1;
    accent-color: var(--accent-primary);
}

.config-row #tempValue {
    min-width: 30px;
    text-align: right;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

/* System prompt textarea in detail */
.detail-section textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 100px;
}

/* Documents list */
.documents-list {
    margin-bottom: 12px;
}

/* Linked projects */
.linked-projects {
    margin-bottom: 12px;
}

/* Small button */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

/* Project link item checkbox */
.project-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.project-link-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.project-link-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.project-link-item span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Agent dropdown for task assignment */
.agent-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.agent-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.agent-dropdown-item.unassign {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 4px;
    padding-top: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Drag-drop styling for agent items */
.agent-item[draggable="true"] {
    cursor: grab;
}

.agent-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* Project folder drag-over state */
.project-tree-item.drag-over {
    background: rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    outline: 2px dashed var(--accent-green);
}

/* Bigger project folders */
.project-tree-header {
    padding: 12px 14px;
    font-size: 0.95rem;
}

.project-tree-item {
    margin-bottom: 8px;
}

.project-name {
    font-weight: 500;
}

.project-count {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-left: auto;
}

/* Even bigger project folders */
.project-tree-header {
    padding: 16px 18px !important;
    font-size: 1rem !important;
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-tree-item {
    margin-bottom: 12px !important;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.project-icon {
    font-size: 1.2rem;
}

/* Linked agents row inside project */
.linked-agents-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(16, 185, 129, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px 6px 0 0;
    margin-bottom: 6px;
}

.linked-agents-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.linked-agent-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: default;
    transition: transform 0.15s ease;
}

.linked-agent-badge:hover {
    transform: scale(1.1);
    background: rgba(16, 185, 129, 0.3);
}

/* Task tree items slightly bigger */
.task-tree-item {
    padding: 10px 16px;
    font-size: 0.9rem;
}

/* Agent badge with name */
.linked-agent-badge,
.task-agent-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 20px;
    font-size: 0.8rem;
    color: #10b981;
}

.agent-badge-icon {
    font-size: 0.9rem;
}

.agent-badge-name {
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bigger task rows for drag-drop */
.task-tree-item {
    padding: 14px 18px !important;
    font-size: 0.95rem !important;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.task-tree-item.drag-over {
    background: rgba(16, 185, 129, 0.15);
    border-radius: 8px;
    outline: 2px dashed var(--accent-green);
}

.task-tree-title {
    flex: 1;
}

.task-drop-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    padding: 4px 10px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

/* Bigger linked agents row */
.linked-agents-row {
    padding: 14px 18px !important;
    gap: 10px !important;
    flex-wrap: wrap;
}

/* Agent remove button */
.agent-remove-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0 0 6px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.agent-remove-btn:hover {
    color: #ef4444;
}

/* Fix agent badge to show name properly */
.linked-agent-badge,
.task-agent-badge {
    display: inline-flex !important;
    align-items: center !important;
}

/* Project drop zone when no agents */
.project-drop-zone {
    padding: 16px 18px;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin: 8px 16px;
    transition: all 0.2s ease;
}

.project-drop-zone:hover,
.project-tree-item.drag-over .project-drop-zone {
    border-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}

/* BIGGER project agents badges with visible names */
.linked-agents-row {
    padding: 16px 20px !important;
    gap: 12px !important;
    background: rgba(16, 185, 129, 0.12) !important;
    border-radius: 10px;
    margin: 8px 16px 12px 16px;
}

.linked-agent-badge {
    padding: 10px 16px !important;
    font-size: 0.9rem !important;
    border-radius: 24px !important;
    background: rgba(16, 185, 129, 0.25) !important;
    border: 1px solid rgba(16, 185, 129, 0.5) !important;
}

.linked-agent-badge .agent-badge-name {
    display: inline !important;
    max-width: none !important;
    font-weight: 500;
}

.linked-agent-badge .agent-badge-icon {
    font-size: 1rem;
}

/* Connected task-agent pill design */
.task-tree-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px !important;
    margin: 6px 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.task-tree-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Task agent badge flows into task - connected capsule look */
.task-agent-badge {
    margin-left: auto;
    padding: 8px 14px !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.35)) !important;
    border-radius: 0 10px 10px 0 !important;
    margin-right: -18px !important;
    border-left: 2px solid rgba(16, 185, 129, 0.4) !important;
    border-top: none !important;
    border-bottom: none !important;
    border-right: none !important;
}

.task-agent-badge .agent-badge-name {
    display: inline !important;
    font-weight: 500;
    color: #34d399;
}

/* Drop hint styling */
.task-drop-hint {
    margin-left: auto;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0 10px 10px 0;
    margin-right: -18px;
}

/* CLEAN FIX: Reset task badges to clean look */
.task-agent-badge {
    margin-left: auto !important;
    padding: 6px 12px !important;
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    border-radius: 20px !important;
    margin-right: 0 !important;
}

.task-tree-item {
    margin: 4px 12px !important;
    border-radius: 8px !important;
}

/* FIX: Force project agent names to show */
.linked-agents-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}

.linked-agent-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 14px !important;
    background: rgba(16, 185, 129, 0.2) !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    border-radius: 20px !important;
    font-size: 0.85rem !important;
    color: #34d399 !important;
}

.linked-agent-badge .agent-badge-icon {
    font-size: 1rem !important;
    flex-shrink: 0 !important;
}

.linked-agent-badge .agent-badge-name {
    display: inline-block !important;
    max-width: 150px !important;
    overflow: visible !important;
    white-space: nowrap !important;
    font-weight: 500 !important;
    color: #34d399 !important;
}

.linked-agent-badge .agent-remove-btn {
    color: rgba(255, 255, 255, 0.5) !important;
    margin-left: 4px !important;
}


/* ============================================
   AGENT DETAIL PANEL - NEW COMPONENTS
   ============================================ */

/* Section hint text */
.section-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.tool-option {
    display: flex;
    flex-direction: column;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.tool-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.tool-option input[type="checkbox"] {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 18px;
    height: 18px;
    accent-color: #10b981;
}

.tool-option input[type="checkbox"]:checked+.tool-icon {
    transform: scale(1.1);
}

.tool-option:has(input:checked) {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.4);
}

.tool-icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
    transition: transform 0.2s ease;
}

.tool-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2px;
}

.tool-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* File Upload Zone - Enhanced & Prominent */
.file-upload-zone {
    border: 2px dashed rgba(16, 185, 129, 0.4);
    border-radius: 16px;
    padding: 48px 32px;
    text-align: center;
    transition: all 0.25s ease;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.03), rgba(16, 185, 129, 0.08));
    position: relative;
    overflow: hidden;
}

.file-upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.file-upload-zone:hover,
.file-upload-zone.drag-over {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.15));
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.15);
}

.file-upload-zone:hover::before,
.file-upload-zone.drag-over::before {
    opacity: 1;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.upload-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 8px rgba(16, 185, 129, 0.3));
}

.upload-placeholder p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9375rem;
}

.upload-link {
    color: #10b981;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}

.upload-hint {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Uploaded Files List */
.uploaded-files {
    margin-top: 12px;
}

.uploaded-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 8px;
}

.file-type-icon {
    font-size: 1.2rem;
}

.file-info {
    flex: 1;
}

.file-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.file-size {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

.file-delete-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
}

.file-delete-btn:hover {
    color: #ef4444;
}

/* Agent Playbook Textarea */
#agentPlaybook {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-size: 0.9rem;
    resize: vertical;
}

#agentPlaybook::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

/* Compact Tool Chips */
.config-label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 12px 0 8px 0;
}

.tools-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tool-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.tool-chip input[type="checkbox"] {
    display: none;
}

.tool-chip:has(input:checked) {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    color: #34d399;
}

.tool-chip span {
    white-space: nowrap;
}

/* Fix linked agents row - bigger sub box */
.linked-agents-row {
    margin-top: 12px !important;
    padding: 14px 16px !important;
    background: rgba(16, 185, 129, 0.1) !important;
    border-radius: 10px !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
}

.linked-agents-label {
    font-size: 0.7rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-right: 12px !important;
    white-space: nowrap !important;
}

.linked-agent-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 10px !important;
    background: rgba(16, 185, 129, 0.25) !important;
    border-radius: 16px !important;
    font-size: 0.8rem !important;
}

/* Mini agent badges on project header */
.project-agents-badges {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
}

.mini-agent-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: default;
}

.mini-agent-badge:hover {
    background: rgba(16, 185, 129, 0.35);
    transform: scale(1.1);
}

/* Project header layout fix */
.project-tree-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-name {
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-count {
    margin-left: auto;
    flex-shrink: 0;
}

/* API Keys Section in Settings */
.api-keys-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.api-keys-section h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 600;
}

.api-keys-section .section-hint {
    margin-bottom: 16px;
}

.api-keys-section input[type="password"] {
    font-family: monospace;
    letter-spacing: 0.5px;
}

.api-keys-section small a {
    color: var(--accent-green);
}

/* Run Agent Button */
.btn-run-agent {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-run-agent:hover {
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-run-agent:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-run-agent.loading {
    position: relative;
    color: transparent;
}

.btn-run-agent.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Agent Response Modal */
.agent-response-text {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 60vh;
    overflow-y: auto;
    color: rgba(255, 255, 255, 0.9);
}

.modal-lg .modal-content {
    max-width: 700px;
}

/* Tool chips - bigger and more squared */
.tool-chip {
    padding: 10px 14px !important;
    border-radius: 8px !important;
    font-size: 0.8rem !important;
    min-width: 100px;
    justify-content: center;
}

.tools-compact {
    gap: 10px !important;
}

/* Project Agent Badges - Full display with name */
.project-agent-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 6px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    font-size: 0.75rem;
    margin-right: 6px;
}

.project-agent-badge .agent-badge-icon {
    font-size: 0.85rem;
}

.project-agent-badge .agent-badge-name {
    color: #34d399;
    font-weight: 500;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-unlink-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
    margin-left: 2px;
}

.agent-unlink-btn:hover {
    color: #ef4444;
}

.project-agents-badges {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    flex-wrap: wrap;
    gap: 4px;
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-height: 200px;
    overflow-y: auto;
    padding: var(--space-xs);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
}

.activity-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

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

.activity-text {
    color: var(--text-secondary);
    line-height: 1.4;
}

.activity-text strong {
    color: var(--text-primary);
    font-weight: 500;
}

.activity-time {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* Orchestrator Panel */
.orchestrator-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 12px;
}

.orchestrator-controls {
    display: flex;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.orchestrator-controls select {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 6px 12px;
}

.orchestrator-insights {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.orchestrator-insights h3 {
    font-size: 1rem;
    margin: 12px 0 8px 0;
    color: var(--accent-purple);
}

.orchestrator-insights ul {
    padding-left: 20px;
    margin: 8px 0;
}

.orchestrator-insights li {
    margin-bottom: 4px;
}

.project-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.project-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* ===================================
   Project Files Section
   =================================== */
.project-files-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-md) 0;
}

/* File Search Bar */
.file-search-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.file-search-bar svg {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.file-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.file-search-bar input::placeholder {
    color: var(--text-tertiary);
}

.project-file-upload {
    min-height: 120px;
    padding: 32px 24px;
}

.project-files-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-height: 250px;
    overflow-y: auto;
}

.project-file-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.project-file-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-default);
}

.project-file-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(16, 163, 127, 0.15), rgba(16, 163, 127, 0.25));
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
}

.project-file-info {
    flex: 1;
    min-width: 0;
}

.project-file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-file-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: flex;
    gap: var(--space-sm);
}

.project-file-actions {
    display: flex;
    gap: var(--space-xs);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.project-file-item:hover .project-file-actions {
    opacity: 1;
}

.project-file-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.project-file-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.project-file-btn.delete:hover {
    color: var(--accent-red);
}

/* File type icons */
.file-icon-pdf {
    color: #ef4444;
}

.file-icon-doc {
    color: #3b82f6;
}

.file-icon-xls {
    color: #22c55e;
}

.file-icon-img {
    color: #a855f7;
}

.file-icon-default {
    color: var(--text-tertiary);
}

/* Empty state for files */
.project-files-list .empty-state-small {
    text-align: center;
    padding: var(--space-lg);
    color: var(--text-tertiary);
}

.project-files-list .empty-state-small p {
    margin: 0;
    font-size: 0.875rem;
}

/* ===================================
   Skeleton Loading States
   =================================== */

/* Base skeleton animation */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            var(--bg-tertiary) 25%,
            var(--bg-elevated) 50%,
            var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* Skeleton variants */
.skeleton-text {
    height: 16px;
    margin-bottom: var(--space-sm);
}

.skeleton-text-sm {
    height: 12px;
    width: 60%;
    margin-bottom: var(--space-xs);
}

.skeleton-title {
    height: 24px;
    width: 40%;
    margin-bottom: var(--space-md);
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    height: 80px;
    margin-bottom: var(--space-md);
}

.skeleton-button {
    height: 36px;
    width: 100px;
}

/* Task skeleton */
.skeleton-task {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-sm);
}

.skeleton-task .skeleton-checkbox {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

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

/* Project card skeleton */
.skeleton-project-card {
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.skeleton-project-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.skeleton-project-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
}

/* Loading container */
.loading-container {
    padding: var(--space-xl);
}

.loading-container.hidden {
    display: none;
}

/* Content wrapper for showing/hiding */
.content-loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.content-loaded.loading {
    opacity: 0;
    pointer-events: none;
}

/* Spinner loader */
.spinner-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Pulse animation for sync indicator */
.sync-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ===================================
   Resizable Panel Handle
   =================================== */

.panel-resize-handle {
    width: 8px;
    background: transparent;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background var(--transition-fast);
    flex-shrink: 0;
    z-index: 10;
}

.panel-resize-handle:hover,
.panel-resize-handle.resizing {
    background: var(--bg-tertiary);
}

.resize-grip {
    width: 4px;
    height: 48px;
    background: var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.panel-resize-handle:hover .resize-grip,
.panel-resize-handle.resizing .resize-grip {
    background: var(--accent-primary);
    height: 64px;
    box-shadow: 0 0 8px rgba(16, 163, 127, 0.3);
}

/* Resizing states */
body.panel-resizing {
    cursor: col-resize !important;
    user-select: none;
}

body.panel-resizing * {
    pointer-events: none;
}

body.panel-resizing .panel-resize-handle {
    pointer-events: auto;
}

/* Fullscreen workspace grid update for 3-column layout */
.fullscreen-workspace-v2.resizable {
    grid-template-columns: 1fr auto minmax(240px, 500px);
}

/* ===================================
   Project Switcher (⌘+K)
   =================================== */

.project-switcher-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.project-switcher-modal.active {
    opacity: 1;
    visibility: visible;
}

.switcher-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.switcher-container {
    position: relative;
    width: 100%;
    max-width: 560px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.2s ease;
}

.project-switcher-modal.active .switcher-container {
    transform: translateY(0);
}

.switcher-input-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.switcher-icon {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.switcher-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: var(--font-lg);
    font-weight: var(--font-medium);
    outline: none;
}

.switcher-input-wrapper input::placeholder {
    color: var(--text-tertiary);
}

.switcher-shortcut {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    font-size: var(--font-xs);
    font-family: monospace;
}

.switcher-results {
    max-height: 320px;
    overflow-y: auto;
    padding: var(--space-sm);
}

.switcher-project-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.switcher-project-item:hover,
.switcher-project-item.selected {
    background: var(--bg-tertiary);
}

.switcher-project-item.selected {
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
}

.switcher-project-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
}

.switcher-project-info {
    flex: 1;
    min-width: 0;
}

.switcher-project-name {
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: 2px;
}

.switcher-project-desc {
    font-size: var(--font-sm);
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.switcher-project-stats {
    display: flex;
    gap: var(--space-sm);
}

.switcher-stat {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
    color: var(--text-secondary);
}

.switcher-footer {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-subtle);
}

.switcher-hint {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-xs);
    color: var(--text-tertiary);
}

.switcher-hint kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 var(--space-xs);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: var(--font-xs);
}

.switcher-empty {
    padding: var(--space-xl);
    text-align: center;
    color: var(--text-tertiary);
}

/* ===================================
   Breadcrumbs Navigation
   =================================== */

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-left: var(--space-md);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-secondary);
    font-size: var(--font-sm);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-item.home:hover {
    color: var(--accent-primary);
}

.breadcrumb-item.home svg {
    flex-shrink: 0;
}

.breadcrumb-item.current {
    color: var(--text-primary);
    font-weight: var(--font-medium);
}

.breadcrumb-separator {
    color: var(--text-tertiary);
    font-size: var(--font-lg);
    user-select: none;
}

/* Hide breadcrumb project info to avoid duplication */
.breadcrumbs+.fullscreen-project-info {
    display: none;
}

/* ===================================
   Agent System - Phase 3
   =================================== */

/* Agents Header Enhancement */
.agents-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.agent-count-badge {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    font-size: var(--font-sm);
    color: var(--text-tertiary);
}

/* Agent Selection Modal */
.agent-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.agent-selection-modal.active {
    opacity: 1;
    visibility: visible;
}

.agent-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.agent-modal-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    transform: translateY(-20px);
    transition: transform 0.2s ease;
}

.agent-selection-modal.active .agent-modal-container {
    transform: translateY(0);
}

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

.agent-modal-header h3 {
    margin: 0;
    font-size: var(--font-xl);
    color: var(--text-primary);
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-xs);
}

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

.agent-modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.agent-types-grid {
    display: grid;
    gap: var(--space-md);
}

.agent-type-card {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.agent-type-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.agent-type-icon {
    font-size: 2rem;
    min-width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
}

.agent-type-info {
    flex: 1;
}

.agent-type-info h4 {
    margin: 0 0 var(--space-xs) 0;
    color: var(--text-primary);
    font-size: var(--font-md);
}

.agent-type-info p {
    margin: 0;
    color: var(--text-tertiary);
    font-size: var(--font-sm);
}

.agent-type-badge {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    padding: 2px var(--space-sm);
    background: linear-gradient(135deg, var(--accent-primary), rgba(16, 163, 127, 0.7));
    color: white;
    font-size: var(--font-xs);
    font-weight: 600;
    border-radius: var(--radius-sm);
}

/* Agent Cards in Grid */
.agent-card {
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    transition: all 0.2s ease;
}

.agent-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 8px 24px rgba(16, 163, 127, 0.1);
}

.agent-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.agent-avatar {
    font-size: 1.75rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.agent-meta h4 {
    margin: 0;
    color: var(--text-primary);
}

.agent-status {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-sm);
    color: var(--text-tertiary);
}

.agent-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-success);
}

.agent-status-dot.working {
    background: var(--accent-warning);
    animation: pulse 1.5s ease-in-out infinite;
}

.agent-capabilities {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.capability-tag {
    padding: 2px var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
    color: var(--text-secondary);
}

.agent-card-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: auto;
}

.btn-agent-action {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-agent-action:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-agent-action.primary {
    background: linear-gradient(135deg, var(--accent-primary), rgba(16, 163, 127, 0.85));
    border-color: transparent;
    color: white;
}

/* Agent Insights Panel */
.agent-insights-panel {
    margin-top: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
}

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

.insights-header h4 {
    margin: 0;
    color: var(--text-primary);
}

.btn-refresh-insights {
    padding: var(--space-xs);
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-refresh-insights:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.insights-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.insight-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.insight-icon {
    font-size: 1.25rem;
}

.insight-text strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.insight-text p {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--font-sm);
}

/* Empty state first button */
.btn-assign-first {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding: var(--space-md) var(--space-xl);
    background: linear-gradient(135deg, var(--accent-primary), rgba(16, 163, 127, 0.85));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-assign-first:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 163, 127, 0.35);
}

/* ===================================
   Drag & Drop Rescheduling (Calendar)
   =================================== */

.draggable-task {
    cursor: grab;
    transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.draggable-task:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.draggable-task.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: scale(1.02);
}

.drop-target {
    background: rgba(16, 163, 127, 0.15) !important;
    border: 2px dashed var(--accent-primary) !important;
    border-radius: var(--radius-md);
}

.week-day.drop-target,
.month-day.drop-target {
    box-shadow: inset 0 0 20px rgba(16, 163, 127, 0.2);
}

/* ===================================
   Agent Activity Log (Phase 3)
   =================================== */

.agent-activity-log {
    margin-top: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.activity-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
}

.activity-log-header h4 {
    margin: 0;
    font-size: var(--font-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.activity-log-entries {
    max-height: 200px;
    overflow-y: auto;
    padding: var(--space-sm);
}

.activity-entry {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: background 0.15s ease;
}

.activity-entry:hover {
    background: var(--bg-tertiary);
}

.activity-icon {
    font-size: 1rem;
    min-width: 24px;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    margin: 0;
    font-size: var(--font-sm);
    color: var(--text-primary);
}

.activity-time {
    font-size: var(--font-xs);
    color: var(--text-tertiary);
}

.activity-empty {
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-tertiary);
    font-size: var(--font-sm);
}

/* ===================================
   FILE PREVIEW MODAL
   =================================== */

.file-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.file-preview-modal.active {
    display: flex;
}

.file-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.file-preview-container {
    position: relative;
    width: 90vw;
    height: 90vh;
    max-width: 1200px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.file-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
}

.file-preview-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.file-preview-icon {
    font-size: 1.5rem;
}

.file-preview-name {
    font-weight: 600;
    color: var(--text-primary);
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview-actions {
    display: flex;
    gap: var(--space-sm);
}

.file-preview-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.file-preview-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.file-preview-close:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.file-preview-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    overflow: auto;
    background: var(--bg-primary);
}

/* Image preview */
.file-preview-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* PDF preview */
.file-preview-content iframe,
.file-preview-content embed {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--radius-sm);
}

/* Text/code preview */
.file-preview-text {
    width: 100%;
    height: 100%;
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    overflow: auto;
    line-height: 1.6;
}

/* Unsupported file type */
.file-preview-unsupported {
    text-align: center;
    color: var(--text-secondary);
}

.file-preview-unsupported svg {
    width: 64px;
    height: 64px;
    opacity: 0.5;
    margin-bottom: var(--space-md);
}

.file-preview-unsupported p {
    margin-bottom: var(--space-lg);
}

.file-preview-unsupported a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.file-preview-unsupported a:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* ===================================
   Debug Panel
   =================================== */
.debug-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-md) 0;
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.debug-controls {
    display: flex;
    gap: var(--space-sm);
}

.debug-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.debug-sections {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-height: 400px;
    overflow-y: auto;
}

.debug-section h5 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.debug-json {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.75rem;
    color: var(--text-primary);
    overflow-x: auto;
    max-height: 150px;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

/* ===================================
   Project Agent Badges
   =================================== */
.project-agents-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-xs);
}

.agent-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.agent-badge:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.agent-badge.orchestrator {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.15));
    border-color: rgba(251, 191, 36, 0.4);
    color: var(--text-primary);
}

.agent-badge-icon {
    font-size: 0.875rem;
}

.agent-badge-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.orchestrator-crown {
    font-size: 0.625rem;
    margin-left: 2px;
}

.agent-badge-remove {
    display: none;
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0;
    margin-left: 2px;
    line-height: 1;
}

.agent-badge:hover .agent-badge-remove {
    display: inline-block;
}

.agent-badge-remove:hover {
    color: var(--danger);
}

.no-agents-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-style: italic;
}

/* Agent assignment modal - already assigned styling */
.agent-type-card.already-assigned {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--success-color);
}

.agent-type-card.already-assigned:hover {
    transform: none;
    box-shadow: none;
}

.assigned-badge {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--success-color);
    margin-top: 8px;
    font-weight: 600;
}

/* Agent description in cards */
.agent-description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 0;
    line-height: 1.4;
}

/* Orchestrator crown */
.orchestrator-crown {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 12px;
}

.agent-avatar {
    position: relative;
}


/* ===================================
   Agent Chat Messages
   =================================== */

/* Agent message styling */
.chat-message.agent-message {
    display: flex;
    gap: 12px;
    padding: 16px;
    margin: 12px 0;
    background: linear-gradient(135deg, rgba(16, 163, 127, 0.08) 0%, rgba(16, 163, 127, 0.02) 100%);
    border-left: 3px solid var(--accent-primary);
    border-radius: var(--radius-md);
    animation: agentMessageSlide 0.3s ease-out;
}

@keyframes agentMessageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.agent-message .agent-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    border-radius: var(--radius-md);
    font-size: 20px;
}

.chat-message.agent-message .chat-content {
    flex: 1;
    min-width: 0;
}

.chat-message.agent-message .agent-sender {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: var(--font-semibold);
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.chat-message.agent-message .agent-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(16, 163, 127, 0.2);
    border: 1px solid rgba(16, 163, 127, 0.3);
    border-radius: 100px;
    font-size: var(--font-xs);
    font-weight: var(--font-medium);
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-message.agent-message .agent-bubble {
    background: transparent;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 0;
}

.chat-message.agent-message .agent-bubble strong {
    color: var(--text-primary);
    font-weight: var(--font-semibold);
}

.chat-message.agent-message .agent-bubble em {
    color: var(--text-secondary);
    font-style: italic;
}

.chat-message.agent-message .chat-meta {
    margin-top: 12px;
    font-size: var(--font-xs);
    color: var(--text-tertiary);
}

/* AI Typing Indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-xs);
    color: var(--accent-primary);
    font-style: italic;
    animation: typingPulse 1.5s ease-in-out infinite;
}

@keyframes typingPulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* AI Streaming Bubble */
.ai-streaming-bubble {
    min-height: 24px;
    position: relative;
}

.ai-streaming-bubble:empty::before {
    content: '●●●';
    animation: streamingDots 1.2s ease-in-out infinite;
    opacity: 0.5;
}

@keyframes streamingDots {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.3;
    }
}

.ai-streaming-bubble p {
    margin: 0 0 12px 0;
}

.ai-streaming-bubble p:last-child {
    margin-bottom: 0;
}

.ai-streaming-bubble ul,
.ai-streaming-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

.ai-streaming-bubble code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.ai-streaming-bubble pre {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

.ai-streaming-bubble pre code {
    background: transparent;
    padding: 0;
}

/* ===================================
   Enhanced Mention Dropdown
   =================================== */

.mention-section-header {
    padding: 8px 12px 6px;
    font-size: var(--font-xs);
    font-weight: var(--font-semibold);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle);
    margin-top: 4px;
}

.mention-section-header:first-child {
    margin-top: 0;
}

.mention-item.completed {
    opacity: 0.7;
}

.mention-item.completed .mention-icon {
    color: var(--accent-green);
}

.mention-item.completed .mention-title {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* ===================================
   Project Onboarding Wizard
   =================================== */

.modal-wizard {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Progress Steps */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    opacity: 0.5;
    transition: all var(--transition-default);
}

.wizard-step.active,
.wizard-step.completed {
    opacity: 1;
}

.wizard-step .step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-sm);
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    transition: all var(--transition-default);
}

.wizard-step.active .step-number {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.wizard-step.completed .step-number {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

.wizard-step.completed .step-number::before {
    content: '✓';
}

.wizard-step .step-label {
    font-size: var(--font-xs);
    color: var(--text-tertiary);
    font-weight: var(--font-medium);
}

.wizard-step.active .step-label {
    color: var(--text-primary);
}

/* Wizard Panels */
.wizard-panel {
    display: none;
    padding: var(--space-xl);
    animation: fadeIn 0.3s ease;
}

.wizard-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Project Type Grid */
.project-type-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: var(--bg-primary);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.type-card:hover {
    border-color: var(--border-default);
    background: var(--bg-secondary);
}

.type-card.selected {
    border-color: var(--accent-primary);
    background: rgba(16, 163, 127, 0.1);
}

.type-card input[type="radio"] {
    display: none;
}

.type-card .type-icon {
    font-size: 1.5rem;
}

.type-card .type-name {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    text-align: center;
}

.type-card.selected .type-name {
    color: var(--accent-primary);
    font-weight: var(--font-medium);
}

/* Personality Options */
.personality-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.personality-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-primary);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.personality-card:hover {
    border-color: var(--border-default);
}

.personality-card.selected {
    border-color: var(--accent-primary);
    background: rgba(16, 163, 127, 0.1);
}

.personality-card input[type="radio"] {
    display: none;
}

.personality-card .personality-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.personality-card .personality-name {
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    display: block;
}

.personality-card .personality-desc {
    font-size: var(--font-xs);
    color: var(--text-tertiary);
    display: block;
    margin-top: 2px;
}

.personality-card.selected .personality-name {
    color: var(--accent-primary);
}

/* Milestones List */
.milestones-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.milestone-input {
    display: flex;
    gap: var(--space-sm);
}

.milestone-input input {
    flex: 1;
}

.btn-add-milestone {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-default);
    background: var(--bg-primary);
    color: var(--accent-primary);
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-add-milestone:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Wizard Hints */
.wizard-hint {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-primary);
}

.wizard-skip-hint {
    color: var(--text-tertiary);
    font-size: var(--font-xs);
    text-align: center;
    margin-top: var(--space-md);
    font-style: italic;
}

.form-hint {
    color: var(--text-tertiary);
    font-size: var(--font-xs);
    margin-top: var(--space-xs);
}

/* Wizard Navigation */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

.wizard-nav-center {
    flex: 1;
    text-align: center;
}

.wizard-page-indicator {
    font-size: var(--font-sm);
    color: var(--text-tertiary);
}

/* Form textarea improvements */
#createProjectForm textarea {
    min-height: 80px;
    resize: vertical;
}

/* ===================================
   AGENT WORK DASHBOARD (Phase 4)
   =================================== */

.agent-work-dashboard {
    margin-top: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.work-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
}

.work-dashboard-header h4 {
    margin: 0;
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.work-dashboard-controls {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.work-dashboard-controls select {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-xs);
}

.btn-refresh-work {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-refresh-work:hover {
    background: var(--bg-primary);
}

.btn-refresh-work.spinning {
    animation: spin 1s linear infinite;
}

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

    to {
        transform: rotate(360deg);
    }
}

/* Work Stats Row */
.work-stats-row {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
}

.work-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-sm);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.work-stat .stat-value {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--accent-primary);
}

.work-stat .stat-label {
    font-size: var(--font-xs);
    color: var(--text-tertiary);
}

/* Work Output List */
.work-output-list {
    max-height: 400px;
    overflow-y: auto;
    padding: var(--space-md);
}

.work-empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    color: var(--text-tertiary);
}

.work-empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.work-empty-state h5 {
    margin: 0 0 var(--space-xs);
    color: var(--text-secondary);
}

.work-empty-state p {
    margin: 0;
    font-size: var(--font-sm);
}

/* Work Output Item */
.work-output-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.work-output-item:hover {
    border-color: var(--accent-primary);
}

.work-output-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-subtle);
}

.work-agent-icon {
    font-size: 1.2rem;
}

.work-agent-name {
    font-weight: 600;
    font-size: var(--font-sm);
    color: var(--text-primary);
}

.work-output-type {
    padding: 2px 8px;
    font-size: var(--font-xs);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.work-output-type.result {
    background: rgba(16, 163, 127, 0.15);
    color: var(--accent-primary);
}

.work-output-type.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.work-time {
    margin-left: auto;
    font-size: var(--font-xs);
    color: var(--text-tertiary);
}

.work-output-content {
    padding: var(--space-md);
    font-size: var(--font-sm);
    color: var(--text-primary);
}

.work-output-content pre {
    margin: 0;
    padding: var(--space-sm);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: var(--font-xs);
}

.work-output-content ul {
    margin: 0;
    padding-left: var(--space-lg);
}

.work-output-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-subtle);
}

.meta-tag {
    padding: 2px 6px;
    font-size: var(--font-xs);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
}

/* Create Agent Section */
.create-agent-section {
    padding: var(--space-lg);
    text-align: center;
}

.btn-create-agent {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-weight: 600;
    font-size: var(--font-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-create-agent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 163, 127, 0.3);
}

.create-icon {
    font-size: 1.2rem;
    font-weight: 700;
}

/* ===================================
   CREATE AGENT MODAL
   =================================== */

.agent-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.agent-modal-overlay.active {
    display: flex;
}

.agent-modal {
    width: 90vw;
    max-width: 600px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

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

.agent-modal-header h3 {
    margin: 0;
    font-size: var(--font-lg);
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

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

/* Template Selection */
.agent-templates {
    margin-bottom: var(--space-lg);
}

.agent-templates label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-sm);
}

.template-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.template-card:hover {
    border-color: var(--accent-primary);
    background: rgba(16, 163, 127, 0.1);
}

.template-icon {
    font-size: 1.5rem;
}

.template-name {
    font-size: var(--font-xs);
    text-align: center;
    color: var(--text-secondary);
}

/* Agent Form */
.agent-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.agent-form .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.agent-form .form-row {
    display: flex;
    gap: var(--space-md);
}

.agent-form label {
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.agent-form input,
.agent-form select,
.agent-form textarea {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-sm);
}

.agent-form input:focus,
.agent-form select:focus,
.agent-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.agent-form textarea {
    min-height: 80px;
    resize: vertical;
}

/* Icon Picker */
.icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.icon-option {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.icon-option:hover {
    background: var(--bg-primary);
}

.icon-option.selected {
    border-color: var(--accent-primary);
    background: rgba(16, 163, 127, 0.15);
}

.agent-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-subtle);
}

.agent-modal-footer .btn-secondary {
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-sm);
    cursor: pointer;
}

.agent-modal-footer .btn-primary {
    padding: var(--space-sm) var(--space-lg);
    background: var(--accent-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    font-size: var(--font-sm);
    cursor: pointer;
}

.agent-modal-footer .btn-primary:hover {
    background: var(--accent-hover);
}