/* ============================================
   TaskForge — Apple Glass Design System
   Deep purple gradient + frosted glass panels
   ============================================ */

:root {
    /* Glass layer system */
    --glass-0:  rgba(255, 255, 255, 0.03);
    --glass-1:  rgba(255, 255, 255, 0.06);
    --glass-2:  rgba(255, 255, 255, 0.09);
    --glass-3:  rgba(255, 255, 255, 0.13);
    --glass-4:  rgba(255, 255, 255, 0.18);
    --glass-5:  rgba(255, 255, 255, 0.24);
    --glass-active: rgba(255, 255, 255, 0.14);
    --glass-hover:  rgba(255, 255, 255, 0.10);

    /* Glass borders */
    --gb-subtle:  rgba(255, 255, 255, 0.07);
    --gb-normal:  rgba(255, 255, 255, 0.12);
    --gb-strong:  rgba(255, 255, 255, 0.20);
    --gb-bright:  rgba(255, 255, 255, 0.35);

    /* Text */
    --text-primary:   rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.62);
    --text-muted:     rgba(255, 255, 255, 0.38);
    --text-dim:       rgba(255, 255, 255, 0.22);

    /* Status */
    --status-todo:     #8b9bb8;
    --status-progress: #818cf8;
    --status-review:   #fb923c;
    --status-done:     #34d399;
    --status-blocked:  #f87171;

    /* Priority */
    --priority-critical: #f87171;
    --priority-high:     #fb923c;
    --priority-medium:   #fbbf24;
    --priority-low:      #38bdf8;

    /* Workstream accents (default = all) */
    --ws-accent:     #818cf8;
    --ws-accent-rgb: 129, 140, 248;
    --ws-glow:       0 0 32px rgba(129, 140, 248, 0.25);

    /* Blue CTA (Apple-style primary) */
    --blue-1: #4F86FF;
    --blue-2: #2A5FD8;
    --blue-glow: 0 6px 28px rgba(79, 134, 255, 0.40);

    /* Layout */
    --sidebar-width:     264px;
    --sidebar-collapsed: 68px;
    --topbar-height:     60px;

    /* Radii */
    --radius-sm:   8px;
    --radius-md:   12px;
    --radius-lg:   16px;
    --radius-xl:   20px;
    --radius-2xl:  24px;
    --radius-pill: 999px;

    /* Blur */
    --blur-sm:  blur(10px);
    --blur-md:  blur(20px);
    --blur-lg:  blur(40px);

    /* Shadows */
    --shadow-sm:  0 2px 8px  rgba(0, 0, 0, 0.25);
    --shadow-md:  0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg:  0 16px 48px rgba(0, 0, 0, 0.45);
    --shadow-xl:  0 24px 80px rgba(0, 0, 0, 0.55);

    /* Transitions */
    --t-fast: 140ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-base: 240ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Legacy aliases so app.js color refs still work */
    --border:        var(--gb-normal);
    --border-strong: var(--gb-strong);
    --glow-purple:   var(--ws-glow);
    --bg-base:    rgba(255,255,255,0.04);
    --bg-raised:  rgba(255,255,255,0.07);
    --bg-surface: rgba(255,255,255,0.09);
    --bg-hover:   rgba(255,255,255,0.10);
    --bg-active:  rgba(255,255,255,0.14);
    --purple-200: #ddd6fe;
    --purple-300: #c4b5fd;
    --purple-400: #a78bfa;
    --purple-500: #8b5cf6;
    --lime-300:   #bef264;
    --lime-400:   #a3e635;
}

/* ---- Workstream overrides ---- */
body[data-workstream="marketing"] {
    --ws-accent:     #2dd4bf;
    --ws-accent-rgb: 45, 212, 191;
    --ws-glow:       0 0 32px rgba(45, 212, 191, 0.22);
}
body[data-workstream="stormveil"] {
    --ws-accent:     #a78bfa;
    --ws-accent-rgb: 167, 139, 250;
    --ws-glow:       0 0 32px rgba(167, 139, 250, 0.25);
}

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
    font-feature-settings: 'ss01', 'ss02', 'cv11', 'calt';
    letter-spacing: -0.01em;
    /* Rich purple-to-indigo gradient — matches the reference screenshots */
    background:
        radial-gradient(ellipse at 15% 0%,   #3a1a80 0%, transparent 55%),
        radial-gradient(ellipse at 85% 100%,  #0e1d6e 0%, transparent 55%),
        radial-gradient(ellipse at 50% 50%,   #1a0d54 0%, #0c0a35 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

::selection { background: rgba(129, 140, 248, 0.4); color: white; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

input, select, textarea, button { font-family: inherit; }

/* ============ Sidebar ============ */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: rgba(15, 8, 45, 0.55);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border-right: 1px solid var(--gb-subtle);
    display: flex;
    flex-direction: column;
    transition: all var(--t-base);
    z-index: 100;
    position: relative;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 1px; height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.18), transparent 40%, rgba(255,255,255,0.08) 90%, transparent);
}

.sidebar.collapsed { width: var(--sidebar-collapsed); min-width: var(--sidebar-collapsed); }

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .user-info,
.sidebar.collapsed .sidebar-search,
.sidebar.collapsed .add-project span { display: none; }

.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 18px;
    border-bottom: 1px solid var(--gb-subtle);
}

.logo { display: flex; align-items: center; gap: 11px; }
.logo-icon { flex-shrink: 0; }

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(255,255,255,0.65));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

.sidebar-toggle {
    background: var(--glass-2);
    border: 1px solid var(--gb-subtle);
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--t-fast);
    display: flex; align-items: center; justify-content: center;
}
.sidebar-toggle:hover { color: var(--text-primary); background: var(--glass-3); border-color: var(--gb-normal); }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }

.sidebar-search {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 12px 0;
    background: var(--glass-1);
    border-radius: var(--radius-pill);
    border: 1px solid var(--gb-subtle);
    transition: all var(--t-fast);
}
.sidebar-search:focus-within {
    border-color: var(--gb-normal);
    background: var(--glass-2);
    box-shadow: 0 0 0 3px rgba(var(--ws-accent-rgb), 0.12);
}
.sidebar-search svg { color: var(--text-muted); flex-shrink: 0; }
.sidebar-search input { background: none; border: none; color: var(--text-primary); font-size: 0.9rem; width: 100%; outline: none; }
.sidebar-search input::placeholder { color: var(--text-muted); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 0; }
.nav-section { margin-bottom: 10px; }

.nav-section-title {
    display: block;
    padding: 8px 20px 5px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    margin: 2px 8px;
    transition: all var(--t-fast);
    cursor: pointer;
    border: none;
    background: none;
    width: calc(100% - 16px);
    text-align: left;
}
.nav-item:hover { background: var(--glass-hover); color: var(--text-primary); }
.nav-item.active {
    background: var(--glass-active);
    color: var(--text-primary);
    border: 1px solid var(--gb-normal);
}
.nav-item.active svg { color: var(--ws-accent); }

.project-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 16px 18px;
    border-top: 1px solid var(--gb-subtle);
}

.keyboard-help {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-right: auto;
}
.sidebar.collapsed .keyboard-help { display: none; }

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #818cf8, #38bdf8);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem; color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(129, 140, 248, 0.4);
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.user-role { font-size: 0.72rem; color: var(--text-muted); }

/* ============ Workstream Switcher ============ */
.workstream-switcher {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--gb-subtle);
}

.ws-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--t-fast);
    width: 100%;
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
}
.ws-btn:hover { background: var(--glass-hover); color: var(--text-primary); }
.ws-btn.active { background: var(--glass-active); color: var(--text-primary); font-weight: 600; border: 1px solid var(--gb-normal); }

.ws-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.ws-all { background: linear-gradient(135deg, #2dd4bf, #818cf8); }
.ws-marketing { background: #2dd4bf; box-shadow: 0 0 8px rgba(45,212,191,0.5); }
.ws-stormveil { background: #a78bfa; box-shadow: 0 0 8px rgba(167,139,250,0.5); }

.sidebar.collapsed .workstream-switcher { padding: 8px 4px; }
.sidebar.collapsed .ws-label { display: none; }
.sidebar.collapsed .ws-btn { justify-content: center; padding: 10px; }

.workstream-badge {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.workstream-badge.visible { display: flex; }
.workstream-badge.ws-marketing { background: rgba(45,212,191,0.12); color: #2dd4bf; border: 1px solid rgba(45,212,191,0.25); }
.workstream-badge.ws-stormveil { background: rgba(167,139,250,0.12); color: #c4b5fd; border: 1px solid rgba(167,139,250,0.25); }

/* ============ Main Content ============ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Slight glass tint over the gradient */
    background: rgba(10, 6, 30, 0.15);
}

/* ============ Top Bar ============ */
.topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--gb-subtle);
    background: rgba(10, 6, 30, 0.3);
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.mobile-menu-btn { display: none; background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 6px; }

.page-title { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.025em; }

.task-count {
    font-size: 0.76rem;
    color: var(--text-secondary);
    background: var(--glass-2);
    border: 1px solid var(--gb-subtle);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-weight: 600;
}

.topbar-right { display: flex; align-items: center; gap: 8px; }
.filter-group { display: flex; gap: 6px; }

.filter-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    background: var(--glass-1);
    border: 1px solid var(--gb-subtle);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 0.83rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast);
}
.filter-btn:hover { background: var(--glass-2); color: var(--text-primary); border-color: var(--gb-normal); }
.filter-btn.active { background: var(--glass-3); border-color: var(--gb-strong); color: var(--text-primary); }

/* === Blue primary button (Apple Glass CTA) === */
.btn-primary {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    background: linear-gradient(135deg, var(--blue-1), var(--blue-2));
    border: none;
    border-radius: var(--radius-pill);
    color: white;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
    box-shadow: var(--blue-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #6495ff, var(--blue-1));
    box-shadow: 0 8px 32px rgba(79, 134, 255, 0.55);
    transform: translateY(-1px);
}

/* Workstream-aware btn-primary */
body[data-workstream="marketing"] .btn-primary {
    background: linear-gradient(135deg, #2dd4bf, #0d9488);
    box-shadow: 0 6px 28px rgba(45, 212, 191, 0.35);
}
body[data-workstream="marketing"] .btn-primary:hover {
    background: linear-gradient(135deg, #5eead4, #2dd4bf);
    box-shadow: 0 8px 36px rgba(45, 212, 191, 0.5);
}
body[data-workstream="stormveil"] .btn-primary {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    box-shadow: 0 6px 28px rgba(167, 139, 250, 0.35);
}
body[data-workstream="stormveil"] .btn-primary:hover {
    background: linear-gradient(135deg, #c4b5fd, #a78bfa);
    box-shadow: 0 8px 36px rgba(167, 139, 250, 0.5);
}

.btn-secondary {
    padding: 9px 20px;
    background: var(--glass-2);
    border: 1px solid var(--gb-normal);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast);
}
.btn-secondary:hover { background: var(--glass-3); color: var(--text-primary); }

/* ============ Filter Bar ============ */
.filter-bar {
    padding: 10px 24px;
    background: rgba(10, 6, 30, 0.2);
    border-bottom: 1px solid var(--gb-subtle);
    backdrop-filter: var(--blur-sm);
}
.filter-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.filter-select {
    padding: 7px 14px;
    background: var(--glass-1);
    border: 1px solid var(--gb-subtle);
    border-radius: var(--radius-pill);
    color: var(--text-primary);
    font-size: 0.83rem;
    cursor: pointer;
    outline: none;
    transition: border-color var(--t-fast);
    -webkit-appearance: none;
    appearance: none;
}
.filter-select:focus { border-color: var(--gb-strong); background: var(--glass-2); }
.filter-select option { background: #1a0d54; }

.filter-clear {
    padding: 7px 14px;
    background: none;
    border: none;
    color: rgba(var(--ws-accent-rgb), 0.8);
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--t-fast);
}
.filter-clear:hover { color: var(--ws-accent); }

/* ============ Views Container ============ */
.views-container { flex: 1; overflow: hidden; position: relative; }
.view { display: none; height: 100%; overflow: auto; }
.view.active { display: flex; }

/* ============ Board View ============ */
.board-view { padding: 20px 24px; }

.board-columns {
    display: flex;
    gap: 14px;
    height: 100%;
    min-width: max-content;
    padding-bottom: 20px;
}

.board-column {
    width: 300px;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: var(--blur-sm);
    border: 1px solid var(--gb-normal);
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 2;
}

.column-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 16px; right: 16px;
    height: 2px;
    background: var(--column-color, rgba(255,255,255,0.2));
    border-radius: 2px;
    opacity: 0.7;
}

.column-header-left { display: flex; align-items: center; gap: 9px; }

.column-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--column-color, rgba(255,255,255,0.5));
    box-shadow: 0 0 8px var(--column-color, rgba(255,255,255,0.3));
}

.column-title {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
}

.column-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--glass-2);
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    border: 1px solid var(--gb-subtle);
}

.column-cards {
    flex: 1;
    overflow-y: auto;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.025);
    backdrop-filter: var(--blur-sm);
    border: 1px solid var(--gb-subtle);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    min-height: 80px;
}
.column-cards.drag-over {
    background: rgba(var(--ws-accent-rgb), 0.06);
    border-color: rgba(var(--ws-accent-rgb), 0.3);
}

/* ============ Task Card ============ */
.task-card {
    background: var(--glass-2);
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
    border: 1px solid var(--gb-normal);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    cursor: grab;
    transition: all var(--t-fast);
    position: relative;
    overflow: hidden;
    animation: slideUp 200ms ease-out;
}

/* Priority stripe */
.task-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--card-priority-color, rgba(255,255,255,0.2));
    border-radius: 3px 0 0 3px;
}

.task-card:hover {
    background: var(--glass-3);
    border-color: var(--gb-strong);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255,255,255,0.05);
    transform: translateY(-2px);
}
.task-card.dragging { opacity: 0.45; transform: rotate(2deg) scale(0.98); }
.task-card.kb-focused { outline: 2px solid rgba(var(--ws-accent-rgb), 0.8); outline-offset: 2px; }
.task-card.is-done .card-title { text-decoration: line-through; opacity: 0.45; }

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

.card-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.38;
    letter-spacing: -0.015em;
    color: var(--text-primary);
    flex: 1;
    margin-right: 8px;
}

.card-menu-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 3px;
    border-radius: var(--radius-sm);
    opacity: 0.55;
    transition: all var(--t-fast);
    display: flex; align-items: center;
}
.task-card:hover .card-menu-btn { opacity: 1; }
.card-menu-btn:hover { color: var(--text-primary); background: var(--glass-hover); opacity: 1; }

.card-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }

.card-tag {
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    background: rgba(var(--ws-accent-rgb), 0.14);
    color: var(--ws-accent);
    border: 1px solid rgba(var(--ws-accent-rgb), 0.2);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.card-meta { display: flex; align-items: center; gap: 7px; }

.card-priority {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.priority-critical { background: rgba(248, 113, 113, 0.14); color: #fca5a5; border: 1px solid rgba(248,113,113,0.2); }
.priority-high     { background: rgba(251, 146, 60,  0.14); color: #fdba74; border: 1px solid rgba(251,146,60, 0.2); }
.priority-medium   { background: rgba(251, 191, 36,  0.14); color: #fde68a; border: 1px solid rgba(251,191,36, 0.2); }
.priority-low      { background: rgba(56,  189, 248, 0.14); color: #7dd3fc; border: 1px solid rgba(56, 189,248, 0.2); }

.card-date {
    font-size: 0.76rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.card-date.overdue { color: var(--status-blocked); font-weight: 600; }

.card-assignee {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #818cf8, #38bdf8);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; color: white;
    flex-shrink: 0;
}

.card-progress { width: 100%; margin-top: 10px; }
.progress-bar-bg { height: 4px; background: rgba(255,255,255,0.08); border-radius: var(--radius-pill); overflow: hidden; }
.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--ws-accent), rgba(var(--ws-accent-rgb), 0.5));
    transition: width var(--t-base);
}

.card-subtasks {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 8px;
}
.card-subtasks svg { flex-shrink: 0; }

/* Workstream dot on card */
.card-workstream {
    position: absolute;
    top: 10px; right: 40px;
    width: 7px; height: 7px;
    border-radius: 50%;
}
.card-workstream.marketing { background: #2dd4bf; box-shadow: 0 0 6px rgba(45,212,191,0.7); }
.card-workstream.stormveil { background: #a78bfa; box-shadow: 0 0 6px rgba(167,139,250,0.7); }

/* ============ Table View ============ */
.table-view { flex-direction: column; padding: 0; overflow: hidden; }
.table-wrapper { flex: 1; min-height: 0; width: 100%; overflow: auto; }

.task-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.92rem;
}
.task-table thead { position: sticky; top: 0; z-index: 2; }

.task-table th {
    padding: 14px 18px;
    background: rgba(10, 6, 30, 0.55);
    backdrop-filter: var(--blur-sm);
    text-align: left;
    font-weight: 600;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--gb-normal);
    white-space: nowrap;
    user-select: none;
}
.task-table th.sortable { cursor: pointer; }
.task-table th.sortable:hover { color: var(--text-primary); }
.task-table th.sortable svg { vertical-align: middle; margin-left: 4px; }
.th-checkbox { width: 50px; }
.th-title { min-width: 300px; }

.task-table td { padding: 16px 18px; border-bottom: 1px solid var(--gb-subtle); vertical-align: middle; }
.task-table tr { transition: background var(--t-fast); }
.task-table tbody tr:hover { background: var(--glass-hover); }
/* ---- Sleek radial checkboxes ---- */
.task-table input[type="checkbox"],
.subtask-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--gb-strong);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    position: relative;
    transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
    margin: 0;
    flex-shrink: 0;
}
.task-table input[type="checkbox"]:hover,
.subtask-item input[type="checkbox"]:hover {
    border-color: var(--ws-accent);
    background: rgba(var(--ws-accent-rgb), 0.08);
}
.task-table input[type="checkbox"]:focus-visible,
.subtask-item input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--ws-accent-rgb), 0.25);
}
.task-table input[type="checkbox"]:checked,
.subtask-item input[type="checkbox"]:checked {
    background: var(--ws-accent);
    border-color: var(--ws-accent);
    box-shadow: 0 0 0 3px rgba(var(--ws-accent-rgb), 0.18);
}
.task-table input[type="checkbox"]:checked::after,
.subtask-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 5px;
    height: 9px;
    border: solid #0c0a35;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}
.task-table input[type="checkbox"]:indeterminate {
    background: var(--ws-accent);
    border-color: var(--ws-accent);
    box-shadow: 0 0 0 3px rgba(var(--ws-accent-rgb), 0.18);
}
.task-table input[type="checkbox"]:indeterminate::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 2px;
    background: #0c0a35;
    border-radius: 1px;
    transform: translate(-50%, -50%);
}
.task-table tbody tr.kb-focused { background: var(--glass-hover); outline: 2px solid rgba(var(--ws-accent-rgb), 0.6); outline-offset: -2px; }

.table-task-title { font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: color var(--t-fast); }
.table-task-title:hover { color: var(--ws-accent); }
.table-task-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.status-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-todo       { background: rgba(139, 155, 184, 0.12); color: #aab4c8; border: 1px solid rgba(139,155,184,0.18); }
.status-todo::before { background: var(--status-todo); }
.status-in-progress { background: rgba(129, 140, 248, 0.14); color: #a5b4fc; border: 1px solid rgba(129,140,248,0.2); }
.status-in-progress::before { background: var(--status-progress); box-shadow: 0 0 5px var(--status-progress); }
.status-review     { background: rgba(251, 146, 60, 0.14); color: #fdba74; border: 1px solid rgba(251,146,60,0.2); }
.status-review::before { background: var(--status-review); }
.status-done       { background: rgba(52, 211, 153, 0.14); color: #6ee7b7; border: 1px solid rgba(52,211,153,0.2); }
.status-done::before { background: var(--status-done); box-shadow: 0 0 5px var(--status-done); }
.status-blocked    { background: rgba(248, 113, 113, 0.14); color: #fca5a5; border: 1px solid rgba(248,113,113,0.2); }
.status-blocked::before { background: var(--status-blocked); }

.table-assignee { display: flex; align-items: center; gap: 9px; font-size: 0.92rem; }
.table-progress { display: flex; align-items: center; gap: 9px; }
.table-progress .progress-bar-bg { width: 90px; }
.table-progress span { font-size: 0.82rem; color: var(--text-muted); width: 38px; font-weight: 500; }

.table-actions { display: flex; gap: 5px; opacity: 0.55; transition: opacity var(--t-fast); }
tr:hover .table-actions { opacity: 1; }
.task-table tbody tr.selected { background: rgba(168, 85, 247, 0.08); }
.task-table tbody tr.selected td { border-bottom-color: rgba(168, 85, 247, 0.18); }

/* ---- Bulk actions bar ---- */
.bulk-actions {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 24px 12px;
    padding: 10px 14px 10px 16px;
    background: rgba(18, 10, 50, 0.78);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border: 1px solid rgba(168, 85, 247, 0.26);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.30);
    animation: bulkIn 220ms cubic-bezier(0.16,1,0.3,1);
}
@keyframes bulkIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.bulk-actions[hidden] { display: none; }
.bulk-count {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.bulk-count em {
    font-style: normal;
    color: #c084fc;
    font-variant-numeric: tabular-nums;
}
.bulk-spacer { flex: 1; }
.bulk-btn {
    padding: 7px 13px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--t-fast);
}
.bulk-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.16);
}
.bulk-btn.danger {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.28);
    color: #fca5a5;
}
.bulk-btn.danger:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fecaca;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 7px;
    border-radius: var(--radius-sm);
    transition: all var(--t-fast);
    display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { color: var(--text-primary); background: var(--glass-hover); }
.btn-icon.danger:hover { color: #fca5a5; background: rgba(248, 113, 113, 0.12); }

/* ============ Timeline View ============ */
.timeline-view { flex-direction: column; padding: 20px 24px; overflow: auto; }

.timeline-header {
    display: flex;
    border-bottom: 1px solid var(--gb-normal);
    padding-bottom: 10px;
    margin-bottom: 16px;
    min-width: max-content;
}
.timeline-header .th-label {
    width: 200px; min-width: 200px;
    font-size: 0.76rem; font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    padding: 5px 0;
}
.timeline-dates { display: flex; flex: 1; }
.timeline-date-col {
    flex: 1; min-width: 40px;
    text-align: center;
    font-size: 0.74rem;
    color: var(--text-muted);
    padding: 5px 0;
}
.timeline-date-col.today { color: var(--status-done); font-weight: 700; }
.timeline-body { min-width: max-content; }

.timeline-row {
    display: flex;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.timeline-task-label {
    width: 200px; min-width: 200px;
    font-size: 0.88rem; font-weight: 500;
    padding-right: 16px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.timeline-bar-area { display: flex; flex: 1; position: relative; height: 32px; }

.timeline-bar {
    position: absolute;
    height: 26px;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, rgba(var(--ws-accent-rgb),0.8), rgba(var(--ws-accent-rgb),0.4));
    border: 1px solid rgba(var(--ws-accent-rgb), 0.3);
    backdrop-filter: var(--blur-sm);
    top: 3px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 600; color: white;
    min-width: 40px;
    transition: all var(--t-fast);
}
.timeline-bar:hover { transform: scaleY(1.12); }
.timeline-bar.done { background: linear-gradient(90deg, rgba(52,211,153,0.7), rgba(52,211,153,0.35)); border-color: rgba(52,211,153,0.3); }
.timeline-bar.blocked { background: linear-gradient(90deg, rgba(248,113,113,0.7), rgba(248,113,113,0.35)); border-color: rgba(248,113,113,0.3); }

.timeline-today-line {
    position: absolute;
    top: 0; bottom: 0;
    width: 1px;
    background: var(--status-done);
    z-index: 1;
    opacity: 0.4;
}

/* ============ Dashboard View ============ */
.dashboard-view { padding: 24px; overflow: auto; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 1200px;
}

.dash-card {
    background: var(--glass-1);
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
    border: 1px solid var(--gb-normal);
    border-radius: var(--radius-xl);
    padding: 22px;
    transition: all var(--t-fast);
}
.dash-card:hover { background: var(--glass-2); border-color: var(--gb-strong); box-shadow: var(--shadow-md); }

.stat-card { display: flex; align-items: center; gap: 16px; }

.stat-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon.purple { background: rgba(129,140,248,0.14); color: #a5b4fc; border: 1px solid rgba(129,140,248,0.2); }
.stat-icon.lime   { background: rgba(52, 211,153,0.14); color: #6ee7b7; border: 1px solid rgba(52,211,153,0.2); }
.stat-icon.orange { background: rgba(251,146, 60,0.14); color: #fdba74; border: 1px solid rgba(251,146,60,0.2); }
.stat-icon.red    { background: rgba(248,113,113,0.14); color: #fca5a5; border: 1px solid rgba(248,113,113,0.2); }

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 2.1rem; font-weight: 800; line-height: 1; color: var(--text-primary); letter-spacing: -0.035em; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 5px; letter-spacing: -0.005em; }

.chart-card { padding: 22px; }
.chart-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 16px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.chart-card.wide { grid-column: span 2; }

.chart-container { width: 100%; height: 170px; position: relative; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 0.78rem; color: var(--text-secondary); }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }

.priority-bars { display: flex; flex-direction: column; gap: 12px; }
.priority-bar-row { display: flex; align-items: center; gap: 12px; }
.priority-bar-label { font-size: 0.82rem; font-weight: 600; width: 65px; flex-shrink: 0; color: var(--text-secondary); }
.priority-bar-track { flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: var(--radius-pill); overflow: hidden; }
.priority-bar-value { height: 100%; border-radius: var(--radius-pill); transition: width var(--t-slow); }
.priority-bar-count { font-size: 0.8rem; color: var(--text-muted); width: 22px; text-align: right; font-weight: 600; }

.activity-feed { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; }
.activity-item { display: flex; align-items: flex-start; gap: 10px; font-size: 0.86rem; padding: 10px 12px; border-radius: var(--radius-md); background: var(--glass-1); border: 1px solid var(--gb-subtle); }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.activity-text { color: var(--text-secondary); line-height: 1.5; }
.activity-text strong { color: var(--text-primary); }
.activity-time { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }

/* ============ Modals ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 2, 20, 0.65);
    backdrop-filter: var(--blur-lg);
    -webkit-backdrop-filter: var(--blur-lg);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}
.modal-overlay.active { display: flex; }

.modal {
    background: rgba(18, 10, 50, 0.80);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid var(--gb-strong);
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.04);
    animation: modalIn 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-sm { max-width: 400px; }

@keyframes modalIn {
    from { opacity: 0; transform: translateY(24px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px;
    border-bottom: 1px solid var(--gb-subtle);
}
.modal-header h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.modal-header-actions { display: flex; align-items: center; gap: 10px; }

.modal-close {
    background: var(--glass-2);
    border: 1px solid var(--gb-subtle);
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--t-fast);
    display: flex; align-items: center;
}
.modal-close:hover { color: var(--text-primary); background: var(--glass-3); border-color: var(--gb-normal); }

.modal-body { padding: 22px 26px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 18px;
    margin-top: 8px;
    border-top: 1px solid var(--gb-subtle);
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    background: var(--glass-1);
    border: 1px solid var(--gb-normal);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.92rem;
    outline: none;
    transition: all var(--t-fast);
    font-family: inherit;
}
.form-group select option { background: #1a0d54; }

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--gb-bright);
    background: var(--glass-2);
    box-shadow: 0 0 0 3px rgba(var(--ws-accent-rgb), 0.12);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

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

.progress-input { display: flex; align-items: center; gap: 10px; }
.progress-input input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-pill);
    outline: none;
}
.progress-input input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-1), var(--blue-2));
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(79, 134, 255, 0.4);
}
.progress-input span { font-size: 0.9rem; font-weight: 700; color: var(--text-secondary); min-width: 38px; }

/* Subtasks */
.subtasks-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 9px; }
.subtask-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 12px;
    background: var(--glass-1);
    border: 1px solid var(--gb-subtle);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}
.subtask-item .subtask-text { flex: 1; }
.subtask-item .subtask-remove {
    background: none; border: none;
    color: var(--text-muted);
    cursor: pointer; padding: 3px;
    font-size: 1rem;
    opacity: 0; transition: opacity var(--t-fast);
}
.subtask-item:hover .subtask-remove { opacity: 1; }
.subtask-item .subtask-remove:hover { color: var(--status-blocked); }

.subtask-add { display: flex; gap: 7px; }
.subtask-add input {
    flex: 1; padding: 9px 12px;
    background: var(--glass-1);
    border: 1px solid var(--gb-normal);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem; outline: none;
    font-family: inherit;
}
.subtask-add input:focus { border-color: var(--gb-strong); background: var(--glass-2); }

/* Color Picker */
.color-picker { display: flex; gap: 9px; flex-wrap: wrap; }
.color-swatch {
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--t-fast);
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active { border-color: white; box-shadow: 0 0 12px currentColor; }

/* ============ Command Palette ============ */
.cmd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 2, 20, 0.55);
    backdrop-filter: var(--blur-lg);
    -webkit-backdrop-filter: var(--blur-lg);
    z-index: 5000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 110px;
}
.cmd-overlay.active { display: flex; }

.cmd-palette {
    width: 100%;
    max-width: 560px;
    background: rgba(15, 8, 45, 0.88);
    backdrop-filter: var(--blur-lg);
    -webkit-backdrop-filter: var(--blur-lg);
    border: 1px solid var(--gb-strong);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.04);
    overflow: hidden;
    animation: cmdIn 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cmdIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cmd-search-wrap {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--gb-subtle);
}
.cmd-search-wrap svg { color: var(--text-muted); flex-shrink: 0; }

#cmdInput {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    font-family: inherit;
}
#cmdInput::placeholder { color: var(--text-muted); }

.cmd-esc-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--glass-2);
    border: 1px solid var(--gb-subtle);
    padding: 3px 8px;
    border-radius: 6px;
    flex-shrink: 0;
}

.cmd-results { max-height: 360px; overflow-y: auto; padding: 7px; }

.cmd-section-label {
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 9px 13px 5px;
}

.cmd-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 13px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--t-fast);
    font-size: 0.92rem;
    color: var(--text-secondary);
}
.cmd-item:hover { background: var(--glass-hover); color: var(--text-primary); }
.cmd-item.active { background: rgba(var(--ws-accent-rgb), 0.14); color: var(--text-primary); border: 1px solid rgba(var(--ws-accent-rgb), 0.2); }

.cmd-item-icon {
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    background: var(--glass-2);
    border: 1px solid var(--gb-subtle);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--text-muted);
}
.cmd-item-icon.marketing { background: rgba(45,212,191,0.12); color: #2dd4bf; border-color: rgba(45,212,191,0.2); }
.cmd-item-icon.stormveil { background: rgba(167,139,250,0.12); color: #c4b5fd; border-color: rgba(167,139,250,0.2); }

.cmd-item-text { flex: 1; }
.cmd-item-title { font-weight: 500; }
.cmd-item-sub { font-size: 0.76rem; color: var(--text-muted); margin-top: 1px; }

.cmd-item-shortcut {
    font-size: 0.72rem; color: var(--text-muted);
    background: var(--glass-2); border: 1px solid var(--gb-subtle);
    padding: 2px 7px; border-radius: 5px;
}

.cmd-empty { text-align: center; padding: 36px 24px; color: var(--text-muted); font-size: 0.88rem; }

.cmd-footer {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 11px 16px;
    border-top: 1px solid var(--gb-subtle);
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.72rem;
    color: var(--text-muted);
}
.cmd-footer span { display: flex; align-items: center; gap: 5px; }

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    background: var(--glass-2);
    border: 1px solid var(--gb-normal);
    border-radius: 5px;
    font-size: 0.7rem;
    font-family: inherit;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ============ Nav Shortcuts ============ */
.nav-shortcut {
    margin-left: auto;
    font-size: 0.67rem;
    color: var(--text-muted);
    background: var(--glass-1);
    border: 1px solid var(--gb-subtle);
    padding: 2px 6px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity var(--t-fast);
}
.sidebar:hover .nav-shortcut { opacity: 1; }
.sidebar.collapsed .nav-shortcut { display: none; }

/* ============ Dictation (mic + Claude rewrite) ============ */
.input-with-mic {
    position: relative;
    display: block;
}
.input-with-mic input[type="text"],
.input-with-mic textarea {
    padding-right: 44px;
    width: 100%;
}
.mic-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--gb-subtle);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.mic-btn:hover {
    background: rgba(var(--ws-accent-rgb), 0.12);
    border-color: rgba(var(--ws-accent-rgb), 0.35);
    color: var(--ws-accent);
}
.mic-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--ws-accent-rgb), 0.25);
}
.mic-btn .mic-spinner { display: none; }
.mic-btn.recording {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    animation: mic-pulse 1.5s ease-in-out infinite;
}
.mic-btn.thinking {
    background: rgba(var(--ws-accent-rgb), 0.14);
    border-color: rgba(var(--ws-accent-rgb), 0.5);
    color: var(--ws-accent);
    cursor: progress;
}
.mic-btn.thinking .mic-icon { display: none; }
.mic-btn.thinking .mic-spinner {
    display: inline-block;
    animation: mic-spin 0.9s linear infinite;
}
.mic-btn[disabled] { opacity: 0.4; cursor: not-allowed; }

@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
    50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);    }
}
@keyframes mic-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.input-with-mic textarea + .mic-btn { top: 8px; }

/* ============ NLP Hints ============ */
.nlp-tip { font-size: 0.68rem; color: var(--text-muted); font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 6px; font-style: italic; }
.nlp-hint {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.76rem;
    color: rgba(var(--ws-accent-rgb), 0.9);
    background: rgba(var(--ws-accent-rgb), 0.08);
    border: 1px solid rgba(var(--ws-accent-rgb), 0.18);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

/* ============ Search Hint ============ */
.search-hint {
    font-size: 0.68rem;
    color: var(--text-muted);
    background: var(--glass-2);
    border: 1px solid var(--gb-subtle);
    padding: 2px 7px;
    border-radius: 5px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ============ Context Menu ============ */
.context-menu {
    position: fixed;
    background: rgba(15, 8, 45, 0.90);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid var(--gb-strong);
    border-radius: var(--radius-lg);
    padding: 5px;
    min-width: 170px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    display: none;
}
.context-menu.active { display: block; animation: cmdIn 140ms ease-out; }

.context-item {
    display: flex; align-items: center; gap: 9px;
    width: 100%; padding: 9px 13px;
    background: none; border: none;
    color: var(--text-secondary);
    font-size: 0.88rem; cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--t-fast);
}
.context-item:hover { background: var(--glass-hover); color: var(--text-primary); }
.context-item.danger:hover { background: rgba(248,113,113,0.12); color: #fca5a5; }
.context-divider { height: 1px; background: var(--gb-subtle); margin: 4px 0; }

/* ============ Toast Notifications ============ */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 9px; z-index: 3000; }

.toast {
    display: flex; align-items: center; gap: 11px;
    padding: 13px 20px;
    background: rgba(15, 8, 45, 0.88);
    backdrop-filter: var(--blur-md);
    border: 1px solid var(--gb-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: toastIn 280ms ease-out;
    font-size: 0.9rem;
    min-width: 240px;
    color: var(--text-primary);
}
.toast.success { border-left: 3px solid var(--status-done); }
.toast.error   { border-left: 3px solid var(--status-blocked); }
.toast.info    { border-left: 3px solid var(--status-progress); }

@keyframes toastIn  { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(24px); } }

/* ============ Empty State ============ */
.empty-state {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 50px 24px; text-align: center;
    color: var(--text-muted);
}
.empty-state svg { margin-bottom: 16px; opacity: 0.25; }
.empty-state p { font-size: 0.95rem; margin-bottom: 12px; }

/* ============ Loading Overlay ============ */
.app-loading {
    position: fixed; inset: 0;
    background: radial-gradient(ellipse at 20% 10%, #3a1a80 0%, #1a0d54 40%, #0c0a35 100%);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 14px; z-index: 9999;
    font-size: 0.88rem; color: var(--text-muted);
    transition: opacity 300ms ease;
}
.app-loading.hidden { opacity: 0; pointer-events: none; }

.loading-spinner {
    width: 34px; height: 34px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top-color: var(--blue-1);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Animations ============ */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.drag-ghost { opacity: 0.75; transform: rotate(2deg); }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-card.wide { grid-column: span 2; }
}

@media (max-width: 768px) {
    .sidebar { position: fixed; left: -100%; transition: left var(--t-base); }
    .sidebar.mobile-open { left: 0; }
    .mobile-menu-btn { display: block; }
    .topbar { padding: 0 16px; }
    .board-view { padding: 12px 16px; }
    .board-column { width: 270px; min-width: 270px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .chart-card.wide { grid-column: span 1; }
    .form-row { grid-template-columns: 1fr; }
    .topbar-right { gap: 5px; }
}

/* Marketing workstream nav active override */
body[data-workstream="marketing"] .nav-item.active {
    background: rgba(45, 212, 191, 0.12);
    border-color: rgba(45, 212, 191, 0.22);
}
body[data-workstream="marketing"] .nav-item.active svg { color: #2dd4bf; }
body[data-workstream="marketing"] .sidebar-search:focus-within { box-shadow: 0 0 0 3px rgba(45,212,191,0.12); border-color: rgba(45,212,191,0.3); }
body[data-workstream="marketing"] .task-count { color: #2dd4bf; }

body[data-workstream="stormveil"] .nav-item.active {
    background: rgba(167, 139, 250, 0.12);
    border-color: rgba(167, 139, 250, 0.22);
}
body[data-workstream="stormveil"] .nav-item.active svg { color: #a78bfa; }

/* ============ Claude Assistant ============ */
.claude-launcher {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.18);
    background: linear-gradient(135deg, #d97a4a, #c35a2e);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 40px rgba(195, 90, 46, 0.42), 0 0 0 1px rgba(255,255,255,0.05) inset;
    z-index: 80;
    transition: transform 160ms cubic-bezier(0.16,1,0.3,1), box-shadow 160ms ease, background 160ms ease;
}
.claude-launcher:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 18px 50px rgba(195, 90, 46, 0.55);
    background: linear-gradient(135deg, #e08855, #cc6434);
}
.claude-launcher:active { transform: translateY(0) scale(0.98); }
.claude-launcher.hidden { opacity: 0; transform: scale(0.8); pointer-events: none; }

.claude-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: min(640px, calc(100vh - 40px));
    background: rgba(16, 10, 44, 0.82);
    backdrop-filter: blur(40px) saturate(140%);
    -webkit-backdrop-filter: blur(40px) saturate(140%);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 22px;
    box-shadow: 0 30px 90px rgba(0,0,0,0.60), 0 0 0 1px rgba(255,255,255,0.04) inset;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: transform 240ms cubic-bezier(0.16,1,0.3,1), opacity 200ms ease;
    z-index: 90;
    overflow: hidden;
}
.claude-panel.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.claude-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.claude-title { display: flex; align-items: center; gap: 11px; }
.claude-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #d97a4a, #c35a2e);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(195, 90, 46, 0.35);
}
.claude-title-text { display: flex; flex-direction: column; line-height: 1.1; }
.claude-title-main { font-size: 0.92rem; font-weight: 600; color: var(--text-primary); letter-spacing: -0.01em; }
.claude-title-sub { font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; letter-spacing: 0.02em; }
.claude-title-sub.working { color: #f9b37a; }

.claude-header-actions { display: flex; gap: 4px; }
.claude-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 140ms ease;
}
.claude-icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); border-color: rgba(255,255,255,0.08); }

.claude-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}
.claude-messages::-webkit-scrollbar { width: 6px; }
.claude-messages::-webkit-scrollbar-track { background: transparent; }
.claude-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
.claude-messages::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

.claude-empty {
    margin: auto;
    text-align: center;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.claude-empty-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(217,122,74,0.18), rgba(195,90,46,0.08));
    border: 1px solid rgba(217,122,74,0.28);
    color: #f9b37a;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}
.claude-empty-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); letter-spacing: -0.01em; }
.claude-empty-sub { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 10px; }
.claude-suggestions { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 4px; }
.claude-chip {
    padding: 9px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 11px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: all 140ms ease;
}
.claude-chip:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(217,122,74,0.32);
    color: var(--text-primary);
}

.claude-msg {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
    animation: claudeMsgIn 220ms cubic-bezier(0.16,1,0.3,1);
}
@keyframes claudeMsgIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.claude-msg.user { align-items: flex-end; }
.claude-msg.assistant { align-items: flex-start; }

.claude-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.52;
    color: var(--text-primary);
    word-wrap: break-word;
    white-space: pre-wrap;
    max-width: 85%;
}
.claude-msg.user .claude-bubble {
    background: linear-gradient(135deg, #4F86FF, #2A5FD8);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 6px 18px rgba(79,134,255,0.28);
}
.claude-msg.assistant .claude-bubble {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-bottom-left-radius: 6px;
}

.claude-tool {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(217,122,74,0.10);
    border: 1px solid rgba(217,122,74,0.24);
    border-radius: 999px;
    font-size: 0.74rem;
    color: #f9b37a;
    font-family: 'SF Mono', Menlo, monospace;
    letter-spacing: 0.01em;
}
.claude-tool.ok { background: rgba(132,204,22,0.10); border-color: rgba(132,204,22,0.30); color: #bef264; }
.claude-tool.err { background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.30); color: #fca5a5; }
.claude-tool-spinner {
    width: 10px;
    height: 10px;
    border: 1.5px solid rgba(249,179,122,0.25);
    border-top-color: #f9b37a;
    border-radius: 50%;
    animation: claudeSpin 700ms linear infinite;
}
@keyframes claudeSpin { to { transform: rotate(360deg); } }

.claude-typing {
    display: inline-flex;
    gap: 4px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    border-bottom-left-radius: 6px;
}
.claude-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    animation: claudeDot 1.1s ease-in-out infinite;
}
.claude-typing span:nth-child(2) { animation-delay: 0.15s; }
.claude-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes claudeDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.claude-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.10);
}
.claude-composer textarea {
    flex: 1;
    min-height: 38px;
    max-height: 140px;
    padding: 9px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    line-height: 1.45;
    outline: none;
    resize: none;
    transition: border-color 140ms ease, background 140ms ease;
}
.claude-composer textarea:focus {
    border-color: rgba(217,122,74,0.45);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3px rgba(217,122,74,0.12);
}
.claude-composer textarea::placeholder { color: var(--text-muted); }
.claude-send {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #d97a4a, #c35a2e);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(195, 90, 46, 0.38);
    transition: all 140ms ease;
    flex-shrink: 0;
}
.claude-send:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(195, 90, 46, 0.48); }
.claude-send:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

@media (max-width: 640px) {
    .claude-panel { right: 10px; left: 10px; bottom: 10px; width: auto; height: 70vh; }
    .claude-launcher { right: 14px; bottom: 14px; width: 48px; height: 48px; }
}
