
        @import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
        /* ALL CSS STYLES FROM PREVIOUS CODE REMAIN EXACTLY THE SAME */

        /* Quick Actions Widget (formerly Quick Filters) */
        :root {
            /* Override blue brand-primary to red */
            --brand-primary: #D31027;
            /* Updated to Red */
            --brand-primary-dark: #b90e22;
            /* Darker Red */
        }

        .dashboard-quick-actions-widget {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }

        .quick-action-card {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 15px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
            overflow: hidden;
        }

        .quick-action-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }

        .quick-action-card.overdue {
            border-left: 4px solid var(--brand-red);
        }

        /* ---------------------------------------------------
           PERSISTENT CONTEXTUAL PANEL
           --------------------------------------------------- */
        /* The Element being Highlighted */
        .spotlight-active {
            position: relative !important;
            z-index: 99998 !important;
            /* This creates the dark overlay over the rest of the screen */
            box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.68), 0 0 0 3px color-mix(in srgb, var(--brand-primary) 35%, #ffffff) !important;
            border-radius: 10px !important;
            pointer-events: auto !important;
            transition: all 0.3s ease-in-out;
        }

        /* The Professional Tooltip Card */
        #spotlight-popover {
            position: fixed;
            z-index: 99999;
            width: 360px;
            max-width: calc(100vw - 24px);
            background: var(--bg-panel);
            border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
            border-radius: 16px;
            box-shadow: 0 20px 45px rgba(2, 8, 23, 0.22);
            padding: 16px;
            font-family: var(--ft-font);
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease, transform 0.2s ease;
            transform: translateY(10px);
        }

        #spotlight-popover.visible {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(0);
        }

        #spotlight-popover.spotlight-anim h4,
        #spotlight-popover.spotlight-anim p {
            animation: spotlightFadeUp .22s ease;
        }

        @keyframes spotlightFadeUp {
            from { opacity: 0; transform: translateY(6px); }
            to { opacity: 1; transform: translateY(0); }
        }

        #spotlight-popover h4 {
            margin: 0 0 6px 0;
            font-size: 16px;
            color: var(--text-main);
            font-weight: var(--ft-weight-bold);
            line-height: 1.3;
        }

        #spotlight-popover p {
            margin: 0 0 16px 0;
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.5;
        }

        .spotlight-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 6px;
        }

        .spotlight-kicker {
            font-size: 11px;
            font-weight: 700;
            color: var(--brand-primary);
            letter-spacing: .05em;
            text-transform: uppercase;
        }

        .spotlight-progress {
            height: 6px;
            background: var(--bg-app);
            border-radius: 999px;
            overflow: hidden;
            margin: 0 0 12px 0;
            border: 1px solid var(--border);
        }

        .spotlight-progress-bar {
            height: 100%;
            width: 0%;
            background: linear-gradient(90deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 65%, #ffffff));
            transition: width .25s ease;
        }

        .spotlight-complete-badge {
            width: 40px;
            height: 40px;
            border-radius: 12px;
            background: color-mix(in srgb, #10B981 16%, var(--bg-app));
            color: #10B981;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            border: 1px solid color-mix(in srgb, #10B981 26%, var(--border));
            margin-bottom: 8px;
        }

        .spotlight-controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
        }

        .spotlight-step-count {
            font-size: 12px;
            color: var(--text-muted);
            font-weight: var(--ft-weight-medium);
        }

        .spotlight-btn {
            padding: 7px 12px;
            border-radius: 10px;
            font-size: 13px;
            font-weight: var(--ft-weight-semibold);
            cursor: pointer;
            border: 1px solid transparent;
        }

        .spotlight-btn-skip {
            background: transparent;
            color: var(--text-muted);
            padding: 6px 0;
        }

        .spotlight-btn-skip:hover {
            color: var(--text-main);
        }

        .spotlight-btn-back {
            background: var(--bg-app);
            border-color: var(--border);
            color: var(--text-main);
        }

        .spotlight-btn-back:hover {
            border-color: color-mix(in srgb, var(--border) 45%, var(--text-muted));
            background: var(--surface-2);
        }

        .spotlight-btn-next {
            background: var(--brand-primary);
            color: var(--text-on-brand);
        }

        .spotlight-btn-next:hover {
            background: var(--brand-primary-dark);
        }

        .spotlight-close {
            width: 28px;
            height: 28px;
            border-radius: 8px;
            border: 1px solid var(--border);
            background: var(--bg-app);
            color: var(--text-muted);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            flex-shrink: 0;
        }
        .spotlight-close:hover {
            color: var(--text-main);
            border-color: color-mix(in srgb, var(--border) 45%, var(--text-muted));
        }

        @media (max-width: 640px) {
            #spotlight-popover {
                width: calc(100vw - 16px);
                left: 8px !important;
                right: 8px !important;
                max-width: none;
                padding: 14px;
                border-radius: 14px;
            }
            .spotlight-controls {
                flex-wrap: wrap;
            }
            .spotlight-controls > div {
                margin-left: auto;
            }
        }

        /* ============================================ */
        /* RENAME MODAL - PREMIUM UI                    */
        /* ============================================ */
        #rename-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.45);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            z-index: 10005;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.2s ease;
        }

        #rename-modal-overlay.visible {
            display: flex;
            opacity: 1;
        }

        .rename-modal-card {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 16px;
            width: 420px;
            max-width: 90%;
            box-shadow: var(--shadow-xl);
            overflow: hidden;
            transform: scale(0.95) translateY(10px);
            transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        /* Legacy inline-white modal shells: normalize to SaaS surfaces */
        .modal .modal-content,
        .modal-overlay .modal,
        .shortcuts-help-content,
        .command-palette-content {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 16px;
        }

        /* If inline styles force white backgrounds, override at container level */
        .modal-content[style*="background: #fff"],
        .modal-content[style*="background:#fff"],
        .modal-content[style*="background: #ffffff"],
        .modal-content[style*="background:#ffffff"],
        .modal-content[style*="background: white"],
        .modal-content[style*="background:white"] {
            background: var(--surface-2) !important;
        }

        #rename-modal-overlay.visible .rename-modal-card {
            transform: scale(1) translateY(0);
        }

        .rename-modal-header {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 20px 24px 16px 24px;
        }

        .rename-modal-icon {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            flex-shrink: 0;
            background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
            color: #fff;
        }

        .rename-modal-header-text h3 {
            margin: 0;
            font-size: 16px;
            font-weight: 700;
            color: #1a1d29;
        }

        .rename-modal-header-text p {
            margin: 4px 0 0 0;
            font-size: 12px;
            color: #6b7280;
        }

        .rename-modal-body {
            padding: 0 24px 20px 24px;
        }

        .rename-modal-input-wrapper {
            position: relative;
        }

        .rename-modal-input-wrapper i {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: #9ca3af;
            font-size: 13px;
            pointer-events: none;
        }

        .rename-modal-input {
            width: 100%;
            padding: 12px 14px 12px 40px;
            border: 2px solid #e5e7eb;
            background: #f9fafb;
            color: #1a1d29;
            border-radius: 10px;
            font-size: 14px;
            font-family: var(--ft-font);
            font-weight: 500;
            outline: none;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
            box-sizing: border-box;
        }

        .rename-modal-input:focus {
            border-color: #EF4444;
            box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
        }

        .rename-modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            padding: 16px 24px;
            background: #f9fafb;
            border-top: 1px solid #e5e7eb;
        }

        .rename-modal-btn {
            padding: 9px 20px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            font-family: var(--ft-font);
            cursor: pointer;
            transition: all 0.2s ease;
            border: none;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .rename-modal-btn-cancel {
            background: transparent;
            color: #6b7280;
            border: 1px solid #e5e7eb;
        }

        .rename-modal-btn-cancel:hover {
            background: #f3f4f6;
            color: #1a1d29;
        }

        .rename-modal-btn-save {
            background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
            color: #fff;
        }

        .rename-modal-btn-save:hover {
            box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
            transform: translateY(-1px);
        }

        .rename-modal-hint {
            font-size: 11px;
            color: #9ca3af;
            margin-top: 10px;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .rename-modal-hint kbd {
            background: #f3f4f6;
            border: 1px solid #e5e7eb;
            border-radius: 4px;
            padding: 1px 6px;
            font-size: 10px;
            font-family: var(--ft-font);
            color: #6b7280;
        }

        /* DARK THEME overrides for rename modal */
        [data-theme="dark"] .rename-modal-card {
            background: var(--bg-main, #1e2028);
            border-color: var(--border, #2d2f3a);
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
        }

        [data-theme="dark"] .rename-modal-header-text h3 {
            color: var(--text-main, #e0e0e0);
        }

        [data-theme="dark"] .rename-modal-header-text p {
            color: var(--text-muted, #888);
        }

        [data-theme="dark"] .rename-modal-input-wrapper i {
            color: var(--text-muted, #888);
        }

        [data-theme="dark"] .rename-modal-input {
            border-color: var(--border, #2d2f3a);
            background: var(--bg-app, #161822);
            color: var(--text-main, #e0e0e0);
        }

        [data-theme="dark"] .rename-modal-input:focus {
            border-color: #EF4444;
            box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
        }

        [data-theme="dark"] .rename-modal-footer {
            background: var(--bg-secondary, rgba(255, 255, 255, 0.02));
            border-top-color: var(--border, #2d2f3a);
        }

        [data-theme="dark"] .rename-modal-btn-cancel {
            color: var(--text-muted, #888);
            border-color: var(--border, #2d2f3a);
        }

        [data-theme="dark"] .rename-modal-btn-cancel:hover {
            background: var(--bg-app, #161822);
            color: var(--text-main, #e0e0e0);
        }

        [data-theme="dark"] .rename-modal-hint {
            color: var(--text-muted, #888);
        }

        [data-theme="dark"] .rename-modal-hint kbd {
            background: var(--bg-app, #161822);
            border-color: var(--border, #2d2f3a);
            color: var(--text-muted, #888);
        }

        .quick-action-card.high-priority {
            border-left: 4px solid #EF4444;
        }

        .quick-action-card.in-progress {
            border-left: 4px solid #F59E0B;
        }

        .quick-action-card.due-today {
            border-left: 4px solid #3B82F6;
        }

        /* AI AGENT STYLES */
        /* AI AGENT STYLES */
        /* AI AGENT STYLES - FLOATING ABOVE CHAT */
        .ai-agent-btn {
            position: fixed;
            bottom: 100px;
            /* Above chat button */
            right: 24px;
            /* Right side */
            left: auto;
            /* Reset left */
            width: 48px;
            /* Smaller than chat */
            height: 48px;
            background: white;
            color: var(--brand-primary);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: var(--shadow-lg);
            z-index: 10001;
            border: 2px solid var(--brand-primary);
            font-size: 20px;
            transition: var(--transition);
        }

        .ai-agent-btn:hover {
            transform: scale(1.1);
            background: var(--brand-primary);
            color: white;
        }

        .ai-agent-panel {
            position: fixed;
            bottom: 160px;
            /* Adjusted for new button position */
            right: 24px;
            /* Right side */
            left: auto;
            /* Reset left */
            width: 380px;
            height: 600px;
            background: var(--bg-glass);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-radius: 24px;
            box-shadow: var(--shadow-xl);
            display: flex;
            flex-direction: column;
            z-index: 10000;
            border: 1px solid var(--border);
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            transform-origin: bottom right;
            overflow: hidden;
        }

        .ai-agent-panel.hidden {
            transform: scale(0.8) translateY(40px);
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }

        .ai-header {
            padding: 24px;
            background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
            color: white;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .ai-title {
            font-weight: 700;
            font-size: 18px;
            display: flex;
            align-items: center;
            gap: 12px;
            letter-spacing: -0.01em;
        }

        .ai-close {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s;
        }

        .ai-close:hover {
            background: rgba(255, 255, 255, 0.4);
        }

        .ai-content {
            flex: 1;
            overflow-y: auto;
            padding: 24px;
            display: flex;
            flex-direction: column;
            gap: 16px;
            background: transparent;
        }

        .ai-message {
            max-width: 85%;
            padding: 14px 18px;
            border-radius: 18px;
            font-size: 14px;
            line-height: 1.6;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        }

        .ai-message.agent {
            align-self: flex-start;
            background: var(--bg-panel);
            border-bottom-left-radius: 4px;
            border: 1px solid rgba(0, 0, 0, 0.05);
            color: var(--text-main);
        }

        .ai-message.user {
            align-self: flex-end;
            background: var(--brand-primary);
            color: white;
            border-bottom-right-radius: 4px;
            box-shadow: 0 4px 12px rgba(211, 16, 39, 0.3);
        }

        .ai-options {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-top: 8px;
        }

        .ai-option-btn {
            background: var(--bg-panel);
            border: 1px solid var(--brand-primary);
            color: var(--brand-primary);
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .ai-option-btn:hover {
            background: var(--brand-primary);
            color: white;
            transform: translateY(-1px);
        }

        .ai-input-area {
            padding: 20px;
            background: var(--bg-panel);
            border-top: 1px solid var(--border-light);
            display: flex;
            gap: 12px;
        }

        .ai-input {
            flex: 1;
            padding: 14px;
            border: 1px solid var(--border);
            border-radius: 14px;
            background: var(--bg-app);
            color: var(--text-main);
            resize: none;
            height: 52px;
            font-family: inherit;
            font-size: 14px;
        }

        .ai-input:focus {
            border-color: var(--brand-primary);
            background: var(--bg-panel);
            color: var(--text-main);
            outline: none;
        }

        .ai-send {
            width: 52px;
            height: 52px;
            background: var(--brand-primary);
            color: white;
            border: none;
            border-radius: 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            box-shadow: 0 4px 12px rgba(211, 16, 39, 0.3);
        }

        .ai-send:hover {
            background: var(--brand-primary-dark);
            transform: scale(1.05);
        }

        /* Standup Form Styles within AI Panel */
        .standup-form {
            background: var(--bg-panel);
            padding: 15px;
            border-radius: 12px;
            border: 1px solid var(--border);
            margin-top: 10px;
        }

        .standup-field {
            margin-bottom: 12px;
        }

        .standup-field label {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            margin-bottom: 4px;
            display: block;
        }

        .standup-field textarea {
            width: 100%;
            padding: 8px;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 13px;
            resize: vertical;
            min-height: 60px;
        }

        :root[data-theme="light"] {
            /* CLEAN SAAS PALETTE */
            --brand-primary: #EF4444;
            /* Modern Vibrant Red */
            --brand-primary-light: #FEECEC;
            /* Soft Red Background */
            --brand-primary-dark: #C62828;
            /* Dark Red Hover */
            --brand-secondary: #991B1B;
            /* Deep Red */
            --brand-accent: #F87171;

            /* SEMANTIC */
            --danger: #EF4444;
            --success: #10B981;
            --warning: #F59E0B;
            --info: #3B82F6;

            /* SURFACES */
            --bg-app: #FCFCFD;
            /* Milky white neutral background */
            --bg-panel: #FFFFFF;
            /* Pure White */
            --bg-glass: rgba(255, 255, 255, 0.95);
            /* Less transparent, more solid */
            --bg-glass-dark: rgba(15, 23, 42, 0.95);
            --bg-hover: rgba(15, 23, 42, 0.03);

            /* TYPOGRAPHY COLORS */
            --text-main: #0F172A;
            --text-secondary: #334155;
            --text-muted: #64748B;
            --text-light: #94A3B8;
            --text-on-brand: #FFFFFF;

            /* BORDERS */
            /* Crisp borders (slightly darker than before) */
            --border: #D7DEE7;
            --border-light: #ECEFF3;
            --border-focus: #FDA4AF;

            /* SHADOWS - CLEAN & SUBTLE */
            --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
            --shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px 0 rgba(15, 23, 42, 0.03);
            --shadow-md: 0 4px 10px -6px rgba(15, 23, 42, 0.14), 0 2px 4px -3px rgba(15, 23, 42, 0.08);
            --shadow-lg: 0 10px 20px -18px rgba(15, 23, 42, 0.18), 0 4px 6px -4px rgba(15, 23, 42, 0.10);
            --shadow-xl: 0 18px 40px -30px rgba(15, 23, 42, 0.22), 0 10px 20px -25px rgba(15, 23, 42, 0.12);
            --shadow-glow: 0 0 0 3px rgba(239, 68, 68, 0.15);
            /* Focus ring style */

            /* RADIUS */
            --radius-sm: 8px;
            --radius-md: 16px;
            --radius-lg: 24px;
            --radius-xl: 32px;
            --radius-full: 9999px;

            /* TRANSITIONS - FAST & SNAPPY */
            --transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
            --transition-bounce: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            /* Removed heavy spring */

            /* SPACING SCALE (ClickUp-like rhythm) */
            --s-1: 4px;
            --s-2: 8px;
            --s-3: 12px;
            --s-4: 16px;
            --s-5: 20px;
            --s-6: 24px;
            --s-7: 32px;
            --s-8: 40px;

            /* PROFESSIONAL SURFACES */
            --surface-1: var(--bg-app);
            --surface-2: var(--bg-panel);
            --surface-3: rgba(15, 23, 42, 0.02);

            /* GRIDLINES (subtle) */
            --gridline: rgba(15, 23, 42, 0.07);
            --gridline-strong: rgba(15, 23, 42, 0.11);
            --gridline-opacity: 1;

            /* ICON PILL BACKGROUND */
            --icon-pill: rgba(15, 23, 42, 0.05);

            /* Legacy mappings */
            --brand-red: var(--brand-primary);
            --brand-red-light: var(--brand-primary-light);
            --brand-red-dark: var(--brand-primary-dark);
        }

        :root[data-theme="dark"] {
            /* DARK MODE PALETTE */
            --brand-primary: #EF4444;
            /* Keep primary red */
            --brand-primary-light: #451a1a;
            /* Dark Red Background */
            --brand-primary-dark: #ff6b6b;
            /* Lighter Red for hover in dark mode */
            --brand-secondary: #991B1B;
            --brand-accent: #F87171;

            /* SEMANTIC */
            --danger: #EF4444;
            --success: #10B981;
            --warning: #F59E0B;
            --info: #3B82F6;

            /* SURFACES */
            --bg-app: #0F172A;
            /* Deep Blue/Slate Background */
            --bg-panel: #1E293B;
            /* Slate 800 - Panel Background */
            --bg-glass: rgba(30, 41, 59, 0.95);
            --bg-glass-dark: rgba(2, 6, 23, 0.95);
            --bg-hover: rgba(241, 245, 249, 0.05);

            /* TYPOGRAPHY COLORS */
            --text-main: #F1F5F9;
            /* Slate 100 */
            --text-secondary: #CBD5E1;
            /* Slate 300 */
            --text-muted: #94A3B8;
            /* Slate 400 */
            --text-light: #64748B;
            --text-on-brand: #FFFFFF;

            /* BORDERS */
            --border: #334155;
            /* Slate 700 */
            --border-light: #1E293B;
            /* Slate 800 */
            --border-focus: #F87171;

            /* SHADOWS */
            --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
            --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
            --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
            --shadow-glow: 0 0 0 3px rgba(239, 68, 68, 0.15);

            /* RADIUS & TRANSITIONS (Inherit same values) */
            --radius-sm: 8px;
            --radius-md: 16px;
            --radius-lg: 24px;
            --radius-xl: 32px;
            --radius-full: 9999px;

            --transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
            --transition-bounce: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

            /* SPACING SCALE (ClickUp-like rhythm) */
            --s-1: 4px;
            --s-2: 8px;
            --s-3: 12px;
            --s-4: 16px;
            --s-5: 20px;
            --s-6: 24px;
            --s-7: 32px;
            --s-8: 40px;

            /* PROFESSIONAL SURFACES */
            --surface-1: var(--bg-app);
            --surface-2: var(--bg-panel);
            --surface-3: rgba(241, 245, 249, 0.04);

            /* GRIDLINES (subtle) */
            --gridline: rgba(148, 163, 184, 0.08);
            --gridline-strong: rgba(148, 163, 184, 0.12);
            --gridline-opacity: 0.9;

            /* ICON PILL BACKGROUND */
            --icon-pill: rgba(241, 245, 249, 0.06);

            /* Legacy mappings */
            --brand-red: var(--brand-primary);
            --brand-red-light: var(--brand-primary-light);
            --brand-red-dark: var(--brand-primary-dark);
        }

        /* ==========================================================
           FLOWTIVE UI (Option B): tokens + reusable components
           Goal: remove one-off styling drift across views
           ========================================================== */

        :root {
            --ft-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
            /* Typography scale (ClickUp-like crisp hierarchy) */
            --ft-text-xs: 11px;
            --ft-text-sm: 12px;
            --ft-text-md: 13px;
            --ft-text-lg: 14px;
            --ft-text-xl: 16px;
            --ft-text-2xl: 20px;

            /* Professional weights (avoid overly-bold UI) */
            --ft-weight-regular: 400;
            --ft-weight-medium: 500;
            --ft-weight-semibold: 600;
            /* Keep hierarchy without looking "bold" */
            --ft-weight-bold: 600;
            --ft-weight-black: 700;

            --ft-tracking-tight: -0.01em;
            --ft-tracking-normal: 0;
            --ft-tracking-wide: 0.06em;
            --ft-radius-sm: 10px;
            --ft-radius-md: 14px;
            --ft-radius-lg: 16px;
            --ft-ring: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
            --ft-line: var(--gridline, rgba(0, 0, 0, 0.06));
            --ft-line-strong: var(--gridline-strong, rgba(0, 0, 0, 0.10));
            --ft-surface-1: var(--surface-1, var(--bg-app));
            --ft-surface-2: var(--surface-2, var(--bg-panel));
            --ft-surface-3: var(--surface-3, rgba(0, 0, 0, 0.02));

            /* Density (Comfortable default) */
            --ft-density-row: 44px;
            --ft-density-cell-pad-y: 12px;
            --ft-density-cell-pad-x: 14px;
            --ft-density-card-pad: 14px;
        }

        html[data-density="compact"] {
            --ft-density-row: 38px;
            --ft-density-cell-pad-y: 8px;
            --ft-density-cell-pad-x: 12px;
            --ft-density-card-pad: 12px;
        }

        /* Apply density to key surfaces */
        .list-table th,
        .list-table td,
        .tasks-table th,
        .tasks-table td {
            padding: var(--ft-density-cell-pad-y) var(--ft-density-cell-pad-x) !important;
        }

        .list-table tr,
        .tasks-table tr {
            height: var(--ft-density-row);
        }

        .board-card {
            padding: var(--ft-density-card-pad);
        }

        /* Column resize handle */
        .ft-col-resizer {
            position: absolute;
            top: 0;
            right: -6px;
            width: 12px;
            height: 100%;
            cursor: col-resize;
            z-index: 5;
        }

        /* List view: make resizer easier to grab */
        .list-table th .ft-col-resizer {
            right: 0;
            width: 16px;
            z-index: 100;
            pointer-events: auto;
        }
        .list-table th .ft-col-resizer:hover {
            background: color-mix(in srgb, var(--brand-primary) 12%, transparent);
        }

        .ft-col-resizer::after {
            content: '';
            position: absolute;
            top: 20%;
            bottom: 20%;
            left: 50%;
            width: 2px;
            transform: translateX(-50%);
            background: transparent;
            border-radius: 999px;
            transition: var(--transition);
        }

        th:hover .ft-col-resizer::after {
            background: var(--gridline-strong);
        }

        body {
            font-family: var(--ft-font);
            font-size: 13px;
            line-height: 1.45;
            letter-spacing: var(--ft-tracking-tight);
            font-weight: var(--ft-weight-regular);
            text-rendering: geometricPrecision;
        }

        /* Avoid "bold" look anywhere (including <strong> and inline styles) */
        strong,
        b {
            font-weight: var(--ft-weight-semibold);
        }

        [style*="font-weight: 9"],
        [style*="font-weight:9"],
        [style*="font-weight: 8"],
        [style*="font-weight:8"],
        [style*="font-weight: bold"],
        [style*="font-weight:bold"] {
            font-weight: var(--ft-weight-bold) !important;
        }

        /* Last-resort clamp: keep UI from ever looking "bold" */
        :where(
                h1, h2, h3, h4, h5, h6,
                th, thead th,
                label,
                button,
                .ft-btn, .btn-primary, .btn-secondary, .view-btn, .filter-btn,
                .panel-title, .widget-header h3, .modal-header h3, .ft-panel-title,
                .sidebar-item,
                .ft-badge, .badge, .pill
        ) {
            font-weight: var(--ft-weight-semibold) !important;
        }

        /* Page title + section titles */
        #page-title,
        .content h2 {
            font-size: var(--ft-text-2xl);
            font-weight: var(--ft-weight-bold);
            letter-spacing: -0.02em;
            color: var(--text-main);
        }

        /* Make headings feel less “shouty” and more SaaS */
        .content h2 {
            font-size: 18px;
            font-weight: var(--ft-weight-bold);
        }

        /* Panel/widget/modal titles */
        .panel-title,
        .widget-header h3,
        .modal-header h3,
        .ft-panel-title {
            font-size: var(--ft-text-md);
            font-weight: var(--ft-weight-bold);
            letter-spacing: var(--ft-tracking-tight);
        }

        /* Labels (forms) */
        label {
            font-size: var(--ft-text-xs);
            font-weight: var(--ft-weight-semibold);
            letter-spacing: var(--ft-tracking-wide);
        }

        /* Table headers */
        .list-table th,
        .tasks-table thead th {
            font-size: var(--ft-text-xs);
            font-weight: var(--ft-weight-semibold);
            letter-spacing: var(--ft-tracking-wide);
            white-space: nowrap;
            overflow: visible; /* allow resize handle */
            text-overflow: ellipsis;
        }

        /* List view: keep resizer handle clickable (was clipped) */
        .list-table th {
            position: relative;
        }
        .list-table th .ft-col-resizer {
            right: -2px;
        }

        /* Meta text */
        .results-count,
        .notif-time,
        .widget-loading,
        .widget-empty {
            font-size: var(--ft-text-sm);
        }

        /* Buttons/inputs typography consistency */
        .ft-btn,
        .btn-primary,
        .btn-secondary,
        .filter-btn,
        .view-btn {
            font-family: var(--ft-font);
            font-weight: var(--ft-weight-semibold);
            letter-spacing: -0.005em;
        }

        .ft-input,
        .ft-select,
        input,
        select,
        textarea {
            font-family: var(--ft-font);
            font-weight: var(--ft-weight-medium);
        }

        .ft-panel {
            background: var(--ft-surface-2);
            border: 1px solid var(--border);
            border-radius: var(--ft-radius-lg);
            box-shadow: var(--shadow-sm);
        }

        .ft-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 12px 14px;
            border-bottom: 1px solid var(--ft-line-strong);
        }

        .ft-panel-title {
            margin: 0;
            font-size: 13px;
            font-weight: 900;
            color: var(--text-main);
            letter-spacing: -0.01em;
        }

        .ft-panel-body {
            padding: 14px;
        }

        .ft-btn {
            height: 36px;
            padding: 0 12px;
            border-radius: var(--ft-radius-sm);
            border: 1px solid var(--border);
            background: var(--ft-surface-2);
            color: var(--text-main);
            font-weight: 800;
            font-size: 12px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            cursor: pointer;
            transition: var(--transition);
            user-select: none;
            white-space: nowrap;
        }

        .ft-btn:hover {
            background: color-mix(in srgb, var(--ft-surface-2) 92%, var(--ft-surface-3));
        }

        .ft-btn:focus-visible {
            outline: none;
            box-shadow: var(--ft-ring);
            border-color: var(--brand-primary);
        }

        .ft-btn-primary {
            background: var(--brand-primary);
            border-color: var(--brand-primary);
            color: var(--text-on-brand);
            box-shadow: 0 8px 18px -12px color-mix(in srgb, var(--brand-primary) 55%, transparent);
        }

        .ft-btn-primary:hover {
            background: var(--brand-primary-dark);
            border-color: var(--brand-primary-dark);
        }

        .ft-btn-ghost {
            background: transparent;
            border-color: transparent;
            color: var(--text-muted);
        }

        .ft-btn-ghost:hover {
            background: var(--ft-surface-3);
            border-color: var(--ft-line);
            color: var(--text-main);
        }

        .ft-input,
        .ft-select {
            height: 36px;
            padding: 0 12px;
            border-radius: var(--ft-radius-sm);
            border: 1px solid var(--border);
            background: var(--ft-surface-2);
            color: var(--text-main);
            font-size: 12px;
            font-weight: 700;
            transition: var(--transition);
        }

        .ft-input::placeholder {
            color: var(--text-muted);
            font-weight: 600;
        }

        .ft-input:hover,
        .ft-select:hover {
            background: color-mix(in srgb, var(--ft-surface-2) 92%, var(--ft-surface-3));
        }

        .ft-input:focus,
        .ft-select:focus {
            outline: none;
            box-shadow: var(--ft-ring);
            border-color: var(--brand-primary);
        }

        .ft-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            height: 18px;
            padding: 0 8px;
            border-radius: 999px;
            border: 1px solid var(--ft-line-strong);
            background: var(--ft-surface-3);
            color: var(--text-muted);
            font-size: 10px;
            font-weight: 900;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

        .ft-popover {
            border-radius: var(--ft-radius-md);
            border: 1px solid var(--border);
            background: var(--ft-surface-2);
            box-shadow: var(--shadow-xl);
        }

        /* Modern Reset & Base Styles */
        * {
            box-sizing: border-box;
            outline: none;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        /* SAFEGUARD: Prevent media/tables from overflowing */
        img,
        video,
        canvas,
        table {
            max-width: 100%;
        }

        html {
            height: 100%;
        }

        body {
            font-family: var(--ft-font);
            margin: 0;
            height: 100%;
            background-color: var(--bg-app);
            color: var(--text-main);
            overflow: hidden;
            font-size: 14px;
            line-height: 1.5;
            letter-spacing: -0.01em;
        }

        /* Responsive UI Scaling for smaller monitors (mimics browser zoom without user effort) */
        /* IMPORTANT: min-width: 769px prevents these from firing on mobile, which would
           cause the zoomed viewport to misreport its width and defeat mobile media queries */
        /* Desktop UI scale (Windows @100% can feel too large) */
        /* 1080p (1920px wide) should be noticeably smaller */
        @media screen and (min-width: 769px) and (max-width: 1920px) {
            html { zoom: 0.78; }
        }
        /* Larger monitors */
        @media screen and (min-width: 1921px) and (max-width: 2560px) {
            html { zoom: 0.90; }
        }
        @media screen and (min-width: 2561px) {
            html { zoom: 0.92; }
        }

        /* Scrollbar Styling */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: var(--radius-full);
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--text-muted);
        }

        /* Glassmorphism Utilities */
        .glass {
            background: var(--bg-glass);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.5);
        }

        .glass-dark {
            background: var(--bg-glass-dark);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            cursor: pointer;
        }

        /* GANTT CHART STYLES */
        /* GANTT CHART STYLES - PREMIUM POLISH */
        .gantt-container {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            padding-bottom: 20px;
        }

        #view-gantt {
            padding: var(--s-6) !important;
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 16px;
            overflow: auto;
        }

        .gantt .bar-label {
            fill: var(--text-main) !important;
            /* Context-aware contrast */
            font-weight: 600;
            font-size: 13px;
            dominant-baseline: central;
        }

        .gantt .bar-progress {
            fill: rgba(255, 255, 255, 0.4);
            mix-blend-mode: overlay;
        }

        .gantt .bar {
            fill: var(--text-muted);
            /* Fallback */
            rx: 6px;
            ry: 6px;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
            stroke: none;
        }

        /* STATUS-BASED COLORS - REFINED FOR CLARITY */
        /* Target both .bar-wrapper and .bar-group to be safe */
        .gantt .bar-wrapper.bar-done .bar,
        .gantt .bar-group.bar-done .bar,
        .gantt .bar-done .bar {
            fill: #10B981 !important;
            /* Emerald Green - Success */
        }

        .gantt .bar-wrapper.bar-inprogress .bar,
        .gantt .bar-group.bar-inprogress .bar,
        .gantt .bar-inprogress .bar {
            fill: #EF4444 !important;
            /* Red - Active/In Progress */
        }

        .gantt .bar-wrapper.bar-todo .bar,
        .gantt .bar-group.bar-todo .bar,
        .gantt .bar-todo .bar {
            fill: #94A3B8 !important;
            /* Slate - Plan (Neutral) */
        }

        /* High Priority Border/Indicator */
        .gantt .bar-wrapper.bar-high .bar,
        .gantt .bar-group.bar-high .bar,
        .gantt .bar-high .bar {
            stroke: #EF4444;
            stroke-width: 2px;
        }

        .gantt .bar-label {
            fill: white !important;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
            font-weight: 500;
        }

        :root[data-theme="dark"] .gantt .bar-label {
            fill: white !important;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
        }

        .gantt-target.bar-milestone .bar {
            fill: var(--warning) !important;
        }

        /* POPUP / TOOLTIP STYLING */
        .gantt-container .popup-wrapper {
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.5);
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
            border-radius: 12px;
            padding: 0;
            width: 220px;
        }

        .gantt-container .popup-wrapper .popup-pointer {
            border-top-color: rgba(255, 255, 255, 0.9);
        }

        /* Dark Mode Overrides for Frappe Gantt SVG & Popup */
        :root[data-theme="dark"] .gantt .grid-header {
            fill: var(--bg-panel);
            stroke: var(--border);
            stroke-width: 0.5px;
        }

        :root[data-theme="dark"] .gantt .grid-row {
            fill: var(--bg-app);
        }

        :root[data-theme="dark"] .gantt .grid-row:nth-child(even) {
            fill: var(--bg-panel);
        }

        :root[data-theme="dark"] .gantt .tick text {
            fill: var(--text-muted);
            font-size: 11px;
        }

        :root[data-theme="dark"] .gantt .upper-text {
            fill: var(--text-main);
            font-weight: 600;
        }

        :root[data-theme="dark"] .gantt .lower-text {
            fill: var(--text-secondary);
        }

        :root[data-theme="dark"] .gantt-container .popup-wrapper {
            background: rgba(30, 41, 59, 0.95);
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
        }

        :root[data-theme="dark"] .gantt-container .popup-wrapper .popup-pointer {
            border-top-color: rgba(30, 41, 59, 0.95);
        }

        /* SEGMENTED CONTROL STYLING FOR GANTT MODES */
        .gantt-controls {
            background: var(--bg-app);
            padding: 4px;
            border-radius: 8px;
            border: 1px solid var(--border);
            display: flex;
            gap: 2px;
        }

        .date-mode-btn {
            background: transparent;
            border: none;
            color: var(--text-muted);
            padding: 6px 16px;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .date-mode-btn:hover {
            color: var(--text-main);
            background: rgba(0, 0, 0, 0.05);
        }

        .date-mode-btn.active {
            background: var(--bg-panel);
            color: var(--brand-primary);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            border: 1px solid rgba(0, 0, 0, 0.05);
        }

        /* Dark Mode Adjustments for Segmented Control */
        :root[data-theme="dark"] .gantt-controls {
            background: rgba(0, 0, 0, 0.2);
        }

        :root[data-theme="dark"] .date-mode-btn:hover {
            background: rgba(255, 255, 255, 0.05);
        }

        :root[data-theme="dark"] .date-mode-btn.active {
            background: var(--bg-panel);
            color: var(--brand-primary);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(255, 255, 255, 0.05);
        }

        /* OVERVIEW PANEL STYLING */
        .overview-panel {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: var(--s-6);
            margin-bottom: 20px;
            box-shadow: var(--shadow-sm);
        }

        .panel-title {
            font-size: 16px;
            font-weight: 800;
            color: var(--text-main);
            margin: 0;
        }

        /* Unified view containers */
        #view-table,
        #view-overview,
        #view-inbox,
        #view-chat {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 16px;
        }

        /* TABLE VIEW (ClickUp-like gridlines) */
        #view-table {
            padding: 0 !important;
            overflow: auto;
            /* Match List view width (no full-bleed) */
            margin-left: 0;
            margin-right: 0;
            width: 100%;
            border-radius: 16px;
        }

        #view-table .table-wrapper {
            background: transparent !important;
            border-radius: 16px;
            border: 1px solid var(--border);
            overflow: auto;
            width: 100%;
        }

        .tasks-table {
            width: max-content;
            min-width: 100%;
            border-collapse: separate !important;
            border-spacing: 0;
            background: var(--surface-2);
            table-layout: fixed;
            position: relative;
        }

        .tasks-table thead th {
            position: sticky;
            top: 0;
            z-index: 50;
            background: var(--surface-2);
            color: var(--text-muted);
            font-size: 12px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            border-bottom: 1px solid var(--gridline-strong);
            box-shadow: 0 1px 0 0 var(--gridline-strong);
            white-space: nowrap;
            overflow: visible;
            text-overflow: clip;
        }

        .tasks-table th,
        .tasks-table td {
            padding: 12px 14px !important;
            border-bottom: 1px solid var(--gridline);
            color: var(--text-main);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            min-width: 0;
            position: relative;
            z-index: 1;
        }

        .tasks-table thead th {
            z-index: 60;
        }

        /* Prevent cell controls from overflowing resized columns */
        .tasks-table td > *,
        .tasks-table th > * {
            max-width: 100%;
        }

        .tasks-table td select,
        .tasks-table td input,
        .tasks-table td button {
            max-width: 100%;
        }

        .tasks-table td select {
            width: 100%;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .tasks-table tr:hover td {
            background: var(--surface-3);
        }

        /* Top bar: theme-aware glass */
        .top-bar {
            background: color-mix(in srgb, var(--surface-2) 82%, transparent);
            border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
        }

        :root[data-theme="dark"] .top-bar {
            background: color-mix(in srgb, rgba(15, 23, 42, 0.85) 60%, var(--surface-2));
            border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
        }

        /* SECURITY BADGE - CENTERED IN TOP BAR */
        .security-badge {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            background: #10B981;
            color: white;
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 11px;
            font-weight: 600;
            z-index: 100;
            display: flex;
            align-items: center;
            gap: 6px;
            box-shadow: var(--shadow);
            border: 1px solid rgba(255, 255, 255, 0.2);
            cursor: default;
        }

        /* MODERN SPLIT-SCREEN LOGIN - PREMIUM DESIGN */


        #login-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            z-index: 10000;
            overflow: hidden;
            background: var(--ft-surface-1);
        }

        /* Left Panel - match Sign In button red */
        #login-overlay::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            width: 50%;
            height: 100%;
            background: #D31027;
            z-index: 1;
        }

        /* Geometric Pattern Overlay */
        #login-overlay::after {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            width: 50%;
            height: 100%;
            background-image:
                radial-gradient(circle at 16% 40%, rgba(239, 68, 68, 0.06) 0%, transparent 52%),
                radial-gradient(circle at 86% 72%, rgba(255, 255, 255, 0.008) 0%, transparent 56%),
                linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
            background-size: auto, auto, 54px 54px, 54px 54px;
            z-index: 2;
            pointer-events: none;
            opacity: 0.08;
        }

        /* Remove AI assistant UI from login page (widget + panel) */
        #login-overlay:not([style*="display: none"]) ~ #ai-agent-btn,
        #login-overlay:not([style*="display: none"]) ~ #ai-agent-panel,
        #login-overlay:not([style*="display: none"]) ~ .ai-agent-btn {
            display: none !important;
        }

        .login-card {
            position: relative;
            width: 100%;
            height: 100%;
            display: grid;
            grid-template-columns: 1fr 1fr;
            background: transparent;
            border: none;
            box-shadow: none;
            animation: none;
            margin: 0;
            padding: 0;
            border-radius: 0;
        }

        /* Keep the login feeling tight and premium */
        #login-overlay .login-card {
            font-family: var(--ft-font);
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Hide User List for Professional Look */
        /* RESTORED USER LIST (CLEAN) */
        #user-list {
            display: none !important;
            flex-direction: column;
            gap: 8px;
            width: 100%;
            margin-bottom: 24px;
        }

        .user-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 16px;
            background: var(--bg-app);
            border: 1px solid var(--border);
            border-radius: 8px;
            cursor: pointer;
            transition: var(--transition);
        }

        .user-item:hover {
            border-color: var(--brand-primary);
            background: white;
            transform: translateY(-1px);
            box-shadow: var(--shadow-sm);
        }

        .user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--brand-primary-light);
            color: var(--brand-primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 12px;
        }

        .user-info {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            white-space: nowrap;
        }

        .user-name {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-main);
        }

        .user-role {
            font-size: 11px;
            color: var(--text-muted);
        }

        /* Show only Admin Login Form elements if needed, or just hide the list */
        /* We will rely on the existing form structure but hide the list */

        .login-card h2 {
            font-size: 24px;
            font-weight: 700;
            color: var(--text-main);
            margin-bottom: 8px;
            letter-spacing: -0.02em;
        }

        .login-card>p {
            font-size: 14px;
            color: var(--text-muted);
            margin-bottom: 32px;
        }

        .login-content-wrapper {
            width: 100%;
            animation: fadeInScale 0.8s cubic-bezier(0.16, 1, 0.3, 1);
        }

        @keyframes fadeInScale {
            from {
                opacity: 0;
                transform: scale(0.95);
            }

            to {
                opacity: 1;
                transform: scale(1);
            }
        }

        .login-content-wrapper {
            width: 100%;
            max-width: 420px;
            text-align: left;
            animation: slideInRight 0.6s cubic-bezier(0.16, 1, 0.3, 1);
        }

        /* Left Panel Content */
        .login-left-panel {
            position: relative;
            z-index: 3;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
            padding: 28px 36px;
            color: white;
            height: 100%;
            box-sizing: border-box;
        }

        .login-logo {
            font-family: var(--ft-font);
            font-size: 52px;
            font-weight: 600;
            letter-spacing: 0.08em;
            margin-bottom: 16px;
            text-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
            text-transform: uppercase;
            color: white;
            -webkit-text-fill-color: white;
        }

        .login-tagline {
            font-family: var(--ft-font);
            font-size: 18px;
            font-weight: 300;
            opacity: 0.95;
            text-align: center;
            max-width: 400px;
            line-height: 1.6;
        }

        .login-version {
            position: absolute;
            bottom: 40px;
            left: 40px;
            font-size: 12px;
            font-weight: 500;
            opacity: 0.7;
            letter-spacing: 0.05em;
        }

        /* Right Panel Content */
        .login-right-panel {
            background: var(--bg-panel);
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
            padding: 44px 56px;
            position: relative;
            z-index: 3;
            overflow-y: auto;
            max-height: 100%;
            background: rgba(255, 255, 255, 0.92);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            border-left: 1px solid rgba(0, 0, 0, 0.06);
            box-shadow: -22px 0 70px rgba(0, 0, 0, 0.12);
        }

        .login-content-wrapper {
            width: 100%;
            max-width: 420px;
        }

        .login-card h2 {
            font-family: var(--ft-font);
            font-size: 32px;
            font-weight: var(--ft-weight-bold);
            color: var(--text-main);
            margin-bottom: 8px;
            letter-spacing: -0.02em;
        }

        .login-card p {
            font-family: var(--ft-font);
            font-size: 15px;
            color: var(--text-muted);
            margin-bottom: 26px;
            font-weight: 400;
        }

        /* User List Styling Update */
        #user-list {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .user-btn {
            padding: 20px;
            border: 1px solid var(--border);
            border-radius: 12px;
            background: white;
            transition: all 0.2s ease;
        }

        .user-btn:hover {
            border-color: var(--brand-primary);
            box-shadow: var(--shadow-md);
            transform: translateY(-2px);
            background: var(--brand-primary-light);
        }

        .user-btn span:first-child {
            font-size: 16px;
            color: var(--text-main);
        }

        .user-btn small {
            background: var(--border-light);
            color: var(--text-secondary);
            padding: 4px 10px;
            font-size: 12px;
        }

        /* Enhanced Input Fields */
        .login-input-group {
            margin-bottom: 20px;
        }

        .login-input-group label {
            display: block;
            font-family: var(--ft-font);
            font-size: 13px;
            font-weight: var(--ft-weight-semibold);
            color: var(--text-secondary);
            margin-bottom: 8px;
            letter-spacing: 0.02em;
        }

        .login-input-group input {
            width: 100%;
            padding: 12px 14px;
            border: 1.5px solid var(--border);
            border-radius: 10px;
            background: var(--bg-app);
            color: var(--text-main);
            font-family: var(--ft-font);
            font-size: 14px;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        }

        .login-input-group input:focus {
            border-color: var(--brand-primary);
            background: white;
            color: #1a1d29;
            box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1), 0 2px 8px rgba(0, 0, 0, 0.08);
        }

        .login-input-group input::placeholder {
            color: var(--text-light);
        }

        /* Premium Login Button */
        .login-btn {
            width: 100%;
            padding: 12px 14px;
            background: linear-gradient(135deg, #D31027 0%, #EA384D 100%);
            color: white;
            border: none;
            border-radius: 10px;
            font-family: var(--ft-font);
            font-size: 15px;
            font-weight: var(--ft-weight-semibold);
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 10px 24px rgba(211, 16, 39, 0.22);
            letter-spacing: 0.03em;
            margin-top: 8px;
        }

        /* Make buttons match left-side deep red theme */
        .login-btn.primary {
            background: linear-gradient(135deg, #D31027 0%, #D31027 55%, #EA384D 100%);
            box-shadow: 0 14px 34px rgba(185, 14, 34, 0.28);
        }
        .login-btn.primary:hover {
            box-shadow: 0 14px 40px rgba(185, 14, 34, 0.42);
        }

        .login-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(211, 16, 39, 0.45);
        }

        .login-btn:active {
            transform: translateY(0);
        }

        /* Primary button uses default red style */


        .login-btn.secondary {
            background: transparent;
            border: 2px solid rgba(185, 14, 34, 0.28);
            color: #7a2831;
            box-shadow: none;
        }

        /* Pricing cards typography (inline styles are heavy) */
        #login-overlay .pricing-plan-name,
        #login-overlay .pricing-price,
        #login-overlay .pricing-badge {
            font-weight: var(--ft-weight-semibold) !important;
        }

        /* On smaller screens: stack panels, reduce whitespace */
        @media (max-width: 980px) {
            #login-overlay::before,
            #login-overlay::after {
                width: 100%;
            }

            .login-card {
                grid-template-columns: 1fr;
            }

            .login-left-panel {
                padding: 22px 18px;
            }

            .login-right-panel {
                padding: 22px 18px;
            }

            .login-logo {
                font-size: 40px;
            }
        }

        .login-btn.secondary:hover {
            border-color: rgba(185, 14, 34, 0.55);
            color: #D31027;
            background: rgba(211, 16, 39, 0.08);
            transform: translateY(-1px);
            box-shadow: none;
        }

        /* Auth Tabs */
        .auth-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 28px;
            background: linear-gradient(135deg, rgba(211, 16, 39, 0.08) 0%, rgba(0,0,0,0.02) 100%);
            padding: 6px;
            border-radius: 12px;
            border: 1px solid rgba(211, 16, 39, 0.10);
        }

        .auth-tab {
            flex: 1;
            padding: 12px 16px;
            border: none;
            background: transparent;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 700;
            color: #7a2831;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .auth-tab:hover {
            color: #4b0d14;
        }

        .auth-tab.active {
            background: linear-gradient(135deg, #D31027 0%, #D31027 60%, #EA384D 100%);
            color: #ffffff;
            box-shadow: 0 10px 22px rgba(185, 14, 34, 0.20);
            border: 1px solid rgba(185, 14, 34, 0.30);
        }

        .auth-tab i {
            font-size: 13px;
        }

        /* Auth Subtitle */
        .auth-subtitle {
            color: var(--text-secondary);
            font-size: 14px;
            margin-bottom: 24px;
        }

        /* Auth Divider */
        .auth-divider {
            display: flex;
            align-items: center;
            margin: 24px 0;
            gap: 16px;
        }

        .auth-divider::before,
        .auth-divider::after {
            content: '';
            flex: 1;
            height: 1px;
            background: var(--border);
        }

        .auth-divider span {
            color: var(--text-muted);
            font-size: 12px;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* Login Panel Tabs (Features/Pricing toggle) */
        .login-panel-tabs {
            display: flex;
            gap: 8px;
            margin: 24px 0;
            padding: 4px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 10px;
        }

        .login-panel-tab {
            flex: 1;
            padding: 10px 16px;
            border: none;
            background: transparent;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.7);
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .login-panel-tab:hover {
            color: white;
            background: rgba(255, 255, 255, 0.1);
        }

        .login-panel-tab.active {
            background: rgba(255, 255, 255, 0.2);
            color: white;
        }

        .login-panel-content {
            animation: fadeIn 0.3s ease;
        }

        /* Login Features Grid */
        .login-features {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px 20px;
        }

        .login-feature {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 13px;
            color: rgba(255, 255, 255, 0.9);
        }

        .login-feature i {
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.15);
            border-radius: 8px;
            font-size: 14px;
        }

        /* Pricing Cards Container */
        .pricing-cards {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        /* Individual Pricing Card */
        .pricing-card {
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-radius: 12px;
            padding: 12px 16px;
            border: 1px solid rgba(255, 255, 255, 0.25);
            position: relative;
            transition: all 0.3s ease;
        }

        .pricing-card:hover {
            background: rgba(255, 255, 255, 0.22);
            transform: translateY(-2px);
            border-color: rgba(255, 255, 255, 0.4);
        }

        .pricing-card.featured {
            background: rgba(255, 255, 255, 0.25);
            border: 2px solid rgba(255, 255, 255, 0.5);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        }

        .pricing-badge {
            position: absolute;
            top: -8px;
            right: 16px;
            background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
            color: #e53935;
            font-size: 9px;
            font-weight: 800;
            padding: 3px 10px;
            border-radius: 20px;
            letter-spacing: 0.5px;
        }

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

        .pricing-plan-name {
            font-size: 16px;
            font-weight: 700;
            color: #ffffff;
        }

        .pricing-price {
            font-size: 22px;
            font-weight: 800;
            color: #ffffff;
        }

        .pricing-price span {
            font-size: 11px;
            font-weight: 400;
            opacity: 0.75;
        }

        .pricing-features-list {
            list-style: none;
            padding: 0;
            margin: 0;
            display: flex;
            flex-wrap: wrap;
            gap: 4px 10px;
        }

        .pricing-features-list li {
            font-size: 11px;
            color: rgba(255, 255, 255, 0.9);
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .pricing-features-list li i.fa-check {
            color: #90EE90;
            font-size: 9px;
        }

        .pricing-features-list li i.fa-times {
            color: rgba(255, 255, 255, 0.35);
            font-size: 9px;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* PRO Badge for Gated Features */
        .pro-badge-small {
            display: inline-block;
            background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
            color: #000;
            font-size: 8px;
            font-weight: 800;
            padding: 2px 6px;
            border-radius: 4px;
            margin-left: 4px;
            vertical-align: middle;
            letter-spacing: 0.5px;
        }

        .view-btn .pro-badge-small {
            font-size: 7px;
            padding: 1px 4px;
        }

        /* Form Sections */
        .form-section {
            margin-bottom: 24px;
            padding: 20px;
            background: rgba(255, 255, 255, 0.78);
            border-radius: 12px;
            border: 1px solid rgba(185, 14, 34, 0.12);
            box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
        }

        .form-section-label {
            font-size: 12px;
            font-weight: 700;
            color: #D31027;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .form-section-label i {
            font-size: 14px;
            color: #D31027;
        }

        .form-section .login-input-group {
            margin-bottom: 12px;
        }

        .form-section .login-input-group:last-child {
            margin-bottom: 0;
        }

        /* Input Hint */
        .input-hint {
            display: block;
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 6px;
        }

        /* Signup Terms */
        .signup-terms {
            margin: 20px 0;
        }

        .checkbox-label {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            font-size: 13px;
            color: var(--text-secondary);
            cursor: pointer;
        }

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

        .checkbox-label a {
            color: #D31027;
            text-decoration: none;
            font-weight: 700;
        }

        .checkbox-label a:hover {
            text-decoration: underline;
        }

        /* Auth Footer */
        .auth-footer {
            text-align: center;
            margin-top: 24px;
            font-size: 14px;
            color: var(--text-secondary);
        }

        .auth-footer a {
            color: var(--brand-primary);
            font-weight: 600;
            text-decoration: none;
        }

        .auth-footer a:hover {
            text-decoration: underline;
        }

        /* Login Features List */
        .login-branding {
            text-align: center;
            margin-bottom: 40px;
        }

        .login-logo-icon {
            width: 64px;
            height: 64px;
            background: rgba(255, 255, 255, 0.12);
            border: 1px solid rgba(255, 255, 255, 0.22);
            backdrop-filter: blur(6px);
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 20px;
            font-size: 28px;
            color: white;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
        }

        .login-logo-icon img {
            width: 40px;
            height: 40px;
            object-fit: contain;
            filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.2));
        }

        .login-features {
            margin-top: 40px;
        }

        .login-feature {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 14px 0;
            color: rgba(255, 255, 255, 0.9);
            font-size: 14px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .login-feature:last-child {
            border-bottom: none;
        }

        .login-feature i {
            width: 36px;
            height: 36px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
        }

        /* Error Message Styling */
        .login-error {
            background: #FEE2E2;
            color: #991B1B;
            padding: 12px 16px;
            border-radius: 8px;
            margin-bottom: 20px;
            font-size: 13px;
            font-weight: 500;
            border-left: 3px solid #EF4444;
            display: none;
        }

        /* Mobile Responsive */
        @media (max-width: 1024px) {

            #login-overlay::before,
            #login-overlay::after {
                display: none;
            }

            .login-card {
                grid-template-columns: 1fr;
                width: 100%;
                background: white;
            }

            .login-left-panel {
                display: none;
            }

            .login-right-panel {
                padding: 40px 30px;
            }
        }

        /* OVERVIEW TAB STYLES - HIGH IMPACT */
        .overview-container {
            height: calc(100% - 140px);
            overflow-y: auto;
            padding-right: 10px;
        }

        .overview-header-card {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: var(--shadow);
        }

        .oh-top {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 20px;
        }

        .oh-identity {
            display: flex;
            gap: 15px;
            align-items: center;
        }

        .oh-icon {
            font-size: 32px;
            width: 50px;
            height: 50px;
            background: var(--bg-app);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--border);
        }

        .oh-title-box h2 {
            margin: 0 0 5px 0;
            font-size: 24px;
            color: var(--text-main);
        }

        .oh-lead-input {
            background: transparent;
            border: none;
            color: var(--text-muted);
            font-size: 14px;
            width: 200px;
        }

        .oh-lead-input:focus {
            outline: none;
            border-bottom: 1px solid var(--brand-primary);
        }

        .oh-controls {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .rag-selector select {
            padding: 8px 12px;
            border-radius: 8px;
            border: 1px solid var(--border);
            background: var(--bg-app);
            color: var(--text-main);
            font-weight: 600;
            cursor: pointer;
        }

        .oh-bottom {
            border-top: 1px solid var(--border);
            padding-top: 15px;
        }

        .oh-dates {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .date-group {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .date-group label {
            font-size: 11px;
            color: var(--text-muted);
            text-transform: uppercase;
            font-weight: 600;
        }

        .date-group input {
            background: var(--bg-app);
            border: 1px solid var(--border);
            padding: 6px;
            border-radius: 6px;
            color: var(--text-main);
            font-size: 13px;
        }

        .date-arrow {
            color: var(--text-muted);
        }

        .days-remaining {
            margin-left: auto;
            background: var(--bg-app);
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            color: var(--brand-primary);
            border: 1px solid var(--border);
        }

        /* METRICS ROW */
        .metrics-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 20px;
            margin-bottom: 20px;
        }

        .metric-card {
            background: var(--bg-panel);
            padding: 20px;
            border-radius: 12px;
            border: 1px solid var(--border);
            box-shadow: var(--shadow);
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .metric-label {
            font-size: 13px;
            color: var(--text-muted);
            margin-bottom: 5px;
            font-weight: 500;
        }

        .metric-value {
            font-size: 28px;
            font-weight: 700;
            color: var(--text-main);
            margin-bottom: 5px;
        }

        .metric-sub {
            font-size: 12px;
            color: var(--text-muted);
        }

        .progress-bar-container {
            height: 8px;
            background: var(--bg-app);
            border-radius: 4px;
            overflow: hidden;
            margin-top: 5px;
        }

        .progress-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--brand-primary), #EA384D);
            border-radius: 4px;
            transition: width 0.5s ease;
        }

        /* GRID LAYOUT */
        .overview-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 20px;
            padding-bottom: 20px;
        }

        .og-col {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .content-card {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 20px;
            box-shadow: var(--shadow);
        }

        .content-card h3 {
            font-size: 15px;
            margin-bottom: 15px;
            color: var(--text-main);
            display: flex;
            align-items: center;
            gap: 8px;
            border-bottom: 1px solid var(--border);
            padding-bottom: 10px;
        }

        .content-card textarea {
            width: 100%;
            height: 150px;
            background: var(--bg-app);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 12px;
            color: var(--text-main);
            font-family: var(--ft-font);
            font-size: 13px;
            resize: vertical;
            line-height: 1.5;
        }

        .chart-container {
            position: relative;
            height: 200px;
            width: 100%;
            max-width: 100%;
        }

        /* AI CARD */
        .ai-card {
            background: linear-gradient(135deg, #FFF 0%, #F3F4F6 100%);
            border: 1px solid #E5E7EB;
        }

        .ai-badge {
            background: linear-gradient(90deg, #6366F1, #8B5CF6);
            color: white;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 700;
            display: inline-block;
            margin-bottom: 10px;
            box-shadow: 0 2px 5px rgba(99, 102, 241, 0.3);
        }

        .ai-content {
            font-size: 13px;
            line-height: 1.6;
            color: #374151;
        }

        /* PULSE LIST */
        .pulse-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .pulse-item {
            display: flex;
            gap: 10px;
            font-size: 13px;
        }

        .pulse-icon {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: var(--bg-app);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            color: var(--text-muted);
            border: 1px solid var(--border);
            flex-shrink: 0;
        }

        .pulse-details {
            display: flex;
            flex-direction: column;
        }

        .pulse-text {
            color: var(--text-main);
        }

        .pulse-time {
            font-size: 11px;
            color: var(--text-muted);
        }

        .text-red {
            color: #EF4444;
        }

        .text-green {
            color: #10B981;
        }

        .text-amber {
            color: #F59E0B;
        }

        /* Make user list more compact */
        #user-list {
            margin: 15px 0;
            /* Reduced from 25px 0 */
            display: none;
            flex-direction: column;
            gap: 10px;
            /* Reduced from 12px */
        }

        .user-btn {
            width: 100%;
            padding: 14px 16px;
            /* Reduced from 16px 20px */
            margin: 0;
            background: var(--bg-panel);
            border: 1px solid var(--border);
            color: var(--text-main);
            border-radius: 8px;
            /* Reduced from 10px */
            cursor: pointer;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            font-weight: 500;
            transition: all 0.3s ease;
            text-align: left;
            position: relative;
        }

        .user-btn:hover {
            border-color: var(--brand-primary);
            box-shadow: var(--shadow-md);
            transform: translateY(-2px);
            background: var(--brand-primary-light);
        }

        /* Make user name text smaller */
        .user-btn span:first-child {
            font-size: 14px;
            /* Reduced from 15px */
            font-weight: 600;
            color: var(--text-main);
            margin-bottom: 4px;
            display: flex;
            justify-content: space-between;
            width: 100%;
        }

        /* Make role badge smaller */
        .user-btn small {
            font-size: 11px;
            /* Reduced from 12px */
            color: var(--text-muted);
            background: var(--bg-app);
            padding: 2px 6px;
            /* Reduced from 3px 8px */
            border-radius: 10px;
            /* Reduced from 12px */
            font-weight: 500;
        }

        /* Make email text smaller */
        .user-btn .user-email {
            font-size: 11px;
            /* Reduced from 12px */
            color: var(--text-muted);
            margin-top: 2px;
            /* Reduced from 4px */
            word-break: break-word;
        }

        /* Make security features smaller */
        .security-features {
            text-align: left;
            margin-top: 20px;
            /* Reduced from 30px */
            padding: 15px;
            /* Reduced from 20px */
            background: linear-gradient(to right, var(--bg-app), #f8f9fa);
            border-radius: 10px;
            /* Reduced from 12px */
            font-size: 12px;
            /* Reduced from 13px */
            border: 1px solid var(--border-light);
        }

        .security-features strong {
            display: block;
            margin-bottom: 10px;
            /* Reduced from 12px */
            color: var(--text-main);
            font-size: 13px;
            /* Reduced from 14px */
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .security-features ul {
            margin: 0;
            padding-left: 18px;
            /* Reduced from 20px */
            display: grid;
            grid-template-columns: 1fr;
            gap: 6px;
            /* Reduced from 8px */
        }

        .security-features li {
            margin-bottom: 4px;
            /* Reduced from 6px */
            font-size: 11.5px;
            /* Reduced from 12.5px */
            color: var(--text-muted);
            display: flex;
            align-items: center;
            gap: 6px;
            /* Reduced from 8px */
        }

        .security-features li i {
            color: var(--brand-red);
            font-size: 10px;
            /* Reduced from 11px */
        }

        /* Make create admin button smaller */
        .login-card button[onclick="createAdmin()"] {
            margin-top: 20px;
            /* Reduced from 25px */
            background: none;
            border: 1px dashed var(--border);
            color: var(--text-muted);
            cursor: pointer;
            font-size: 12px;
            /* Reduced from 13px */
            padding: 10px;
            /* Reduced from 12px */
            border-radius: 6px;
            /* Reduced from 8px */
            width: 100%;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            /* Reduced from 8px */
        }

        /* Make the info text at bottom smaller */
        .login-card div[style*="margin-top: 20px"] {
            margin-top: 15px !important;
            font-size: 10px !important;
            /* Reduced from 11px */
        }

        /* Loading state */
        #user-list:empty::before {
            content: "Loading users...";
            color: var(--text-muted);
            font-style: italic;
            padding: 20px;
            text-align: center;
            display: block;
        }

        /* Empty state */
        #user-list .empty-state {
            text-align: center;
            padding: 30px 20px;
            color: var(--text-muted);
        }

        #user-list .empty-state i {
            font-size: 48px;
            margin-bottom: 15px;
            color: var(--border);
            opacity: 0.5;
        }

        /* Login form for creating admin (when triggered) */
        /* Admin creation form styles */
        .admin-creation-form {
            background: var(--bg-panel);
            padding: 20px;
            border-radius: 10px;
            border: 1px solid var(--border);
            margin-top: 20px;
        }

        .admin-creation-form .form-group {
            margin-bottom: 15px;
        }

        .admin-creation-form label {
            display: block;
            margin-bottom: 5px;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-muted);
        }

        .admin-creation-form input {
            width: 100%;
            padding: 10px;
            border: 1px solid var(--border);
            background: var(--bg-app);
            color: var(--text-main);
            border-radius: 6px;
            font-size: 14px;
            box-sizing: border-box;
        }

        .admin-creation-form input:focus {
            border-color: var(--brand-red);
            outline: none;
            box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.1);
        }

        .form-actions {
            display: flex;
            gap: 10px;
            margin-top: 20px;
        }

        .form-actions button {
            flex: 1;
            padding: 10px;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            font-size: 13px;
        }

        .form-actions .btn-primary {
            background: var(--brand-red);
            color: white;
        }

        .form-actions .btn-primary:hover {
            background: var(--brand-red-dark);
        }

        .form-actions .btn-secondary {
            background: var(--bg-app);
            color: var(--text-muted);
            border: 1px solid var(--border) !important;
        }

        .form-actions .btn-secondary:hover {
            background: var(--bg-panel);
        }

        /* User role badge colors */
        .role-admin {
            color: var(--brand-red) !important;
            background: rgba(230, 57, 70, 0.1) !important;
        }

        .role-member {
            color: #3B82F6 !important;
            background: rgba(59, 130, 246, 0.1) !important;
        }

        .role-owner {
            color: #92400e !important;
            background: rgba(245, 158, 11, 0.14) !important;
        }

        /* SESSION WARNING */
        .session-warning {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: var(--bg-panel);
            border: 2px solid var(--brand-red);
            border-radius: 12px;
            padding: 30px;
            box-shadow: var(--shadow-lg);
            z-index: 10002;
            text-align: center;
            display: none;
        }

        .session-warning h3 {
            color: var(--brand-red);
            margin-bottom: 15px;
        }

        /* APP LAYOUT */
        /* APP LAYOUT */
        /* FLOATING SIDEBAR */
        :root {
            --sidebar-width: 275px;
            --sidebar-gap: 16px;
            --content-inset: 12px;
        }

        aside {
            position: fixed;
            top: var(--sidebar-gap);
            left: var(--sidebar-gap);
            bottom: var(--sidebar-gap);
            width: var(--sidebar-width);
            background: var(--bg-panel);
            border-radius: 18px;
            display: flex;
            flex-direction: column;
            border: 1px solid var(--border);
            box-shadow: var(--shadow-lg);
            z-index: 50;
            overflow: hidden;
            transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* Sidebar modern spacing + clearer section rhythm */
        #sidebar-nav {
            padding: 16px 10px;
        }

        #sidebar-nav .sidebar-section-label {
            padding: 0 10px;
            margin-top: 16px;
        }

        /* Workspace groups separation (ClickUp-like but more SaaS clean) */
        #sidebar-nav .space-group {
            padding: 0 6px;
            margin-top: 10px;
        }

        #sidebar-nav .space-group:first-child {
            margin-top: 0;
        }

        #sidebar-nav .space-group + .space-group {
            border-top: 1px solid var(--border);
            padding-top: 10px;
        }

        /* Individual workspace folders: hidden by default, shown when expanded */
        #sidebar-nav .folder-container {
            display: none;
        }

        /* Keep nested folders visually compact under expanded workspace */
        #sidebar-nav .folder-container.open {
            display: block;
            padding-top: 6px;
            padding-bottom: 8px;
        }

        /* Resize Handle - DISABLED: sidebar width is fixed, only collapsible via button */
        .sidebar-resizer {
            display: none;
        }

        /* Vertical Resize Handle removed (stable sidebar layout) */
        .sidebar-vertical-resizer {
            display: none !important;
        }

        .account-section {
            overflow: hidden;
            transition: max-height .24s ease, opacity .2s ease;
            max-height: 360px;
            opacity: 1;
        }

        .account-section.collapsed {
            max-height: 52px;
            min-height: 52px;
            opacity: 1;
        }

        #account-actions {
            overflow: hidden;
            transition: max-height .24s ease;
            max-height: 420px;
        }

        .account-section.collapsed #account-actions {
            max-height: 0;
        }

        /* Top bar actions: search trigger, icon buttons, divider before + New Task. */
        .user-name-container[hidden] {
            display: none !important;
        }

        .top-bar-search {
            display: flex;
            align-items: center;
            gap: 8px;
            height: 34px;
            min-width: 180px;
            padding: 0 6px 0 12px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--bg-app);
            color: var(--text-muted);
            font: inherit;
            font-size: 13px;
            cursor: pointer;
            transition: var(--transition);
        }

        .top-bar-search i {
            font-size: 12px;
        }

        .top-bar-search-text {
            flex: 1;
            text-align: left;
        }

        .top-bar-search:hover {
            border-color: var(--border-focus);
            color: var(--text-secondary);
        }

        .top-bar-kbd {
            padding: 2px 6px;
            border: 1px solid var(--border);
            border-radius: 6px;
            background: var(--bg-panel);
            color: var(--text-muted);
            font-family: inherit;
            font-size: 11px;
            line-height: 1.4;
            white-space: nowrap;
        }

        .top-bar-icon-btn {
            position: relative;
            width: 34px;
            height: 34px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid transparent;
            border-radius: 10px;
            background: transparent;
            color: var(--text-secondary);
            font-size: 15px;
            cursor: pointer;
            transition: var(--transition);
        }

        .top-bar-icon-btn:hover {
            background: var(--surface-3);
            border-color: var(--gridline-strong);
            color: var(--text-main);
        }

        .top-bar-search:focus-visible,
        .top-bar-icon-btn:focus-visible {
            outline: none;
            box-shadow: var(--shadow-glow);
        }

        .top-bar-divider {
            width: 1px;
            height: 22px;
            margin: 0 4px;
            background: var(--border);
        }

        @media (max-width: 768px) {
            .top-bar-divider {
                display: none;
            }
        }

        /* Sidebar user menu: avatar chip at the bottom, menu opens upward. */
        .sidebar-user {
            position: relative;
            flex-shrink: 0;
            padding: 8px 10px 10px;
            border-top: 1px solid var(--border);
        }

        .sidebar-user-chip {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px;
            border: 1px solid transparent;
            border-radius: 12px;
            background: transparent;
            color: var(--text-main);
            cursor: pointer;
            text-align: left;
            font: inherit;
            transition: var(--transition);
        }

        .sidebar-user-chip:hover,
        .sidebar-user-chip[aria-expanded="true"] {
            background: var(--surface-3);
            border-color: var(--gridline-strong);
        }

        .sidebar-user-chip:focus-visible,
        .sidebar-user-menu button:focus-visible {
            outline: none;
            box-shadow: var(--shadow-glow);
        }

        .sidebar-user-avatar {
            width: 34px;
            height: 34px;
            flex-shrink: 0;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--brand-primary-light);
            color: var(--brand-primary);
            font-size: 13px;
            font-weight: 700;
        }

        .sidebar-user-text {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            line-height: 1.25;
        }

        .sidebar-user-name {
            font-size: 13px;
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .sidebar-user-role {
            font-size: 11px;
            color: var(--text-muted);
        }

        .sidebar-user-role:empty {
            display: none;
        }

        .sidebar-user-chevron {
            font-size: 11px;
            color: var(--text-muted);
            transition: transform .2s ease;
        }

        .sidebar-user-chip[aria-expanded="true"] .sidebar-user-chevron {
            transform: rotate(180deg);
        }

        .sidebar-user-menu {
            position: absolute;
            left: 10px;
            right: 10px;
            bottom: calc(100% - 4px);
            z-index: 20;
            padding: 6px;
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 12px;
            box-shadow: var(--shadow-xl), var(--shadow-md);
        }

        .sidebar-user-menu[hidden] {
            display: none;
        }

        .sidebar-user-menu-head {
            padding: 8px 10px 10px;
            margin-bottom: 4px;
            border-bottom: 1px solid var(--border-light);
        }

        .sidebar-user-menu-name {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-main);
        }

        .sidebar-user-menu-email {
            font-size: 12px;
            color: var(--text-muted);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .sidebar-user-menu button {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 9px 10px;
            border: none;
            border-radius: 8px;
            background: transparent;
            color: var(--text-secondary);
            font: inherit;
            font-size: 13px;
            text-align: left;
            cursor: pointer;
        }

        .sidebar-user-menu button i {
            width: 16px;
            text-align: center;
        }

        .sidebar-user-menu button:hover {
            background: var(--bg-hover);
            color: var(--text-main);
        }

        .sidebar-user-menu .sidebar-user-menu-danger {
            color: var(--danger);
        }

        .sidebar-user-menu .sidebar-user-menu-danger:hover {
            background: var(--brand-primary-light);
            color: var(--danger);
        }

        .sidebar-user-menu-sep {
            height: 1px;
            margin: 4px 0;
            background: var(--border-light);
        }

        .sidebar-user-switch {
            position: relative;
            width: 30px;
            height: 18px;
            margin-left: auto;
            flex-shrink: 0;
            border-radius: 9px;
            background: var(--border);
            transition: background .2s ease;
        }

        .sidebar-user-switch::after {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: #fff;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
            transition: transform .2s ease;
        }

        #sidebar-user-theme-btn[aria-checked="true"] .sidebar-user-switch {
            background: var(--brand-primary);
        }

        #sidebar-user-theme-btn[aria-checked="true"] .sidebar-user-switch::after {
            transform: translateX(12px);
        }

        /* 769-1024px: the sidebar is an 80px rail, so show only the avatar.
           The menu is then placed beside the rail by positionSidebarUserMenu(). */
        @media (min-width: 769px) and (max-width: 1024px) {
            .sidebar-user {
                padding: 8px 6px 10px;
            }

            .sidebar-user-chip {
                justify-content: center;
                padding: 6px 0;
            }

            .sidebar-user-text,
            .sidebar-user-chevron {
                display: none;
            }
        }

        .sidebar-user-menu.is-floating {
            position: fixed;
            right: auto;
            width: 240px;
            z-index: 3000;
        }

        .section-toggle-btn {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            font-weight: 700;
        }

        .section-toggle-left {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
        }

        .section-toggle-chevron {
            transition: transform .2s ease;
            font-size: 12px;
            opacity: .75;
        }

        .account-section.collapsed .section-toggle-chevron {
            transform: rotate(-90deg);
        }

        .workspace-tools {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-left: auto;
        }

        .section-tool {
            cursor: pointer;
            font-size: 12px;
            color: var(--text-muted);
            padding: 4px;
            border-radius: 6px;
            transition: all .2s ease;
        }

        .section-tool:hover {
            color: var(--brand-primary);
            background: var(--bg-hover);
        }

        /* Narrow/Icon-Only State - Activated when width < 100px */
        /* Width is controlled by CSS variable --sidebar-width, not fixed here */

        /* Brand - Icon Only */
        aside.narrow .brand {
            padding: 14px 0;
            justify-content: center;
            border-bottom: 1px solid var(--border);
            font-size: 0 !important;
        }

        aside.narrow .brand i {
            font-size: 24px !important;
            margin: 0;
        }

        /* COMPLETELY hide all text - aggressive approach */
        aside.narrow * {
            font-size: 0 !important;
        }

        aside.narrow .sidebar-item,
        aside.narrow .space-header,
        aside.narrow .folder-item,
        aside.narrow .session-timer,
        aside.narrow .user-menu-sound {
            overflow: hidden;
            text-indent: -9999px;
        }

        /* Force ALL icons to be visible and properly sized */
        aside.narrow i,
        aside.narrow .fa,
        aside.narrow .fas,
        aside.narrow .far {
            font-size: 16px !important;
            display: inline-flex !important;
            align-items: center !important;
            justify-content: center !important;
            width: 32px !important;
            height: 32px !important;
            border-radius: 10px !important;
            background: var(--icon-pill) !important;
            color: var(--text-secondary) !important;
            margin: 0 !important;
            line-height: 1 !important;
            text-indent: 0 !important;
        }

        /* Hide section labels */
        aside.narrow .sidebar-section-label {
            display: none;
        }

        /* Navigation items - centered icons only */
        aside.narrow .nav-section {
            padding: 16px 0;
        }

        aside.narrow .sidebar-item,
        aside.narrow .space-header {
            width: 100%;
            height: 56px;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 4px 0;
            border-radius: 12px;
            position: relative;
        }

        aside.narrow .sidebar-item:hover,
        aside.narrow .space-header:hover {
            background: var(--surface-3);
        }

        aside.narrow .sidebar-item.active {
            background: color-mix(in srgb, var(--brand-primary-light) 55%, transparent);
        }

        aside.narrow .sidebar-item.active::before {
            display: none;
        }

        aside.narrow .sidebar-item.active i,
        aside.narrow .space-header:hover i {
            color: var(--brand-primary) !important;
            background: color-mix(in srgb, var(--brand-primary) 14%, transparent) !important;
        }

        /* Hide folder containers completely */
        aside.narrow .folder-container,
        aside.narrow .space-header>div:last-child {
            display: none !important;
        }

        /* Session timer and notifications - icon only */
        aside.narrow .session-timer,
        aside.narrow .user-menu-sound {
            width: 100%;
            height: 48px;
            padding: 0;
            margin: 8px 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Add tooltips to narrow items */
        aside.narrow .sidebar-item,
        aside.narrow .space-header {
            position: relative;
            cursor: pointer;
        }

        aside.narrow .sidebar-item::after,
        aside.narrow .space-header::after {
            content: attr(data-tooltip);
            position: absolute;
            left: 100%;
            top: 50%;
            transform: translateY(-50%);
            background: var(--text-main);
            color: white;
            padding: 8px 12px;
            border-radius: 8px;
            font-size: 13px;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            margin-left: 12px;
            z-index: 1000;
            transition: opacity 0.2s;
            box-shadow: var(--shadow-lg);
        }

        aside.narrow .sidebar-item:hover::after,
        aside.narrow .space-header:hover::after {
            opacity: 1;
        }

        /* Remove Collapse Button - No longer needed */

        /* Sidebar Brand Update */
        .brand {
            padding: 14px 16px;
            border-bottom: 1px solid var(--border-light);
            font-weight: 800;
            font-size: 18px;
            display: flex;
            gap: 12px;
            align-items: center;
            color: var(--brand-primary);
            background: transparent;
            letter-spacing: -0.03em;
        }

        .brand i {
            color: var(--brand-primary);
            font-size: 24px;
            filter: drop-shadow(0 4px 6px rgba(225, 29, 72, 0.3));
        }

        .nav-section {
            flex-grow: 1;
            overflow-y: auto;
            padding: 20px 12px;
        }

        .nav-section::-webkit-scrollbar-thumb {
            background: #334155;
        }

        /* MODERN WHITE SIDEBAR */
        /* UNIFIED SIDEBAR STYLES */

        /* ============================================
           PREMIUM ORGANIZATION SWITCHER STYLES
           ============================================ */
        .org-switcher {
            padding: 16px;
            margin-bottom: 8px;
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.05));
            border-bottom: 1px solid rgba(99, 102, 241, 0.15);
            position: relative;
        }

        .org-switcher-btn {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            background: var(--bg-panel, var(--bg-secondary));
            border: 1px solid var(--border);
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
            position: relative;
            overflow: hidden;
        }

        .org-switcher-btn::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), transparent);
            opacity: 0;
            transition: opacity 0.3s;
        }

        .org-switcher-btn:hover {
            background: var(--bg-hover);
            border-color: color-mix(in srgb, var(--brand-primary) 40%, transparent);
            box-shadow: 0 4px 16px rgba(185, 14, 34, 0.18);
            transform: translateY(-1px);
        }

        .org-switcher-btn:hover::before {
            opacity: 1;
        }

        .org-logo {
            width: 34px;
            height: 34px;
            background: white;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 700;
            font-size: 13px;
            letter-spacing: 0.5px;
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
            flex-shrink: 0;
            position: relative;
        }

        .org-logo::after {
            content: '';
            position: absolute;
            inset: -2px;
            border-radius: 12px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
            pointer-events: none;
        }

        .org-info {
            flex: 1;
            text-align: left;
            min-width: 0;
        }

        .org-name {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-main);
            white-space: normal;
            overflow: hidden;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            line-clamp: 2;
            letter-spacing: -0.01em;
            line-height: 1.25;
        }

        .org-plan {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 9px;
            font-weight: 600;
            color: var(--brand-primary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-top: 3px;
            padding: 2px 6px;
            background: rgba(211, 16, 39, 0.10);
            border-radius: 20px;
        }

        .org-plan::before {
            content: '✦';
            font-size: 8px;
        }

        .org-switcher-btn .chevron-icon {
            color: var(--text-muted);
            font-size: 11px;
            transition: transform 0.3s ease;
            flex-shrink: 0;
        }

        .org-switcher-btn:hover .chevron-icon {
            color: var(--brand-primary);
        }

        .org-switcher.dropdown-open .chevron-icon {
            transform: rotate(180deg);
        }

        /* Premium Dropdown Styles */
        .org-dropdown {
            position: absolute;
            top: calc(100% + 8px);
            left: 16px;
            right: 16px;
            background: var(--bg-panel, var(--bg-main));
            border: 1px solid var(--border);
            border-radius: 14px;
            box-shadow:
                0 20px 40px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(211, 16, 39, 0.12);
            z-index: 1000;
            display: none;
            max-height: 340px;
            overflow: hidden;
            animation: dropdownSlide 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }

        @keyframes dropdownSlide {
            from {
                opacity: 0;
                transform: translateY(-8px) scale(0.98);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .org-dropdown.show {
            display: block;
        }

        .org-dropdown-header {
            padding: 12px 14px 10px;
            font-size: 10px;
            font-weight: 800;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 1px;
            border-bottom: 1px solid var(--border);
        }

        .org-dropdown-list {
            max-height: 220px;
            overflow-y: auto;
            padding: 8px 10px;
        }

        .org-dropdown-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 10px;
            cursor: pointer;
            transition: all 0.2s;
            border-radius: 10px;
            margin-bottom: 4px;
            position: relative;
        }

        .org-dropdown-item:last-child {
            margin-bottom: 0;
        }

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

        .org-dropdown-item.active {
            background: linear-gradient(135deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0.03));
            border: 1px solid rgba(15, 23, 42, 0.12);
        }

        .org-dropdown-item.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 3px;
            height: 24px;
            background: linear-gradient(180deg, rgba(148, 163, 184, 1), rgba(100, 116, 139, 1));
            border-radius: 0 3px 3px 0;
        }

        .org-dropdown-item .org-logo {
            width: 34px;
            height: 34px;
            font-size: 12px;
        }

        .org-dropdown-item .org-info {
            flex: 1;
            min-width: 0;
        }

        .org-dropdown-item .org-name {
            font-size: 13px;
            line-height: 1.2;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            display: block;
        }

        .org-dropdown-item .org-meta {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-top: 2px;
            min-width: 0;
        }

        .org-role-badge {
            font-size: 9px;
            font-weight: 800;
            padding: 2px 8px;
            border-radius: 20px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            line-height: 1.3;
        }

        .org-role-badge.owner {
            background: linear-gradient(135deg, #fef3c7, #fde68a);
            color: #92400e;
        }

        .org-role-badge.admin {
            background: linear-gradient(135deg, #dbeafe, #bfdbfe);
            color: #1e40af;
        }

        .org-role-badge.member {
            background: var(--bg-tertiary, #f3f4f6);
            color: var(--text-secondary);
        }

        .org-dropdown-item .check-icon {
            color: var(--brand-primary);
            font-size: 14px;
            opacity: 0;
            transition: opacity 0.2s;
        }

        .org-dropdown-item.active .check-icon {
            opacity: 1;
        }

        /* Create Org Button in Dropdown */
        .org-dropdown-footer {
            padding: 10px;
            border-top: 1px solid var(--border);
            background: var(--bg-tertiary, rgba(0, 0, 0, 0.02));
        }

        .create-org-btn {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 10px 12px;
            background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
            color: white;
            border: 1px solid transparent;
            border-radius: 10px;
            font-size: 12px;
            font-weight: 800;
            white-space: nowrap;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 4px 12px rgba(211, 16, 39, 0.30);
        }

        .create-org-btn.create-org-btn--secondary {
            background: transparent;
            border: 1px solid var(--border);
            color: var(--text-main);
            box-shadow: none;
        }
        .create-org-btn.create-org-btn--secondary:hover {
            transform: translateY(-1px);
            background: var(--bg-hover);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
        }

        .create-org-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(211, 16, 39, 0.40);
        }

        .create-org-btn i {
            font-size: 14px;
        }

        /* Organization Dashboard Styles */
        .org-dashboard-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 24px 32px;
            background: var(--bg-panel, var(--bg-secondary));
            border-bottom: 1px solid var(--border);
        }

        .org-dashboard-title {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .org-logo-large {
            width: 56px;
            height: 56px;
            border-radius: 12px;
            background: var(--brand-primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 20px;
            color: white;
        }

        .org-dash-sidebar-initials {
            width: 28px;
            height: 28px;
            border-radius: 8px;
            background: var(--brand-primary);
            color: white;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 700;
            flex-shrink: 0;
        }

        .org-dashboard-title h1 {
            margin: 0;
            font-size: 24px;
            font-weight: 600;
            color: var(--text-main, var(--text-primary));
        }

        .org-plan-badge {
            background: var(--bg-app, var(--bg-tertiary));
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            color: var(--text-secondary);
            display: inline-block;
            margin-top: 4px;
        }

        .org-dashboard-actions {
            display: flex;
            gap: 10px;
        }

        .org-stats-row {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            padding: 24px 32px;
            background: var(--bg-main, var(--bg-primary));
        }

        .org-stat-card {
            background: var(--bg-panel, var(--bg-secondary));
            padding: 20px;
            border-radius: 12px;
            text-align: center;
            border: 1px solid var(--border);
            transition: transform 0.2s, box-shadow 0.2s;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .org-stat-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .org-stat-card .stat-value {
            display: block;
            font-size: 32px;
            font-weight: 700;
            color: var(--brand-primary);
        }

        .org-stat-card .stat-value.overdue {
            color: #ef4444;
        }

        .org-stat-card .stat-value.success {
            color: #22c55e;
        }

        .org-stat-card .stat-label {
            font-size: 13px;
            color: var(--text-secondary);
            margin-top: 4px;
            display: block;
        }

        .org-dashboard-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 24px;
            padding: 24px 32px;
        }

        .dashboard-widget {
            background: var(--surface-2);
            border-radius: 16px;
            border: 1px solid var(--border);
            overflow: hidden;
            box-shadow: var(--shadow-sm);
        }

        .dashboard-widget.warning .widget-header {
            background: rgba(255, 152, 0, 0.1);
            border-bottom-color: rgba(255, 152, 0, 0.3);
        }

        .widget-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 14px;
            border-bottom: 1px solid var(--gridline-strong);
            background: var(--surface-1);
        }

        .widget-header h3 {
            margin: 0;
            font-size: 13px;
            font-weight: 900;
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text-main, var(--text-primary));
        }

        .widget-header h3 i {
            font-size: 14px;
            color: var(--text-muted);
            width: 18px;
            height: 18px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            background: var(--icon-pill);
        }

        .widget-header button {
            background: none;
            border: 1px solid transparent;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 6px 8px;
            border-radius: 10px;
            transition: all 0.2s;
        }

        .widget-header button:hover {
            color: var(--text-main);
            background: var(--surface-3);
            border-color: var(--gridline-strong);
        }

        .badge-count {
            background: #ef4444;
            color: white;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 12px;
            font-weight: 600;
        }

        .widget-content {
            padding: 14px;
            max-height: 320px;
            overflow-y: auto;
        }

        .widget-loading {
            text-align: center;
            color: var(--text-secondary);
            padding: 40px;
        }

        /* Widget Task Items */
        .widget-task-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.2s;
        }

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

        .widget-task-item .task-title {
            flex: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 14px;
        }

        .widget-task-item .task-due {
            font-size: 11px;
            color: var(--text-secondary);
            white-space: nowrap;
        }

        .widget-task-workspace {
            font-size: 11px;
            color: var(--text-secondary);
            background: var(--bg-app, var(--bg-tertiary));
            padding: 2px 8px;
            border-radius: 4px;
            white-space: nowrap;
        }

        .widget-ws-header {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            padding: 8px 0 4px;
            border-bottom: 1px solid var(--border);
            margin-bottom: 4px;
        }

        .task-status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .task-status-dot.status-todo {
            background: #94a3b8;
        }

        .task-status-dot.status-progress {
            background: #3b82f6;
        }

        /* Health Progress Bars */
        .workspace-health-item {
            margin-bottom: 16px;
        }

        .workspace-health-item .ws-name {
            display: flex;
            justify-content: space-between;
            margin-bottom: 6px;
            font-size: 13px;
        }

        .health-bar {
            height: 8px;
            background: var(--bg-app, var(--bg-tertiary));
            border-radius: 4px;
            overflow: hidden;
        }

        .health-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, #22c55e, #4ade80);
            border-radius: 4px;
            transition: width 0.5s ease;
        }

        /* Workload Bars */
        .workload-item {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 12px;
        }

        .workload-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--brand-primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: 600;
            color: white;
            flex-shrink: 0;
        }

        .workload-name {
            width: 100px;
            font-size: 13px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .workload-bar-container {
            flex: 1;
        }

        .workload-bar {
            height: 24px;
            background: var(--bg-app, var(--bg-tertiary));
            border-radius: 4px;
            overflow: hidden;
            position: relative;
        }

        .workload-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-dark));
            display: flex;
            align-items: center;
            justify-content: flex-end;
            padding-right: 8px;
            font-size: 11px;
            font-weight: 600;
            color: white;
            min-width: 30px;
            transition: width 0.5s ease;
        }

        .widget-empty {
            text-align: center;
            color: var(--text-secondary);
            padding: 30px 20px;
            font-size: 14px;
        }

        .widget-empty i {
            font-size: 32px;
            display: block;
            margin-bottom: 10px;
            opacity: 0.5;
        }

        @media (max-width: 1024px) {
            .org-dashboard-grid {
                grid-template-columns: 1fr;
            }

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

        @media (max-width: 600px) {
            .org-stats-row {
                grid-template-columns: 1fr;
            }

            .org-dashboard-header {
                flex-direction: column;
                gap: 16px;
                text-align: center;
            }

            .org-dashboard-title {
                flex-direction: column;
            }
        }

        .sidebar-section-label {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            padding: 0 16px;
            margin-top: 24px;
            margin-bottom: 8px;
        }

        .sidebar-item {
            height: 44px;
            width: 100%;
            display: flex;
            align-items: center;
            padding: 0 16px;
            font-size: 14px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: var(--transition);
            border-radius: 8px;
            background: transparent;
            border: none;
            text-align: left;
            gap: 12px;
            position: relative;
        }

        /* ClickUp-dense sidebar rhythm */
        .sidebar-section-label {
            font-size: var(--ft-text-xs);
            font-weight: var(--ft-weight-black);
            letter-spacing: var(--ft-tracking-wide);
            padding: 0 14px;
            margin-top: 18px;
            margin-bottom: 8px;
        }

        .sidebar-item {
            height: 42px;
            padding: 0 12px;
            border-radius: 12px;
            font-size: var(--ft-text-md);
            font-weight: var(--ft-weight-semibold);
            color: var(--text-secondary);
            border: 1px solid transparent;
        }

        .sidebar-item:hover {
            background: var(--surface-3);
            color: var(--text-main);
            border-color: var(--gridline-strong);
        }

        .sidebar-item.active {
            background: color-mix(in srgb, var(--brand-primary-light) 55%, transparent);
            color: var(--text-main);
            font-weight: 700;
            border-color: color-mix(in srgb, var(--brand-primary) 30%, transparent);
        }

        .sidebar-item.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 6px;
            bottom: 6px;
            width: 3px;
            background: var(--brand-primary);
            border-radius: 0 4px 4px 0;
        }

        .sidebar-item i {
            width: 28px;
            height: 28px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            background: var(--icon-pill);
            text-align: center;
            font-size: 16px;
            color: var(--text-muted);
            transition: var(--transition);
        }

        /* Normalize icons across the app (mixed icon families) */
        i.fas, i.far, i.fal, i.fab,
        i.ri, [class^="ri-"], [class*=" ri-"] {
            line-height: 1;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        /* Icon sizing rules (ClickUp-like consistency).
           Sidebar icons are sized in ui-base.css (16px outline), so they're not pinned here. */
        .view-btn i,
        .filter-btn i,
        .ft-btn i,
        .widget-header h3 i,
        .notif-icon i {
            font-size: 14px !important;
        }

        .sidebar-item i,
        .widget-header h3 i,
        .notif-icon {
            background: var(--icon-pill);
        }

        /* Make small icons feel consistent in buttons/filters */
        .ft-btn i,
        .filter-btn i,
        .view-btn i {
            flex: 0 0 auto;
        }

        .sidebar-item:hover i {
            color: var(--text-secondary);
        }

        .sidebar-item.active i {
            color: var(--brand-primary);
            background: color-mix(in srgb, var(--brand-primary) 14%, transparent);
        }

        /* Space Header (Collapsible) */
        .space-header {
            height: 44px;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 16px;
            font-size: 14px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: var(--transition);
            border-radius: 8px;
        }

        .space-header:hover {
            background: var(--surface-3);
            color: var(--text-main);
        }

        /* Folder Item (Sub-item) */
        .folder-item {
            height: 40px;
            /* Slightly smaller for sub-items */
            width: 100%;
            display: flex;
            align-items: center;
            padding: 0 16px 0 32px;
            /* Indented */
            font-size: 13px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: var(--transition);
            border-radius: 8px;
            gap: 10px;
            position: relative;
        }

        .folder-item:hover {
            background: var(--surface-3);
            color: var(--text-main);
        }

        .folder-item.active {
            background: var(--brand-primary-light);
            color: var(--brand-primary-dark);
            font-weight: 600;
        }

        /* Ensure hovered active folders don't keep the pink/red hover tint */
        .folder-item.active:hover {
            background: var(--surface-3);
        }

        .folder-item.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 6px;
            bottom: 6px;
            width: 3px;
            background: var(--brand-primary);
            border-radius: 0 4px 4px 0;
        }

        /* Legacy support for sidebar-btn */
        .sidebar-btn {
            height: 44px;
            width: 100%;
            display: flex;
            align-items: center;
            padding: 0 16px;
            font-size: 14px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: var(--transition);
            border-radius: 8px;
            background: transparent;
            border: none;
            text-align: left;
            gap: 12px;
            margin: 0;
            /* Reset margin */
            box-shadow: none;
        }

        .sidebar-btn:hover {
            background: var(--surface-3);
            color: var(--text-main);
            transform: none;
            box-shadow: none;
            border-color: transparent;
        }

        /* MAIN */
        /* MAIN CONTENT - Adjusted for Floating Sidebar */
        main {
            /* Sidebar already has left offset = --sidebar-gap,
               so start content at sidebar right edge (width + gap). */
            margin-left: calc(var(--sidebar-width) + 8px + var(--content-inset));
            margin-right: calc(var(--sidebar-gap) + var(--content-inset));
            padding-top: 66px;
            height: 100%;
            display: flex;
            flex-direction: column;
            position: relative;
            background: var(--surface-1);
            width: auto;
            overflow: hidden;
            transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* ClickUp-like subtle gridlines in main content area */
        main::before {
            content: '';
            position: absolute;
            inset: 0;
            pointer-events: none;
            /* Removed: gridline overlay */
            opacity: 0 !important;
            background-image: none !important;
            background-size: auto !important;
            background-position: initial !important;
            mask-image: none !important;
        }

        /* Responsive Layout for Laptops & Smaller Screens */
        @media (max-width: 1366px) {
            :root {
                --sidebar-width: 240px;
                --sidebar-gap: 12px;
            }

            .dashboard-quick-actions-widget {
                grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            }

            .metrics-row {
                grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            }
        }

        @media (max-width: 1024px) {
            :root {
                --sidebar-width: 80px;
                /* Force narrow sidebar on tablets if needed, or just let JS handle it */
            }

            main {
                margin-left: calc(80px + 8px + var(--content-inset));
                margin-right: calc(var(--sidebar-gap) + var(--content-inset));
                /* Assume narrow sidebar or auto-collapse */
            }

            .top-bar {
                left: calc(80px + 8px + var(--content-inset));
                right: calc(var(--sidebar-gap) + var(--content-inset));
            }

            /* If sidebar is not explicitly collapsed by JS, these overrides help ensure content fits */
            aside:not(.narrow) {
                width: 80px;
            }


        }

        /* GLASS TOP BAR (LIQUID) */
        .top-bar {
            position: fixed;
            top: var(--sidebar-gap);
            left: calc(var(--sidebar-width) + 8px + var(--content-inset));
            right: calc(var(--sidebar-gap) + var(--content-inset));
            height: 50px;
            /* Aggressively reduced height */
            /* Reduced height */
            background: color-mix(in srgb, var(--surface-2) 82%, transparent);
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            border: 1px solid rgba(255, 255, 255, 0.5);
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 24px;
            z-index: 2000;
            box-shadow: var(--shadow-lg);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .top-bar:hover {
            background: var(--surface-2);
            box-shadow: var(--shadow-xl);
            transform: translateY(2px);
        }

        .view-btn {
            padding: 8px 12px;
            /* Compact padding */
            border: none;
            background: transparent;
            color: var(--text-muted);
            font-weight: 600;
            font-size: 12px;
            /* Smaller font */
            border-radius: 16px;
            cursor: pointer;
            transition: var(--transition-bounce);
            display: flex;
            align-items: center;
            gap: 8px;
            position: relative;
            overflow: hidden;
            white-space: nowrap;
        }

        /* View tabs: align with component system */
        .view-btn {
            height: 34px;
            padding: 0 12px;
            border-radius: 999px;
            border: 1px solid transparent;
            font-weight: 900;
            letter-spacing: -0.01em;
        }

        .view-btn i {
            width: 18px;
            height: 18px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            background: var(--icon-pill);
            font-size: 12px;
            color: var(--text-muted);
        }

        .view-btn.active {
            background: var(--brand-primary);
            color: white;
            box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
            border-color: color-mix(in srgb, var(--brand-primary) 70%, transparent);
        }

        .view-btn.active i {
            background: color-mix(in srgb, rgba(255, 255, 255, 0.16) 70%, transparent);
            color: white;
        }

        .view-btn:not(.active):hover {
            background: var(--surface-3);
            border-color: var(--ft-line);
            color: var(--text-main);
            transform: translateY(-2px);
        }

        /* ClickUp-style view tabs: draggable, add/remove on demand */
        .view-tabs-wrap {
            display: flex;
            align-items: center;
            gap: 4px;
            flex-wrap: nowrap;
            overflow-x: auto;
            overflow-y: hidden;
            scrollbar-width: thin;
        }
        .view-tab-item {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            cursor: grab;
            user-select: none;
        }
        .view-tab-item:active { cursor: grabbing; }
        .view-tab-item .view-tab-remove {
            opacity: 0;
            width: 16px;
            height: 16px;
            border: none;
            background: var(--surface-3);
            color: var(--text-muted);
            border-radius: 50%;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            padding: 0;
            transition: opacity 0.15s;
        }
        .view-tab-item:hover .view-tab-remove { opacity: 1; }
        .view-tab-remove:hover { background: var(--brand-primary); color: white; }
        .add-view-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            border: 1px dashed var(--border);
            background: transparent;
            color: var(--text-muted);
            font-size: 12px;
            font-weight: 600;
            border-radius: 999px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .add-view-btn:hover {
            border-color: var(--brand-primary);
            color: var(--brand-primary);
        }
        .view-picker-dropdown {
            position: fixed;
            z-index: 10000;
            width: 420px;
            max-height: 520px;
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 14px;
            box-shadow: var(--shadow-xl);
            display: none;
            flex-direction: column;
            overflow: hidden;
        }
        .view-picker-dropdown.show { display: flex; }
        .view-picker-search {
            padding: 12px;
            border-bottom: 1px solid var(--border);
        }
        .view-picker-search input {
            width: 100%;
            padding: 8px 12px 8px 32px;
            border: 1px solid var(--border);
            border-radius: 8px;
            font-size: 13px;
            background: var(--bg-app);
        }
        .view-picker-search { position: relative; }
        .view-picker-search .fa-search { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-muted); }
        .view-picker-body { overflow-y: auto; padding: 10px; }
        .view-picker-section-title {
            font-size: 10px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.07em;
            color: var(--text-muted);
            padding: 10px 4px 6px;
            border-top: 1px dashed var(--border-light);
            margin-top: 4px;
        }
        .view-picker-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
        .view-picker-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.15s;
            text-align: left;
            border: 1px solid var(--border-light);
            background: var(--bg-app);
            width: 100%;
            color: var(--text-main);
        }
        .view-picker-item:hover {
            background: var(--surface-3);
            border-color: var(--border);
            transform: translateY(-1px);
        }
        .view-picker-item.added {
            border-color: var(--border);
            background: var(--surface-3);
        }
        .view-picker-item .view-picker-icon {
            width: 34px;
            height: 34px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            color: white;
            flex-shrink: 0;
        }
        .view-picker-item .view-picker-text { flex: 1; min-width: 0; }
        .view-picker-item .view-picker-title { font-weight: 700; font-size: 13px; display: block; }
        .view-picker-item .view-picker-desc { font-size: 11px; color: var(--text-muted); display: block; margin-top: 2px; }
        .view-added-pill {
            display: inline-flex;
            align-items: center;
            margin-left: 6px;
            padding: 1px 7px;
            border-radius: 999px;
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 0.01em;
            color: var(--brand-primary-dark);
            background: color-mix(in srgb, var(--brand-primary) 12%, white);
            border: 1px solid color-mix(in srgb, var(--brand-primary) 28%, var(--border));
            vertical-align: middle;
        }
        .view-picker-meta {
            display:inline-flex;
            align-items:center;
            gap:6px;
            font-size:10px;
            font-weight:700;
            color:var(--text-muted);
            border:1px solid var(--border);
            border-radius:999px;
            padding:2px 7px;
            background: var(--bg-panel);
            flex-shrink: 0;
        }
        .view-tab-item.dragging { opacity: 0.5; }

        /* GLOBAL MICRO-INTERACTIONS */
        .btn-primary {
            background: var(--brand-primary);
            color: white;
            border: none;
            padding: 8px 16px;
            /* Compact padding */
            border-radius: 10px;
            font-weight: 600;
            font-size: 12px;
            /* Smaller font */
            cursor: pointer;
            transition: var(--transition-bounce);
            box-shadow: var(--shadow-md);
            position: relative;
            overflow: hidden;
            white-space: nowrap;
        }

        .btn-primary:hover {
            background: var(--brand-primary-dark);
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

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

        /* Shimmer Effect */
        .btn-primary::after {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: 0.5s;
        }

        .content {
            /* Keep inner content aligned with top bar inset */
            padding: 0 var(--content-inset) var(--s-7) var(--content-inset);
            overflow: hidden;
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 0;
        }

        /* Give views maximum height */
        .content-area {
            flex: 1;
            min-height: 0;
        }

        .content-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 0;
        }

        .content h2 {
            margin: 10px 0 4px 0;
            font-size: 20px;
            font-weight: 700;
        }

        /* SESSION TIMER */
        .session-timer {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: var(--text-muted);
            background: var(--bg-app);
            padding: 4px 8px;
            border-radius: 6px;
            border: 1px solid var(--border);
            margin: 5px 15px;
        }

        .timer-warning {
            color: var(--brand-red);
            font-weight: 600;
        }


        /* Sound indicator in user menu area */
        .user-menu-sound {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            margin: 5px 15px;
            background: var(--bg-app);
            border-radius: 6px;
            font-size: 12px;
            color: var(--text-muted);
            border: 1px solid var(--border);
        }

        .user-menu-sound i {
            color: var(--brand-red);
        }

        /* CLEAN LIST VIEW */
        #view-list {
            flex: 1;
            /* Stretch container to bottom */
            display: flex;
            flex-direction: column;
            background: var(--surface-2);
            border-radius: 16px;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border);
            overflow: auto;
            min-height: 0;
            /* Contains inner elements like sticky header */
            padding: 0;
        }

        .list-table {
            width: max-content;
            min-width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            background: transparent;
            border-radius: 0;
            box-shadow: none;
            border: none;
            table-layout: fixed;
        }

        .list-table th {
            position: sticky;
            top: 0;
            z-index: 20;
            background: var(--surface-2);
            /* Opaque background to hide scrolling rows underneath */
            padding: 10px 16px;
            text-align: left;
            font-size: 12px;
            color: var(--text-muted);
            font-weight: 600;
            border-bottom: 1px solid var(--gridline-strong);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            white-space: nowrap;
            overflow: visible;
            text-overflow: clip;
        }

        .list-table thead th {
            z-index: 60;
            box-shadow: 0 1px 0 0 var(--gridline-strong);
        }

        .list-table td {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            min-width: 0;
        }

        .list-table td > *,
        .list-table th > * {
            max-width: 100%;
        }

        .list-table td select,
        .list-table td input,
        .list-table td button {
            max-width: 100%;
        }

        .tasks-table th {
            position: sticky;
            top: 0;
            z-index: 20;
            background: var(--bg-panel);
            border-bottom: 2px solid var(--border) !important;
        }

        .list-table td {
            padding: 10px 16px;
            border-bottom: 1px solid var(--border-light);
            font-size: 13px;
            color: var(--text-main);
        }

        .list-table tr:last-child td {
            border-bottom: none;
        }

        .list-table tr {
            transition: var(--transition);
        }

        .list-table tr:hover {
            background: var(--surface-3);
            cursor: pointer;
        }

        .list-assignee-btn {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 8px;
            border-radius: 12px;
            border: 1px solid transparent;
            background: transparent;
            cursor: pointer;
            text-align: left;
            transition: var(--transition);
        }

        .list-assignee-btn:hover {
            background: var(--surface-3);
            border-color: var(--gridline-strong);
        }

        .list-assignee-popover {
            position: fixed;
            z-index: 9999;
            width: 320px;
            border-radius: 14px;
            border: 1px solid var(--border);
            background: var(--surface-2);
            box-shadow: var(--shadow-xl);
            overflow: hidden;
        }

        .list-assignee-popover .hdr {
            padding: 10px;
            border-bottom: 1px solid var(--gridline-strong);
            position: sticky;
            top: 0;
            background: var(--surface-2);
            z-index: 2;
        }

        .list-assignee-popover input {
            width: 100%;
            padding: 10px 12px;
            border-radius: 12px;
            border: 1px solid var(--border);
            background: var(--surface-2);
            color: var(--text-main);
            font-size: 12px;
        }

        .list-assignee-popover .opt {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            cursor: pointer;
            border-bottom: 1px solid var(--gridline);
            user-select: none;
        }

        .list-assignee-popover .opt:hover {
            background: var(--surface-3);
        }

        .list-assignee-popover .opt.selected {
            background: rgba(211, 16, 39, 0.08);
        }

        .list-assignee-popover .opt input[type="checkbox"] {
            position: absolute;
            opacity: 0;
            pointer-events: none;
            width: 0;
            height: 0;
        }

        .list-assignee-popover .name {
            flex: 1;
            min-width: 0;
            font-size: 12px;
            font-weight: 800;
            color: var(--text-main);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .list-assignee-popover .check {
            width: 20px;
            height: 20px;
            border-radius: 6px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--gridline-strong);
            color: transparent;
            background: transparent;
            flex-shrink: 0;
        }

        .list-assignee-popover .opt.selected .check {
            border-color: rgba(211, 16, 39, 0.35);
            background: rgba(211, 16, 39, 0.12);
            color: var(--brand-primary);
        }

        .list-assignee-popover .avatar {
            width: 26px;
            height: 26px;
            border-radius: 999px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(99, 102, 241, 0.18);
            font-weight: 900;
            font-size: 11px;
            color: var(--text-main);
        }

        /* ============================================
           FILTER DROPDOWNS (Premium popovers)
           ============================================ */
        .ft-filter-btn {
            height: 36px;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 0 12px;
            border-radius: 12px;
            border: 1px solid var(--border);
            background: var(--surface-2);
            color: var(--text-main);
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            transition: var(--transition);
            white-space: nowrap;
        }
        .ft-filter-btn:hover {
            background: var(--surface-3);
            border-color: var(--gridline-strong);
        }
        .ft-filter-btn .val {
            max-width: 150px;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .ft-filter-popover {
            position: fixed;
            z-index: 9999;
            width: 280px;
            border-radius: 14px;
            border: 1px solid var(--border);
            background: var(--surface-2);
            box-shadow: var(--shadow-xl);
            overflow: hidden;
        }
        .ft-filter-popover .hdr {
            padding: 10px;
            border-bottom: 1px solid var(--gridline-strong);
            position: sticky;
            top: 0;
            background: var(--surface-2);
            z-index: 2;
        }
        .ft-filter-popover input {
            width: 100%;
            padding: 10px 12px;
            border-radius: 12px;
            border: 1px solid var(--border);
            background: var(--surface-2);
            color: var(--text-main);
            font-size: 12px;
        }
        .ft-filter-opt {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            cursor: pointer;
            border-bottom: 1px solid var(--gridline);
            user-select: none;
        }
        .ft-filter-opt:hover {
            background: var(--surface-3);
        }
        .ft-filter-opt.selected {
            background: var(--surface-3);
        }
        .ft-filter-opt .name {
            flex: 1;
            min-width: 0;
            font-size: 12px;
            font-weight: 800;
            color: var(--text-main);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .ft-filter-opt .check {
            width: 20px;
            height: 20px;
            border-radius: 6px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--gridline-strong);
            color: transparent;
            background: transparent;
            flex-shrink: 0;
        }
        .ft-filter-opt.selected .check {
            border-color: var(--border);
            background: #E5E7EB;
            color: var(--text-secondary);
        }

        /* ============================================
           GENERIC MENU POPOVER (used by Table/Modal dropdowns)
           ============================================ */
        .ft-menu-popover {
            position: fixed;
            z-index: 10000;
            width: 260px;
            border-radius: 14px;
            border: 1px solid var(--border);
            background: var(--surface-2);
            box-shadow: var(--shadow-xl);
            overflow: hidden;
        }
        .ft-menu-popover .hdr {
            padding: 10px;
            border-bottom: 1px solid var(--gridline-strong);
            position: sticky;
            top: 0;
            background: var(--surface-2);
            z-index: 2;
        }
        .ft-menu-popover input {
            width: 100%;
            padding: 10px 12px;
            border-radius: 12px;
            border: 1px solid var(--border);
            background: var(--surface-2);
            color: var(--text-main);
            font-size: 12px;
        }
        .ft-menu-opt {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            cursor: pointer;
            border-bottom: 1px solid var(--gridline);
            user-select: none;
        }
        .ft-menu-opt:hover { background: var(--surface-3); }
        .ft-menu-opt.selected { background: var(--surface-3); }
        .ft-menu-opt .swatch {
            width: 10px;
            height: 10px;
            border-radius: 3px;
            background: var(--gridline-strong);
            flex-shrink: 0;
        }
        .ft-menu-opt .name {
            flex: 1;
            min-width: 0;
            font-size: 12px;
            font-weight: 800;
            color: var(--text-main);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .ft-menu-opt .ft-menu-name {
            flex: 1;
            min-width: 0;
            font-size: 12px;
            font-weight: 800;
            color: var(--text-main);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .ft-menu-opt .avatar {
            width: 26px;
            height: 26px;
            border-radius: 999px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(99, 102, 241, 0.18);
            border: 1px solid rgba(99, 102, 241, 0.25);
            font-weight: 900;
            font-size: 11px;
            color: var(--text-main);
            flex-shrink: 0;
        }
        .ft-menu-opt .check {
            width: 20px;
            height: 20px;
            border-radius: 6px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--gridline-strong);
            color: transparent;
            background: transparent;
            flex-shrink: 0;
        }
        .ft-menu-opt.selected .check {
            border-color: var(--border);
            background: #E5E7EB;
            color: var(--text-secondary);
        }

        .ft-pill-btn {
            width: 100%;
            display: inline-flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 6px 10px;
            border-radius: 10px;
            border: 1px solid transparent;
            cursor: pointer;
            font-size: 13px;
            font-weight: 700;
            color: #fff;
        }
        .ft-pill-btn .chev {
            opacity: 0.85;
            font-size: 10px;
        }

        /* Modal assignee dropdown options (match premium style) */
        #assignee-options .ft-menu-opt { border-bottom: 1px solid var(--border); }
        /* Force full names to show in modal dropdown */
        #assignee-options .ft-menu-name {
            display: block !important;
            flex: 1 !important;
            min-width: 0 !important;
            color: var(--text-main) !important;
            opacity: 1 !important;
            visibility: visible !important;
        }
        /* Hide the native checkbox (use right-side check indicator instead) */
        #assignee-options .ft-menu-opt input[type="checkbox"] {
            position: absolute !important;
            opacity: 0 !important;
            pointer-events: none !important;
            width: 0 !important;
            height: 0 !important;
        }

        /* Flatpickr theme (match Flowtive red) */
        .flatpickr-calendar {
            border: 1px solid var(--border);
            box-shadow: var(--shadow-xl);
            border-radius: 14px;
            overflow: hidden;
            font-family: var(--ft-font);
            background: var(--surface-2);
        }
        .flatpickr-months, .flatpickr-weekdays {
            background: var(--surface-2);
        }
        .flatpickr-current-month {
            font-weight: 800;
        }
        .flatpickr-day.selected,
        .flatpickr-day.startRange,
        .flatpickr-day.endRange {
            background: var(--brand-primary);
            border-color: var(--brand-primary);
        }
        .flatpickr-day.today {
            border-color: rgba(211, 16, 39, 0.45);
        }
        .flatpickr-day:hover {
            background: rgba(211, 16, 39, 0.08);
        }

        /* BOARD VIEW */
        .board-container {
            display: flex;
            gap: 16px;
            height: 100%;
            width: 100%;
            max-width: 100%;
            overflow-x: auto;
            overflow-y: hidden;
            padding: 10px;
            padding-bottom: 20px;
        }

        .board-col {
            min-width: 320px;
            background: var(--surface-2);
            padding: 0;
            border-radius: 16px;
            border: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            box-shadow: none;
            overflow-y: auto;
            height: 100%;
        }

        .board-add-col {
            min-width: 220px;
            height: fit-content;
            align-self: flex-start;
            border: 1px dashed var(--border);
            background: color-mix(in srgb, var(--surface-2) 70%, transparent);
            border-radius: 16px;
            padding: 14px;
            cursor: pointer;
            color: var(--text-muted);
            transition: var(--transition);
            display:flex;
            align-items:center;
            gap:10px;
            margin-top: 10px;
        }
        .board-add-col:hover {
            border-color: var(--brand-primary);
            color: var(--brand-primary);
            background: rgba(211, 16, 39, 0.06);
        }

        .board-head-title {
            display:flex;
            align-items:center;
            gap:10px;
            min-width: 0;
        }
        .board-head-name {
            font-weight: 900;
            letter-spacing: 0.05em;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .board-head-name[contenteditable="true"] {
            text-transform: none;
            letter-spacing: 0.01em;
            background: rgba(0,0,0,0.03);
            border-radius: 8px;
            padding: 4px 8px;
            outline: 2px solid rgba(211,16,39,0.20);
        }

        .ft-status-dot {
            width: 12px;
            height: 12px;
            border-radius: 999px;
            border: 2px solid rgba(255,255,255,0.9);
            box-shadow: 0 2px 8px rgba(0,0,0,0.10);
            flex-shrink: 0;
            cursor: pointer;
        }

        .ft-color-popover {
            position: fixed;
            width: 260px;
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 14px;
            box-shadow: 0 18px 50px rgba(0,0,0,0.18);
            z-index: 10000;
            padding: 12px;
            display: none;
        }
        .ft-color-popover .hdr {
            display:flex;
            align-items:center;
            justify-content:space-between;
            font-size: 12px;
            font-weight: 800;
            color: var(--text-main);
            margin-bottom: 10px;
        }
        .ft-color-swatches {
            display:flex;
            flex-wrap: wrap;
            gap: 10px;
        }
        .ft-color-swatch {
            width: 18px;
            height: 18px;
            border-radius: 999px;
            border: 2px solid rgba(255,255,255,0.9);
            cursor: pointer;
            position: relative;
            box-shadow: 0 2px 10px rgba(0,0,0,0.12);
        }
        .ft-color-swatch.is-selected::after {
            content: '';
            position: absolute;
            inset: -5px;
            border-radius: 999px;
            border: 2px solid color-mix(in srgb, var(--brand-primary) 55%, transparent);
        }
        .ft-color-plus {
            width: 18px;
            height: 18px;
            border-radius: 999px;
            border: 2px dashed rgba(0,0,0,0.25);
            display:flex;
            align-items:center;
            justify-content:center;
            color: var(--text-muted);
            cursor: pointer;
            box-shadow: none;
            background: transparent;
        }

        .board-head {
            font-weight: 700;
            color: var(--text-secondary);
            font-size: 12px;
            margin-bottom: 0;
            text-transform: uppercase;
            display: flex;
            justify-content: space-between;
            padding: 12px 12px 10px 12px;
            letter-spacing: 0.05em;
            position: sticky;
            top: 0;
            z-index: 60;
            background: var(--surface-2);
            border-bottom: 1px solid var(--gridline-strong);
        }

        .board-card {
            position: relative;
            z-index: 1;
        }

        /* Ensure filter bar always stays above scrollers */
        .filter-bar {
            z-index: 200;
        }

        .board-tasks {
            min-height: 100px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            padding: 12px;
            padding-bottom: 20px;
        }

        .board-card {
            background: var(--surface-2);
            padding: 14px;
            border-radius: 14px;
            border: 1px solid var(--border);
            cursor: pointer;
            box-shadow: var(--shadow-sm);
            border-left: 4px solid transparent;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .board-card:hover {
            transform: translateY(-3px);
            border-color: var(--border);
            box-shadow: var(--shadow-md);
        }

        /* Enhanced Board Card - Title clickable, inline editing */
        .board-card-title {
            transition: color 0.15s ease;
        }

        .board-card-title:hover {
            color: var(--brand-primary);
        }

        .board-card-meta {
            margin-top: 4px;
        }

        .board-assignee-select,
        .board-due-date-wrapper input[type="date"] {
            outline: none;
            transition: all 0.15s ease;
        }

        .board-assignee-select:hover,
        .board-due-date-wrapper input[type="date"]:hover {
            color: var(--text-main);
        }

        .board-assignee-select:focus,
        .board-due-date-wrapper input[type="date"]:focus {
            color: var(--text-main);
            box-shadow: 0 0 0 2px var(--brand-primary-light);
            border-radius: 4px;
        }

        /* Prevent cursor change on inline edit areas */
        .board-assignee-wrapper,
        .board-due-date-wrapper {
            cursor: default;
        }


        /* DASHBOARD VIEW */
        #view-dashboard {
            display: flex;
            flex-direction: column;
            gap: 24px;
            flex: 1;
            overflow-y: auto;
            padding-bottom: 24px;
        }

        /* CLEAN DASHBOARD GRID */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 24px;
            margin-bottom: 32px;
        }

        .stat-card {
            background: var(--surface-2);
            padding: 24px;
            border-radius: 16px;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            cursor: pointer;
            transition: var(--transition);
            position: relative;
            overflow: hidden;
        }

        .stat-card:hover {
            box-shadow: var(--shadow-md);
            border-color: var(--border-focus);
            transform: translateY(-2px);
        }

        /* Remove heavy effects */
        .stat-card::before,
        .stat-card::after,
        .stat-card:hover::after {
            display: none;
        }

        .stat-value {
            font-size: 32px;
            font-weight: 700;
            color: var(--text-main);
            line-height: 1.2;
            margin-bottom: 4px;
            letter-spacing: -0.02em;
            background: none;
            -webkit-text-fill-color: var(--text-main);
        }

        .stat-label {
            font-size: 13px;
            color: var(--text-muted);
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            display: flex;
            align-items: center;
            gap: 8px;
            position: relative;
            z-index: 1;
        }

        /* Simulated Sparkline */
        .sparkline {
            height: 4px;
            width: 60px;
            background: var(--border);
            border-radius: 2px;
            margin-top: auto;
            position: relative;
            overflow: hidden;
        }

        .sparkline::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            height: 100%;
            width: 70%;
            background: var(--success);
            border-radius: 2px;
        }

        /* Bento Spans */
        @media (min-width: 1200px) {
            .stat-card:first-child {
                grid-column: span 2;
                background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
                border: none;
            }

            .stat-card:first-child .stat-value {
                background: none;
                -webkit-text-fill-color: white;
                color: white;
            }

            .stat-card:first-child .stat-label {
                color: rgba(255, 255, 255, 0.8);
            }

            .stat-card:first-child::after {
                background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
            }
        }

        /* Helper to render mini progress bar */


        .hidden {
            display: none !important;
        }

        .admin-only {
            display: none;
        }

        .status-pill {
            padding: 4px 10px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            display: inline-block;
            letter-spacing: 0.02em;
        }

        .st-done {
            background: #DCFCE7;
            color: #15803D;
        }

        .st-todo {
            background: var(--border-light);
            color: var(--text-secondary);
        }

        .st-inprogress {
            background: #FEE2E2;
            color: #B91C1C;
        }

        /* CLEAN FILTERS */
        .filter-bar {
            display: flex;
            gap: 12px;
            margin-bottom: 6px;
            align-items: center;
            padding: 4px 0;
            position: sticky;
            top: 0;
            z-index: 30;
            background: color-mix(in srgb, var(--surface-2) 92%, transparent);
            border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
            border-radius: 16px;
            padding: 8px 12px;
            box-shadow: var(--shadow-sm);
            backdrop-filter: blur(16px) saturate(170%);
            -webkit-backdrop-filter: blur(16px) saturate(170%);
        }

        .search-box {
            display: flex;
            align-items: center;
            /* gap: removed to rely on padding-left */
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 0 10px;
            width: 260px;
            max-width: 360px;
            height: 38px;
            min-width: 180px;
            /* Allow shrinking below content */
            box-sizing: border-box;
            /* Include padding in width */
            box-shadow: none;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            flex: 0 1 auto;
        }

        .search-box:hover {
            border-color: color-mix(in srgb, var(--border) 45%, var(--text-muted));
            background: color-mix(in srgb, var(--surface-2) 92%, var(--surface-3));
        }

        .search-box:focus-within {
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
        }

        /* Essential Input Reset to fix Reference Image Issue */
        .search-box input {
            border: none !important;
            background: transparent !important;
            width: 100% !important;
            min-width: 0 !important;
            /* Crucial for flex containers */
            outline: none !important;
            box-shadow: none !important;
            font-size: 13px;
            padding: 0 0 0 8px !important;
            /* Slightly reduced left padding */
            margin: 0 !important;
            height: 100% !important;
            color: var(--text-main);
            text-overflow: ellipsis;
        }

        .search-box .search-icon {
            color: #94a3b8;
            margin: 0 !important;
            font-size: 13px;
            transition: color 0.2s;
            flex-shrink: 0;
            display: block !important;
            /* Force display */
        }

        .search-box:focus-within .search-icon {
            color: var(--brand-primary);
        }

        /* Responsive Top Bar Adjustments */
        @media (max-width: 1450px) {


            .view-btn {
                padding: 6px 10px;
                font-size: 11px;
            }

            .btn-primary {
                padding: 6px 12px;
                font-size: 11px;
            }

            .top-bar {
                padding: 0 16px;
            }

            .user-name-container {
                max-width: 100px;
                overflow: hidden;
                text-overflow: ellipsis;
            }
        }

        .search-box input {
            border: none;
            background: transparent;
            width: 100%;
            outline: none;
            font-size: 13px;
        }

        .user-name-container {
            display: flex;
            flex-direction: column;
            justify-content: center;
            white-space: nowrap !important;
            /* Force single line */
        }

        /* LISTS OVERVIEW TABLE */
        .lists-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }

        .lists-table th {
            padding: 12px 8px;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            font-size: 11px;
            border-bottom: 2px solid var(--border);
            text-align: left;
        }

        .lists-table tr {
            border-bottom: 1px solid var(--border);
            cursor: pointer;
            transition: background 0.2s;
        }

        .lists-table tr:hover {
            background: var(--bg-app);
        }

        .lists-table td {
            padding: 12px 8px;
            color: var(--text-muted);
        }

        .lists-table .list-name {
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 500;
            color: var(--text-main);
        }

        .lists-table .progress-bar-bg {
            flex: 1;
            background: var(--border-light);
            height: 6px;
            border-radius: 3px;
            overflow: hidden;
        }

        .lists-table .progress-bar-fill {
            height: 100%;
            transition: width 0.3s;
        }

        .filter-pill {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 13px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .filter-pill:hover {
            border-color: var(--brand-primary);
            color: var(--brand-primary);
        }

        .filter-pill.active {
            border-color: var(--brand-primary);
            color: var(--brand-primary);
            background: var(--brand-primary-light);
        }

        .clear-filters {
            font-size: 13px;
            color: var(--brand-primary);
            cursor: pointer;
            text-decoration: none;
            font-weight: 500;
        }

        .clear-filters:hover {
            text-decoration: underline;
        }

        .tag-pill {
            background: var(--bg-app);
            color: var(--text-secondary);
            border: 1px solid var(--border);
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 10px;
            margin-right: 5px;
        }

        /* MODALS */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.4);
            display: none;
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        /* Ensure every modal opens at the same centered anchor */
        .modal-overlay.active {
            justify-content: center;
            align-items: center;
        }

        /* IMPORTANT:
           Some legacy styles define `.modal` as a full-screen overlay (top-left).
           Our dialogs use `.modal-overlay > .modal` as the centered card container.
           This rule ensures every modal card opens centered (like New Workspace). */
        .modal-overlay > .modal {
            position: relative !important;
            top: auto !important;
            left: auto !important;
            width: 750px;
            max-width: 95%;
            max-height: 90%;
            border-radius: 24px;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            justify-content: flex-start;
            box-shadow: var(--shadow-xl);
            overflow: hidden;
            background: var(--bg-panel);
        }

        /* Some legacy modals use `.modal` full-screen wrapper — keep it centered too */
        .modal {
            align-items: center;
            justify-content: center;
        }

        /* Client Portal modal uses `.modal` (not `.modal-overlay`) */
        #project-settings-modal {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .modal {
            background: var(--bg-panel);
            width: 750px;
            max-width: 95%;
            max-height: 90%;
            border-radius: 24px;
            display: flex;
            flex-direction: column;
            box-shadow: var(--shadow-xl);
            overflow: hidden;
            transform: scale(0.9) translateY(20px);
            opacity: 0;
            transition: var(--transition-bounce);
        }

        .modal-large {
            width: 1000px;
            max-width: 95%;
            max-height: 85%;
        }

        /* FORCE WHITE BACKGROUND FOR MODALS AS REQUESTED */
        #workspace-modal .modal,
        #team-modal .modal,
        #profile-modal .modal,
        #task-modal-enhanced .modal,
        #activity-log-modal .modal,
        #project-settings-modal .modal-content,
        .modal {
            background-color: var(--bg-panel) !important;
            background: var(--bg-panel) !important;
            color: var(--text-main);
        }

        /* Never paint the full-screen overlay white */
        .modal-overlay {
            background: rgba(0, 0, 0, 0.4) !important;
        }

        .modal-overlay.active .modal {
            transform: scale(1) translateY(0);
            opacity: 1;
        }

        /* Fix: `#project-settings-modal` uses the full-screen modal pattern,
           but earlier `.modal` styles can leave opacity at 0. */
        #project-settings-modal {
            opacity: 1;
            transform: none;
        }

        /* Client Portal modal responsive layout */
        @media (max-width: 900px) {
            #project-settings-modal [data-client-portal-grid] {
                grid-template-columns: 1fr !important;
            }
        }

        /* CUSTOM SCROLLBAR */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--text-muted);
        }

        .modal-header {
            padding: 25px 30px;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: 700;
            background: var(--bg-panel);
            position: sticky;
            top: 0;
            z-index: 10;
            backdrop-filter: blur(10px);
        }

        .modal-header span {
            font-size: 20px;
            color: var(--text-main);
        }

        .modal-header button {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            transition: all 0.2s;
            color: var(--text-secondary);
        }

        .modal-header button:hover {
            background: var(--bg-app);
            color: var(--text-main);
        }

        .modal-body {
            padding: 30px;
            overflow-y: auto;
            display: flex;
            gap: 30px;
        }

        /* Modal/forms: standardize spacing + interaction (ClickUp-like) */
        .modal-header {
            padding: 12px 14px;
            border-bottom: 1px solid var(--gridline-strong);
            background: color-mix(in srgb, var(--surface-2) 92%, transparent);
        }

        .modal-body {
            padding: 14px;
            gap: 14px;
        }

        .modal-footer {
            padding: 12px 14px;
            border-top: 1px solid var(--gridline-strong);
            background: var(--surface-1);
        }

        input,
        select,
        textarea {
            width: 100%;
            padding: 10px 12px;
            margin-bottom: 12px;
            border: 1px solid var(--border);
            background: var(--surface-2);
            color: var(--text-main);
            border-radius: 12px;
            font-family: inherit;
            transition: all 0.2s ease;
            font-size: var(--ft-text-md);
            font-weight: var(--ft-weight-bold);
        }

        button:active,
        .ft-btn:active,
        .btn-primary:active,
        .btn-secondary:active,
        .filter-btn:active,
        .view-btn:active {
            transform: translateY(1px);
        }

        input:focus,
        select:focus,
        textarea:focus {
            border-color: var(--brand-primary);
            box-shadow: var(--ft-ring);
        }

        label {
            display: block;
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            margin-bottom: 6px;
            text-transform: uppercase;
        }

        /* PASSWORD MODAL */
        .pass-card {
            background: var(--bg-panel);
            padding: 30px;
            border-radius: 16px;
            width: 300px;
            text-align: center;
            border: 1px solid var(--border);
            box-shadow: var(--shadow-lg);
        }

        /* Overdue */
        .overdue {
            border-left-color: var(--brand-red) !important;
            background: var(--brand-red-light) !important;
        }

        .text-red {
            color: var(--brand-red);
            font-weight: bold;
        }

        /* CHAT FEATURE STYLES */
        .chat-toggle {
            position: fixed;
            bottom: 24px;
            right: 24px;
            width: 60px;
            height: 60px;
            background: var(--brand-primary);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
            z-index: 999;
            border: none;
            font-size: 24px;
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .chat-toggle:hover {
            transform: scale(1.1);
            background: var(--brand-primary-dark);
            box-shadow: 0 12px 30px rgba(79, 70, 229, 0.6);
        }

        .chat-panel {
            position: fixed;
            bottom: 100px;
            right: 24px;
            width: 380px;
            height: 550px;
            background: color-mix(in srgb, var(--surface-2) 88%, transparent);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-radius: 18px;
            box-shadow: var(--shadow-xl);
            display: flex;
            flex-direction: column;
            z-index: 998;
            border: 1px solid var(--border);
            transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            transform-origin: bottom right;
        }

        .chat-panel.hidden {
            transform: scale(0.8) translateY(40px);
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }

        .chat-panel:not(.hidden) {
            transform: translateY(0);
            opacity: 1;
            visibility: visible;
        }

        .chat-header {
            padding: 12px 14px;
            border-bottom: 1px solid var(--gridline-strong);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: transparent;
        }

        .chat-header h3 {
            margin: 0;
            font-size: 13px;
            font-weight: 900;
            color: var(--text-main);
        }

        .chat-close {
            background: var(--surface-3);
            border: 1px solid transparent;
            font-size: 16px;
            cursor: pointer;
            color: var(--text-muted);
            transition: all 0.2s ease;
            width: 32px;
            height: 32px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .chat-close:hover {
            color: var(--text-main);
            background: var(--surface-3);
            border-color: var(--gridline-strong);
        }

        .chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .message {
            max-width: 80%;
            padding: 12px 16px;
            border-radius: 18px;
            font-size: 14px;
            line-height: 1.5;
            position: relative;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            overflow-wrap: anywhere;
        }

        .message.own {
            align-self: flex-end;
            background: var(--brand-primary-light);
            color: var(--text-main);
            border: 1px solid rgba(239, 68, 68, 0.18);
            border-bottom-right-radius: 4px;
        }

        .message.other {
            align-self: flex-start;
            background: var(--bg-panel);
            color: var(--text-main);
            border-bottom-left-radius: 4px;
            border: 1px solid var(--border-light);
        }

        /* In dark mode --border-light matches the panel, so the bubble would vanish. */
        :root[data-theme="dark"] .message.other {
            background: var(--bg-app);
            border-color: var(--border);
        }

        /* Grouped messages: pull consecutive bubbles together (container gap is 12px)
           and square off the corners where they join. */
        .message.chat-msg-cont {
            margin-top: -9px;
        }

        .message.own.chat-msg-cont { border-top-right-radius: 6px; }
        .message.own.chat-msg-has-next { border-bottom-right-radius: 6px; }
        .message.other.chat-msg-cont { border-top-left-radius: 6px; }
        .message.other.chat-msg-has-next { border-bottom-left-radius: 6px; }

        .chat-msg-sender {
            font-size: 11px;
            font-weight: 600;
            margin-bottom: 3px;
            color: var(--text-secondary);
        }

        .chat-msg-sender-former {
            font-style: italic;
            font-weight: 500;
            color: var(--text-muted);
        }

        .chat-msg-time {
            font-size: 10px;
            color: var(--text-muted);
            text-align: right;
            margin-top: 4px;
        }

        .chat-day-divider {
            display: flex;
            align-items: center;
            gap: 12px;
            margin: 6px 0;
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .chat-day-divider::before,
        .chat-day-divider::after {
            content: '';
            flex: 1;
            height: 1px;
            background: var(--border);
        }

        .chat-input {
            padding: 20px;
            border-top: 1px solid rgba(0, 0, 0, 0.05);
            display: flex;
            gap: 12px;
            background: transparent;
        }

        .chat-input input {
            flex: 1;
            margin: 0;
            padding: 12px 16px;
            border-radius: 20px;
            border: 1px solid var(--border);
            background: var(--bg-app);
            color: var(--text-main);
        }

        .chat-input input:focus {
            border-color: var(--brand-primary);
            background: var(--bg-panel);
            color: var(--text-main);
            outline: none;
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
        }



        .chat-send {
            background: var(--brand-primary);
            color: white;
            border: none;
            border-radius: 12px;
            padding: 0 16px;
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
        }

        .chat-send:hover {
            background: var(--brand-primary-dark);
            transform: scale(1.05);
        }

        .inbox-chat-call-controls {
            display: flex;
            gap: 8px;
            align-items: center;
            flex-wrap: wrap;
        }

        .inbox-call-select {
            height: 34px;
            min-width: 200px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--bg-panel);
            color: var(--text-main);
            font-size: 12px;
            padding: 0 10px;
            outline: none;
        }

        .inbox-call-btn {
            height: 34px;
            min-width: 34px;
            border-radius: 10px;
            border: 1px solid var(--border);
            background: var(--bg-panel);
            color: var(--text-main);
            cursor: pointer;
            transition: all 0.18s ease;
        }

        .inbox-call-btn:hover {
            border-color: var(--brand-primary);
            color: var(--brand-primary);
            transform: translateY(-1px);
        }

        .team-call-status-badge {
            font-size: 11px;
            font-weight: 700;
            border-radius: 999px;
            padding: 4px 10px;
            border: 1px solid var(--border);
            background: var(--bg-app);
            color: var(--text-secondary);
        }

        .team-call-status-badge.online {
            border-color: #22C55E;
            color: #15803D;
            background: rgba(34, 197, 94, 0.12);
        }

        .team-call-status-badge.ringing {
            border-color: #F59E0B;
            color: #B45309;
            background: rgba(245, 158, 11, 0.14);
            animation: teamCallPulse 1s ease-in-out infinite;
        }

        .team-call-status-badge.live {
            border-color: #2563EB;
            color: #1D4ED8;
            background: rgba(37, 99, 235, 0.12);
        }

        /* ===================================================
           FLOW LINE — Premium Calling Interface
           =================================================== */
        @keyframes fl-wave {
            0%, 100% { height: 6px; }
            50%      { height: 18px; }
        }
        @keyframes fl-wave-lg {
            0%, 100% { height: 8px; }
            50%      { height: 24px; }
        }
        @keyframes fl-glow {
            0%, 100% { opacity: 0.45; }
            50%      { opacity: 0.85; }
        }
        @keyframes fl-fade-up {
            from { opacity: 0; transform: translateY(12px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        @keyframes teamCallPulse {
            0%, 100% { transform: scale(1); }
            50%      { transform: scale(1.04); }
        }

        .flowline-shell {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 28px 24px 36px;
            background: linear-gradient(175deg, var(--bg-panel) 0%, var(--bg-app) 100%);
            animation: fl-fade-up 0.35s ease-out both;
        }

        /* ---- HERO BANNER ---- */
        .flowline-hero {
            position: relative;
            border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, var(--border));
            border-radius: 20px;
            background: linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 10%, var(--bg-panel)) 0%, var(--bg-panel) 55%, color-mix(in srgb, var(--brand-primary) 5%, var(--bg-panel)) 100%);
            padding: 26px 28px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0,0,0,0.04);
            transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
        }
        .flowline-hero::before {
            content: '';
            position: absolute;
            top: -40px; right: -40px;
            width: 140px; height: 140px;
            border-radius: 50%;
            background: radial-gradient(circle, color-mix(in srgb, var(--brand-primary) 12%, transparent) 0%, transparent 70%);
            pointer-events: none;
        }
        .flowline-hero:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 28px rgba(0,0,0,0.08);
            border-color: color-mix(in srgb, var(--brand-primary) 36%, var(--border));
        }

        .flowline-hero-left {
            display: flex;
            align-items: center;
            gap: 18px;
            z-index: 1;
        }

        .flowline-hero-icon {
            width: 52px; height: 52px;
            border-radius: 16px;
            display: flex;
            align-items: flex-end;
            justify-content: center;
            gap: 3px;
            padding-bottom: 12px;
            background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark, #b91c1c));
            box-shadow: 0 6px 20px color-mix(in srgb, var(--brand-primary) 30%, transparent);
            flex-shrink: 0;
        }
        .flowline-hero-icon .fl-bar {
            width: 3.5px;
            border-radius: 3px;
            background: #fff;
        }
        .flowline-hero-icon .fl-bar:nth-child(1) { animation: fl-wave 1.1s 0s ease-in-out infinite; }
        .flowline-hero-icon .fl-bar:nth-child(2) { animation: fl-wave-lg 1.1s 0.15s ease-in-out infinite; }
        .flowline-hero-icon .fl-bar:nth-child(3) { animation: fl-wave 1.1s 0.3s ease-in-out infinite; }
        .flowline-hero-icon .fl-bar:nth-child(4) { animation: fl-wave-lg 1.1s 0.45s ease-in-out infinite; }
        .flowline-hero-icon .fl-bar:nth-child(5) { animation: fl-wave 1.1s 0.6s ease-in-out infinite; }

        .flowline-title {
            font-size: 20px;
            font-weight: 800;
            color: var(--text-main);
            margin: 0 0 4px 0;
            letter-spacing: -0.3px;
        }
        .flowline-sub {
            font-size: 13px;
            color: var(--text-muted);
            margin: 0;
            line-height: 1.4;
        }

        /* ---- SECTION GRID ---- */
        .flowline-grid {
            margin-top: 20px;
            display: flex;
            flex-direction: column;
            gap: 18px;
        }

        /* ---- CARDS ---- */
        .flowline-card {
            border: 1px solid var(--border);
            border-radius: 18px;
            background: var(--bg-panel);
            padding: 22px 24px;
            box-shadow: 0 1px 4px rgba(0,0,0,0.03);
            transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
        }
        .flowline-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
            border-color: color-mix(in srgb, var(--brand-primary) 22%, var(--border));
        }

        .flowline-card-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 18px;
        }
        .flowline-card-header-icon {
            width: 34px; height: 34px;
            border-radius: 10px;
            display: flex; align-items: center; justify-content: center;
            font-size: 14px;
            flex-shrink: 0;
        }
        .flowline-card h4 {
            margin: 0;
            font-size: 14px;
            font-weight: 700;
            color: var(--text-main);
            letter-spacing: 0.1px;
        }
        .flowline-card h4 small {
            display: block;
            font-size: 12px;
            font-weight: 500;
            color: var(--text-muted);
            margin-top: 2px;
            letter-spacing: 0;
        }

        /* ---- MEMBER SELECT ---- */
        .flowline-select-row {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 18px;
        }
        .flowline-select-row select {
            flex: 1;
            height: 44px;
            padding: 0 14px;
            border: 1.5px solid var(--border);
            border-radius: 12px;
            background: var(--bg-app);
            color: var(--text-main);
            font-size: 13px;
            font-weight: 600;
            font-family: var(--ft-font);
            appearance: none;
            -webkit-appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 14px center;
            cursor: pointer;
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        .flowline-select-row select:focus {
            outline: none;
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 12%, transparent);
        }

        /* ---- ACTION TILES GRID ---- */
        .flowline-action-tiles {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
        }

        .flowline-action-tile {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 20px 14px;
            border: 1.5px solid var(--border);
            border-radius: 16px;
            background: var(--bg-panel);
            cursor: pointer;
            text-align: center;
            transition: all 0.22s ease;
            overflow: hidden;
        }
        .flowline-action-tile::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: inherit;
            opacity: 0;
            transition: opacity 0.25s ease;
        }
        .flowline-action-tile:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 24px rgba(0,0,0,0.08);
        }

        .flowline-action-tile .fl-tile-icon {
            width: 46px; height: 46px;
            border-radius: 14px;
            display: flex; align-items: center; justify-content: center;
            font-size: 18px;
            transition: transform 0.2s ease;
        }
        .flowline-action-tile:hover .fl-tile-icon {
            transform: scale(1.08);
        }
        .flowline-action-tile .fl-tile-label {
            font-size: 13px;
            font-weight: 700;
            color: var(--text-main);
        }
        .flowline-action-tile .fl-tile-desc {
            font-size: 11px;
            color: var(--text-muted);
            line-height: 1.35;
        }

        /* Tile themes */
        .flowline-action-tile.tile-audio {
            border-color: color-mix(in srgb, var(--brand-primary) 18%, var(--border));
        }
        .flowline-action-tile.tile-audio::before {
            background: linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 6%, transparent), transparent);
        }
        .flowline-action-tile.tile-audio:hover {
            border-color: color-mix(in srgb, var(--brand-primary) 40%, var(--border));
        }
        .flowline-action-tile.tile-audio:hover::before { opacity: 1; }
        .flowline-action-tile.tile-audio .fl-tile-icon {
            background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark, #b91c1c));
            color: #fff;
            box-shadow: 0 4px 14px color-mix(in srgb, var(--brand-primary) 28%, transparent);
        }

        .flowline-action-tile.tile-video {
            border-color: color-mix(in srgb, #2563EB 14%, var(--border));
        }
        .flowline-action-tile.tile-video::before {
            background: linear-gradient(135deg, rgba(37,99,235,0.05), transparent);
        }
        .flowline-action-tile.tile-video:hover {
            border-color: color-mix(in srgb, #2563EB 38%, var(--border));
        }
        .flowline-action-tile.tile-video:hover::before { opacity: 1; }
        .flowline-action-tile.tile-video .fl-tile-icon {
            background: linear-gradient(135deg, #2563EB, #1D4ED8);
            color: #fff;
            box-shadow: 0 4px 14px rgba(37,99,235,0.28);
        }

        .flowline-action-tile.tile-group {
            border-color: color-mix(in srgb, #7C3AED 14%, var(--border));
        }
        .flowline-action-tile.tile-group::before {
            background: linear-gradient(135deg, rgba(124,58,237,0.05), transparent);
        }
        .flowline-action-tile.tile-group:hover {
            border-color: color-mix(in srgb, #7C3AED 38%, var(--border));
        }
        .flowline-action-tile.tile-group:hover::before { opacity: 1; }
        .flowline-action-tile.tile-group .fl-tile-icon {
            background: linear-gradient(135deg, #7C3AED, #6D28D9);
            color: #fff;
            box-shadow: 0 4px 14px rgba(124,58,237,0.28);
        }

        .flowline-action-tile.tile-group-video {
            border-color: color-mix(in srgb, #0891B2 14%, var(--border));
        }
        .flowline-action-tile.tile-group-video::before {
            background: linear-gradient(135deg, rgba(8,145,178,0.05), transparent);
        }
        .flowline-action-tile.tile-group-video:hover {
            border-color: color-mix(in srgb, #0891B2 38%, var(--border));
        }
        .flowline-action-tile.tile-group-video:hover::before { opacity: 1; }
        .flowline-action-tile.tile-group-video .fl-tile-icon {
            background: linear-gradient(135deg, #0891B2, #0E7490);
            color: #fff;
            box-shadow: 0 4px 14px rgba(8,145,178,0.28);
        }

        /* ---- QUICK STATS ---- */
        .flowline-stats-strip {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
        }
        .flowline-stat {
            border: 1px solid var(--border);
            border-radius: 14px;
            padding: 16px;
            background: var(--bg-panel);
            text-align: center;
            transition: transform 0.2s ease, border-color 0.2s ease;
        }
        .flowline-stat:hover {
            transform: translateY(-2px);
            border-color: color-mix(in srgb, var(--brand-primary) 22%, var(--border));
        }
        .flowline-stat-icon {
            width: 36px; height: 36px;
            border-radius: 10px;
            display: inline-flex;
            align-items: center; justify-content: center;
            font-size: 15px;
            margin-bottom: 10px;
        }
        .flowline-stat-value {
            font-size: 22px;
            font-weight: 800;
            color: var(--text-main);
            line-height: 1;
            margin-bottom: 4px;
        }
        .flowline-stat-label {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.4px;
        }

        /* ---- INFO BANNER ---- */
        .flowline-info-banner {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 16px 18px;
            border-radius: 14px;
            border: 1px solid color-mix(in srgb, #2563EB 15%, var(--border));
            background: linear-gradient(135deg, rgba(37,99,235,0.04) 0%, rgba(37,99,235,0.01) 100%);
            font-size: 12.5px;
            line-height: 1.55;
            color: var(--text-secondary);
        }
        .flowline-info-banner i {
            color: #2563EB;
            font-size: 15px;
            margin-top: 2px;
            flex-shrink: 0;
        }

        /* ---- LEGACY COMPAT (keeps existing JS working) ---- */
        .flowline-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
        .flowline-call-btn { height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-panel); color: var(--text-main); padding: 0 14px; cursor: pointer; font-weight: 700; font-size: 13px; font-family: var(--ft-font); transition: all 0.18s ease; display: none; }
        .flowline-call-btn.primary { display: none; }
        .flowline-call-btn.video { display: none; }
        .flowline-meta { display: none; }
        .flowline-kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
        .flowline-kpi-item { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--bg-app); transition: transform 0.18s ease; }
        .flowline-kpi-item:hover { transform: translateY(-1px); }
        .flowline-kpi-item .kpi-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
        .flowline-kpi-item .kpi-value { font-size: 14px; font-weight: 800; color: var(--text-main); }
        .flowline-tip { margin-top: 10px; font-size: 12px; color: var(--text-muted); line-height: 1.45; }

        @media (max-width: 980px) {
            .flowline-action-tiles { grid-template-columns: 1fr; }
            .flowline-stats-strip { grid-template-columns: 1fr; }
        }

        .team-call-modal-shell {
            width: 470px;
            max-width: 94vw;
            border-radius: 18px;
            border: 1px solid var(--border);
            background: var(--bg-panel);
            box-shadow: 0 22px 58px rgba(2, 6, 23, 0.35);
            overflow: hidden;
        }

        .team-call-modal-body {
            padding: 18px 20px 20px;
        }

        .team-call-modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 14px;
        }

        .team-call-modal-actions.incoming-secondary {
            justify-content: flex-start;
            flex-wrap: wrap;
            margin-top: 10px;
        }

        .team-call-incoming-minibar {
            display: none;
            position: fixed;
            right: 16px;
            bottom: 16px;
            z-index: 100349;
            width: min(420px, calc(100vw - 32px));
            border-radius: 14px;
            border: 1px solid var(--border);
            background: var(--bg-panel);
            box-shadow: 0 16px 44px rgba(2, 6, 23, 0.38);
            padding: 12px 14px;
            flex-direction: column;
            gap: 10px;
        }

        .team-call-incoming-minibar-inner {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .team-call-incoming-minibar-text {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            font-size: 13px;
        }

        .team-call-incoming-mini-title {
            font-weight: 800;
            color: var(--text-main);
            line-height: 1.25;
        }

        .team-call-incoming-mini-sub {
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 3px;
            line-height: 1.35;
        }

        .team-call-incoming-minibar-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: flex-end;
            align-items: center;
        }

        .team-call-panel {
            display: none;
            position: fixed;
            right: 18px;
            bottom: 18px;
            z-index: 100320;
            width: 460px;
            max-width: calc(100vw - 24px);
            border-radius: 20px;
            border: 1px solid var(--border);
            background: color-mix(in srgb, var(--bg-panel) 96%, transparent);
            backdrop-filter: blur(14px);
            box-shadow: 0 22px 56px rgba(2, 6, 23, 0.28);
            overflow: hidden;
        }

        .team-call-panel-head {
            padding: 16px 16px 12px 16px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            cursor: move;
            user-select: none;
        }

        .team-call-panel-title {
            font-size: 18px;
            font-weight: 800;
            color: var(--text-main);
            margin: 0 0 3px 0;
        }

        .team-call-panel-sub {
            font-size: 14px;
            color: var(--text-muted);
        }

        .team-call-panel-body {
            padding: 8px 10px 10px;
            display: grid;
            grid-template-columns: repeat(5, minmax(0, 1fr));
            gap: 6px;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
            background: linear-gradient(180deg, #030712 0%, #020617 100%);
        }

        .team-call-video-wrap {
            display: none;
            position: relative;
            height: 320px;
            margin: 0 16px 8px 16px;
            border: 1px solid rgba(148, 163, 184, 0.22);
            border-radius: 14px;
            overflow: hidden;
            background: #020617;
        }

        .team-call-panel .team-call-chip-btn {
            height: 42px;
            padding: 4px 6px;
            border-radius: 10px;
            border: 1px solid transparent;
            background: transparent;
            color: #E2E8F0;
            cursor: pointer;
            font-size: 11px;
            font-weight: 600;
            transition: all 0.18s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            gap: 3px;
        }

        .team-call-panel .team-call-chip-btn i {
            font-size: 14px;
            line-height: 1;
        }

        .team-call-panel .team-call-chip-btn:hover {
            background: rgba(148, 163, 184, 0.15);
            border-color: rgba(148, 163, 184, 0.45);
            color: #fff;
        }

        .team-call-panel .team-call-chip-btn.is-muted {
            border-color: #DC2626;
            color: #FCA5A5;
            background: rgba(220, 38, 38, 0.08);
            position: relative;
        }

        .team-call-panel .team-call-chip-btn.is-muted::after {
            content: "";
            position: absolute;
            left: 10px;
            right: 10px;
            top: 20px;
            height: 2px;
            background: #DC2626;
            transform: rotate(-12deg);
            transform-origin: center;
            pointer-events: none;
        }

        .team-call-panel .team-call-chip-btn.end {
            border-color: #DC2626;
            background: #DC2626;
            color: #fff;
        }

        .team-call-panel .team-call-chip-btn.video {
            border-color: rgba(37, 99, 235, 0.55);
            color: #93C5FD;
            background: rgba(37, 99, 235, 0.18);
        }

        .team-call-panel-head-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .team-call-min-btn {
            width: 34px;
            height: 34px;
            border-radius: 10px;
            border: 1px solid var(--border);
            background: var(--bg-panel);
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.18s ease;
            font-weight: 900;
        }

        .team-call-min-btn:hover {
            color: var(--text-main);
            border-color: var(--brand-primary);
        }

        .team-call-debug {
            margin-top: 8px;
            padding: 8px 10px;
            border: 1px dashed var(--border);
            border-radius: 10px;
            background: var(--bg-app);
            font-size: 11px;
            color: var(--text-muted);
            line-height: 1.5;
        }

        .team-call-panel.minimized {
            width: 320px;
        }

        .team-call-panel.minimized .team-call-panel-body,
        .team-call-panel.minimized .team-call-video-wrap,
        .team-call-panel.minimized #team-call-participants,
        .team-call-panel.minimized #team-call-debug {
            display: none !important;
        }

        /* ===================================================
           FLOW LINE — In-Call Stage (Daily headless)
           =================================================== */
        .flowline-call-stage {
            display: none;
            position: fixed;
            inset: 12px;
            z-index: 100500;
            border-radius: 22px;
            overflow: hidden;
            background: #020617;
            border: 1px solid rgba(148, 163, 184, 0.18);
            box-shadow: 0 40px 100px rgba(2, 6, 23, 0.65), 0 0 0 1px rgba(255,255,255,0.04) inset;
            animation: fl-fade-up 0.3s ease-out both;
        }
        .flowline-call-stage.active {
            display: block;
        }

        .flowline-call-stage-head {
            height: 62px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px 0 22px;
            color: #E2E8F0;
            background: rgba(2, 6, 23, 0.7);
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            backdrop-filter: blur(24px);
            -webkit-backdrop-filter: blur(24px);
        }

        .flowline-call-stage-head > div:first-child {
            display: flex;
            align-items: center;
            gap: 14px;
        }
        .flowline-call-stage-head .fl-stage-dot {
            width: 10px; height: 10px;
            border-radius: 50%;
            background: #22C55E;
            animation: fl-glow 1.6s ease-in-out infinite;
            flex-shrink: 0;
        }

        .flowline-call-stage-title {
            font-weight: 800;
            font-size: 15px;
            letter-spacing: 0.1px;
            color: #F1F5F9;
        }
        .flowline-call-stage-sub {
            font-size: 12px;
            color: rgba(226, 232, 240, 0.6);
            margin-top: 2px;
        }

        #flowline-head-duration {
            font-size: 14px;
            font-weight: 800;
            font-variant-numeric: tabular-nums;
            color: rgba(241, 245, 249, 0.95);
            min-width: 48px;
            text-align: center;
            display: none;
        }

        .flowline-call-stage-actions {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .flowline-call-stage-btn {
            width: 42px; height: 42px;
            padding: 0;
            border-radius: 14px;
            border: 1px solid rgba(148, 163, 184, 0.18);
            background: rgba(30, 41, 59, 0.7);
            color: #E2E8F0;
            cursor: pointer;
            font-weight: 700;
            font-size: 15px;
            display: flex; align-items: center; justify-content: center;
            backdrop-filter: blur(8px);
            transition: all 0.2s ease;
        }
        .flowline-call-stage-btn:hover {
            border-color: rgba(148, 163, 184, 0.45);
            background: rgba(30, 41, 59, 0.9);
            transform: scale(1.06);
        }

        .flowline-call-stage-btn.end {
            border-color: rgba(220, 38, 38, 0.5);
            background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
            color: #fff;
            width: auto;
            padding: 0 20px;
            gap: 8px;
            box-shadow: 0 4px 16px rgba(220, 38, 38, 0.35);
        }
        .flowline-call-stage-btn.end:hover {
            box-shadow: 0 6px 22px rgba(220, 38, 38, 0.5);
            transform: scale(1.04);
        }

        .flowline-daily-shell {
            position: relative;
            width: 100%;
            height: calc(100% - 62px);
            background: #020617;
        }

        #flowline-daily-remote {
            width: 100%;
            height: 100%;
            object-fit: cover;
            background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
        }

        .flowline-daily-local-pip {
            position: absolute;
            right: 18px;
            bottom: 18px;
            width: 160px;
            height: 210px;
            border-radius: 18px;
            overflow: hidden;
            border: 2px solid rgba(255, 255, 255, 0.15);
            box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255,255,255,0.05) inset;
            background: #111827;
            transition: transform 0.25s ease, box-shadow 0.25s ease;
            cursor: grab;
        }
        .flowline-daily-local-pip:hover {
            transform: scale(1.04);
            box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
        }

        #flowline-daily-local {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transform: scaleX(-1);
        }

        #flowline-daily-remote-audio {
            position: absolute;
            width: 0;
            height: 0;
            opacity: 0;
            pointer-events: none;
        }

        /* Dark-theme-safe (call stage is always dark) */
        [data-theme="dark"] .flowline-hero {
            background: linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 8%, var(--bg-panel)) 0%, var(--bg-panel) 55%);
        }
        [data-theme="dark"] .flowline-card {
            background: var(--bg-panel);
        }
        [data-theme="dark"] .flowline-action-tile {
            background: var(--bg-panel);
        }
        [data-theme="dark"] .flowline-stat {
            background: var(--bg-panel);
        }
        [data-theme="dark"] .flowline-info-banner {
            border-color: color-mix(in srgb, #2563EB 12%, var(--border));
            background: linear-gradient(135deg, rgba(37,99,235,0.06) 0%, transparent 100%);
        }
        [data-theme="dark"] .flowline-select-row select {
            background-color: var(--bg-app);
            border-color: var(--border);
            color: var(--text-main);
            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='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
        }

        .team-video-stage {
            position: fixed;
            right: 18px;
            bottom: 18px;
            width: 420px;
            height: 680px;
            max-width: calc(100vw - 24px);
            max-height: calc(100vh - 24px);
            z-index: 100321;
            border: 1px solid var(--border);
            border-radius: 16px;
            overflow: hidden;
            background: #0f172a;
            box-shadow: 0 20px 44px rgba(2, 6, 23, 0.25);
            display: none;
        }

        .team-video-stage-header {
            padding: 10px 12px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 12px;
            font-weight: 700;
            color: #E2E8F0;
            background: rgba(2, 6, 23, 0.8);
        }

        .team-video-stage-grid {
            position: relative;
            width: 100%;
            height: calc(100% - 44px);
            background: #020617;
        }

        .team-video-main {
            position: relative;
            width: 100%;
            height: 100%;
            overflow: hidden;
            background: #0b1220;
        }

        .team-video-main video {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: cover;
            background: #111827;
        }

        .team-video-local-pip {
            position: absolute;
            right: 10px;
            bottom: 60px;
            width: 120px;
            height: 170px;
            border-radius: 12px;
            overflow: hidden;
            background: #111827;
            border: 1px solid rgba(255, 255, 255, 0.22);
            box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
        }

        .team-video-local-pip video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            transform: scaleX(-1);
        }

        .team-video-label {
            position: absolute;
            left: 8px;
            bottom: 8px;
            font-size: 11px;
            font-weight: 700;
            color: #fff;
            background: rgba(2, 6, 23, 0.55);
            border-radius: 6px;
            padding: 2px 6px;
        }

        .team-video-controls {
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            background: linear-gradient(180deg, rgba(2, 6, 23, 0) 0%, rgba(2, 6, 23, 0.85) 60%);
        }

        .team-member-presence {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 6px;
        }

        .presence-dot {
            width: 8px;
            height: 8px;
            border-radius: 999px;
            background: #94A3B8;
        }

        .presence-dot.online {
            background: #22C55E;
            box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
        }

        .presence-dot.busy {
            background: #F59E0B;
            box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
        }

        .presence-dot.dnd {
            background: #7C3AED;
            box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.18);
        }

        .flowline-dnd-row {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            margin: 0 0 14px 0;
            padding: 10px 12px;
            border-radius: 12px;
            border: 1px solid var(--border);
            background: color-mix(in srgb, var(--bg-panel) 92%, var(--bg-app));
            cursor: pointer;
            user-select: none;
        }

        .flowline-dnd-row input {
            margin-top: 3px;
            accent-color: #7C3AED;
        }

        .flowline-dnd-row .flowline-dnd-text {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .flowline-dnd-row .flowline-dnd-text strong {
            font-size: 13px;
            color: var(--text-main);
        }

        .flowline-dnd-row .flowline-dnd-text small {
            font-size: 11px;
            color: var(--text-muted);
            line-height: 1.35;
        }

        .unread-badge {
            position: absolute;
            top: -5px;
            right: -5px;
            background: #FF6B6B;
            color: white;
            border-radius: 50%;
            width: 20px;
            height: 20px;
            font-size: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* COMPACT FILTER & SEARCH STYLES */
        /* COMPACT FILTER & SEARCH STYLES */
        /* Removed duplicate .filter-bar styles to fix spacing issues */

        .search-box {
            flex: 0 0 240px;
            position: relative;
        }

        .search-box input {
            padding-left: 40px;
            margin: 0;
            height: 40px;
            font-size: 14px;
            border-radius: 20px;
            background: var(--bg-app);
            color: var(--text-main);
            border: 1px solid var(--border);
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }

        .search-box input:focus {
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
        }

        .search-icon {
            position: absolute;
            left: 12px;
            top: 10px;
            color: var(--text-muted);
            font-size: 14px;
        }

        .filter-options {
            display: flex;
            gap: 8px;
            flex-wrap: nowrap;
            align-items: center;
            flex: 1;
            overflow-x: auto;
            padding: 0;
        }

        .filter-select {
            min-width: 140px;
            margin: 0;
            height: 38px;
            font-size: 13px;
            padding: 0 12px;
            border-radius: 12px;
            background: var(--surface-2);
            border: 1px solid var(--border);
            color: var(--text-main);
            transition: var(--transition);
        }

        .filter-select:hover {
            background: color-mix(in srgb, var(--surface-2) 92%, var(--surface-3));
        }

        .filter-select:focus {
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
        }

        .filter-btn {
            background: transparent;
            border: 1px solid var(--border);
            color: var(--text-muted);
            padding: 8px 12px;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            height: 36px;
            white-space: nowrap;
            transition: all 0.2s ease;
        }

        .filter-btn:hover {
            border-color: var(--brand-red);
            color: var(--brand-red);
        }

        .filter-btn.active {
            background: var(--brand-red);
            color: white;
            border-color: var(--brand-red);
        }

        .results-count {
            font-size: 12px;
            color: var(--text-muted);
            margin-left: 10px;
            white-space: nowrap;
        }

        /* Toast notifications */
        .toast {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
            color: white;
            padding: 14px 20px;
            border-radius: 12px;
            box-shadow: var(--shadow-lg);
            z-index: 2147483647;
            /* Above modals */
            animation: toastIn 0.3s ease;
            font-size: 14px;
            font-weight: 600;
            backdrop-filter: blur(10px);
        }

        @keyframes slideInRight {
            from {
                transform: translateX(100%);
                opacity: 0;
            }

            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes slideOutRight {
            from {
                transform: translateX(0);
                opacity: 1;
            }

            to {
                transform: translateX(100%);
                opacity: 0;
            }
        }

        /* ==============================================
           KEYBOARD SHORTCUTS & COMMAND PALETTE
           ============================================== */

        /* Command Palette Overlay */
        .command-palette {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(8px);
            z-index: 99999;
            display: flex;
            align-items: flex-start;
            justify-content: center;
            padding-top: 15vh;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease;
        }

        .command-palette.active {
            opacity: 1;
            pointer-events: all;
        }

        .command-palette-content {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 16px;
            box-shadow: var(--shadow-xl);
            width: 90%;
            max-width: 600px;
            max-height: 400px;
            overflow: hidden;
            transform: scale(0.95);
            transition: transform 0.2s ease;
        }

        .command-palette.active .command-palette-content {
            transform: scale(1);
        }

        #command-search {
            width: 100%;
            padding: 18px 20px;
            border: none;
            border-bottom: 1px solid var(--gridline-strong);
            background: transparent;
            font-size: 16px;
            color: var(--text-main);
            outline: none;
        }

        #command-search::placeholder {
            color: var(--text-muted);
        }

        #command-results {
            max-height: 320px;
            overflow-y: auto;
        }

        .command-item {
            padding: 12px 20px;
            display: flex;
            align-items: center;
            gap: 12px;
            cursor: pointer;
            border-bottom: 1px solid var(--gridline);
            transition: all 0.15s ease;
        }

        .command-item:hover,
        .command-item.selected {
            background: var(--surface-3);
        }

        .command-item i {
            width: 20px;
            color: var(--brand-primary);
            font-size: 14px;
        }

        .command-item-name {
            flex: 1;
            font-weight: 500;
            color: var(--text-main);
        }

        .command-item-shortcut {
            font-size: 11px;
            color: var(--text-muted);
            background: var(--surface-3);
            padding: 3px 8px;
            border-radius: 10px;
            font-family: monospace;
        }

        .command-empty {
            padding: 40px 20px;
            text-align: center;
            color: var(--text-muted);
        }

        /* === Command Palette V2 Styles === */

        .command-palette-header {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 0 20px;
            border-bottom: 1px solid var(--gridline-strong);
        }

        .command-palette-header #command-search {
            border-bottom: none;
            padding: 18px 0;
        }

        .cmd-breadcrumb {
            display: flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .cmd-breadcrumb-chip {
            background: var(--brand-primary);
            color: white;
            font-size: 11px;
            font-weight: 600;
            padding: 3px 10px;
            border-radius: 4px;
            letter-spacing: 0.3px;
        }

        .cmd-breadcrumb-sep {
            color: var(--text-muted);
            font-size: 11px;
        }

        .cmd-context-pill {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 11px;
            color: var(--text-muted);
            background: var(--bg-secondary, rgba(0, 0, 0, 0.05));
            padding: 3px 10px;
            border-radius: 4px;
            max-width: 200px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .cmd-category-header {
            padding: 10px 20px 5px 20px;
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-muted);
            user-select: none;
        }

        .command-item-meta {
            font-size: 11px;
            color: var(--text-muted);
            max-width: 200px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .command-item mark {
            background: rgba(239, 68, 68, 0.15);
            color: var(--brand-primary);
            font-weight: 700;
            border-radius: 2px;
            padding: 0 1px;
        }

        .command-item:last-child {
            border-bottom: none;
        }

        .cmd-loading {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 20px;
            color: var(--text-muted);
            font-size: 13px;
        }

        .cmd-loading i {
            animation: spin 0.8s linear infinite;
        }

        .cmd-status-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .cmd-status-dot.todo {
            background: #6B7280;
        }

        .cmd-status-dot.inprogress {
            background: #F59E0B;
        }

        .cmd-status-dot.done {
            background: #10B981;
        }

        .cmd-priority-dot {
            width: 10px;
            height: 10px;
            border-radius: 2px;
            flex-shrink: 0;
        }

        .cmd-priority-dot.low {
            background: #6B7280;
        }

        .cmd-priority-dot.medium {
            background: #3B82F6;
        }

        .cmd-priority-dot.high {
            background: #F59E0B;
        }

        .cmd-priority-dot.urgent {
            background: #EF4444;
        }

        @keyframes cmdFadeIn {
            from {
                opacity: 0;
                transform: translateY(4px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .command-item {
            animation: cmdFadeIn 0.15s ease both;
        }

        .cmd-hint {
            padding: 8px 20px;
            font-size: 11px;
            color: var(--text-muted);
            border-top: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .cmd-hint kbd {
            background: var(--bg-secondary, rgba(0, 0, 0, 0.05));
            padding: 1px 5px;
            border-radius: 3px;
            font-size: 10px;
            font-family: monospace;
            border: 1px solid var(--border);
        }

        /* Keyboard Shortcuts Help Modal */
        .shortcuts-help-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(5px);
            z-index: 99998;
            align-items: center;
            justify-content: center;
        }

        .shortcuts-help-modal.active {
            display: flex;
        }

        .shortcuts-help-content {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 30px;
            max-width: 600px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: var(--shadow-xl);
        }

        .shortcuts-help-content h2 {
            margin: 0 0 20px 0;
            font-size: 24px;
            color: var(--text-main);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .shortcuts-grid {
            display: grid;
            gap: 12px;
        }

        .shortcut-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px;
            background: var(--surface-3);
            border: 1px solid var(--gridline);
            border-radius: 14px;
        }

        .shortcut-label {
            font-weight: 500;
            color: var(--text-main);
        }

        .shortcut-keys {
            display: flex;
            gap: 6px;
        }

        .key {
            background: var(--surface-2);
            border: 1px solid var(--gridline-strong);
            padding: 4px 10px;
            border-radius: 10px;
            font-size: 12px;
            font-family: monospace;
            font-weight: 600;
            color: var(--text-main);
            box-shadow: var(--shadow-sm);
        }

        .shortcuts-close-btn {
            margin-top: 20px;
            width: 100%;
            padding: 10px;
            background: var(--brand-primary);
            color: white;
            border: none;
            border-radius: 12px;
            font-weight: 900;
            cursor: pointer;
        }

        .shortcuts-close-btn:hover {
            opacity: 0.9;
        }

        /* User Profile Popup Styles */
        .user-profile-popup {
            position: fixed;
            top: 70px;
            right: 20px;
            background: var(--bg-panel);
            border-radius: 12px;
            box-shadow: var(--shadow-lg);
            z-index: 9999;
            border: 1px solid var(--border);
            width: 250px;
            padding: 20px;
            display: none;
        }

        .user-profile-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 15px;
        }

        .user-profile-avatar {
            width: 40px;
            height: 40px;
            background: var(--brand-red);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 16px;
        }

        .user-profile-name {
            font-weight: 600;
            font-size: 14px;
            color: var(--text-main);
        }

        .user-profile-role {
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 2px;
        }

        .user-profile-stats {
            font-size: 12px;
            color: var(--text-muted);
            padding-top: 10px;
            border-top: 1px solid var(--border);
        }

        /* User name in top bar with dropdown */
        .user-name-container {
            position: relative;
            cursor: pointer;
        }

        .user-name-container:hover .user-profile-popup {
            display: block;
        }

        /* Dashboard specific styles */
        /* Dashboard specific styles */
        .dashboard-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 24px;
            margin-bottom: 30px;
        }

        .dashboard-stat-card {
            background: var(--bg-panel);
            padding: 24px;
            border-radius: 16px;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            border: 1px solid var(--border);
            position: relative;
            overflow: hidden;
        }

        .dashboard-stat-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            border-color: var(--brand-primary);
        }

        .stat-icon-bg {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            margin-bottom: 16px;
        }

        .stat-icon-bg.blue {
            background: rgba(59, 130, 246, 0.1);
            color: #3B82F6;
        }

        .stat-icon-bg.green {
            background: rgba(16, 185, 129, 0.1);
            color: #10B981;
        }

        .stat-icon-bg.purple {
            background: rgba(139, 92, 246, 0.1);
            color: #8B5CF6;
        }

        .dashboard-stat-value {
            font-size: 32px;
            font-weight: 800;
            color: var(--text-main);
            margin-bottom: 4px;
            line-height: 1;
        }

        .dashboard-stat-label {
            font-size: 13px;
            color: var(--text-muted);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* SIMPLE OVERVIEW LAYOUT */
        .overview-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }

        .overview-panel {
            background: var(--bg-panel);
            border-radius: 8px;
            padding: 20px;
            border: 1px solid var(--border);
        }

        .panel-title {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-main);
            margin: 0 0 16px 0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .recent-items {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .recent-item {
            padding: 10px 12px;
            background: var(--bg-app);
            border-radius: 6px;
            border-left: 3px solid var(--brand-primary);
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .recent-item:hover {
            background: var(--bg-hover);
            transform: translateX(4px);
        }

        .recent-item-icon {
            color: var(--text-muted);
            font-size: 14px;
        }

        .recent-item-text {
            flex: 1;
            font-size: 13px;
            color: var(--text-main);
        }

        .recent-item-meta {
            font-size: 11px;
            color: var(--text-muted);
        }

        .assignee-groups {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .assignee-group {
            border-bottom: 1px solid var(--border);
            padding-bottom: 12px;
        }

        .assignee-group:last-child {
            border-bottom: none;
        }

        .assignee-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
        }

        .assignee-avatar {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: var(--brand-primary);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 700;
        }

        .assignee-name {
            font-weight: 600;
            font-size: 13px;
            color: var(--text-main);
        }

        .assignee-count {
            font-size: 11px;
            color: var(--text-muted);
            margin-left: auto;
        }

        .assignee-tasks {
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin-left: 38px;
        }

        .assignee-task-item {
            font-size: 12px;
            color: var(--text-main);
            padding: 4px 8px;
            background: var(--bg-app);
            border-radius: 4px;
            cursor: pointer;
            transition: background 0.2s;
        }

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

        .folders-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 12px;
        }

        .folder-card {
            padding: 16px;
            background: var(--bg-app);
            border: 1px solid var(--border);
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .folder-card:hover {
            background: var(--bg-hover);
            border-color: var(--brand-primary);
            transform: translateY(-2px);
        }

        .folder-icon {
            font-size: 24px;
            color: var(--brand-primary);
            margin-bottom: 8px;
        }

        .folder-name {
            font-weight: 600;
            font-size: 14px;
            color: var(--text-main);
            margin-bottom: 4px;
        }

        .folder-count {
            font-size: 12px;
            color: var(--text-muted);
        }

        /* NEW OVERVIEW SECTIONS */
        .btn-save-charter,
        .btn-ai-update,
        .btn-add-resource {
            padding: 6px 14px;
            background: var(--brand-primary);
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
            transition: all 0.2s;
        }

        .btn-save-charter:hover,
        .btn-ai-update:hover,
        .btn-add-resource:hover {
            background: var(--brand-hover);
            transform: translateY(-1px);
        }

        .subfolders-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .subfolder-chip {
            padding: 8px 16px;
            background: var(--bg-app);
            border: 1px solid var(--border);
            border-radius: 20px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-main);
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .subfolder-chip:hover {
            background: var(--brand-primary);
            color: white;
            border-color: var(--brand-primary);
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .subfolder-chip i {
            font-size: 11px;
        }

        .workload-bar {
            margin-bottom: 16px;
        }

        .workload-bar-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 6px;
            font-size: 13px;
        }

        .workload-bar-label {
            font-weight: 600;
            color: var(--text-main);
        }

        .workload-bar-count {
            color: var(--text-muted);
            font-size: 12px;
        }

        .workload-bar-track {
            height: 24px;
            background: var(--bg-app);
            border-radius: 6px;
            overflow: hidden;
            border: 1px solid var(--border);
        }

        .workload-bar-fill {
            height: 100%;
            display: flex;
            align-items: center;
            padding: 0 10px;
            font-size: 11px;
            font-weight: 700;
            color: white;
            transition: width 0.5s ease;
        }

        .workload-bar-fill.todo {
            background: #FBBF24;
        }

        .workload-bar-fill.inprogress {
            background: #3B82F6;
        }

        .workload-bar-fill.done {
            background: #10B981;
        }

        .overdue-task-item {
            padding: 12px;
            background: rgba(239, 68, 68, 0.05);
            border-left: 3px solid #EF4444;
            border-radius: 6px;
            margin-bottom: 8px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .overdue-task-item:hover {
            background: rgba(239, 68, 68, 0.1);
            transform: translateX(4px);
        }

        .overdue-task-title {
            font-weight: 600;
            color: var(--text-main);
            margin-bottom: 4px;
            font-size: 13px;
        }

        .overdue-task-meta {
            font-size: 11px;
            color: var(--text-muted);
        }

        .ai-update-content {
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
            padding: 16px;
            border-radius: 8px;
            border: 1px solid rgba(102, 126, 234, 0.2);
        }

        .ai-update-section {
            margin-bottom: 16px;
        }

        .ai-update-section:last-child {
            margin-bottom: 0;
        }

        .ai-update-title {
            font-weight: 700;
            color: var(--brand-primary);
            margin-bottom: 8px;
            font-size: 13px;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .ai-update-text {
            font-size: 13px;
            color: var(--text-main);
            line-height: 1.6;
        }

        .resources-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 12px;
        }

        .resource-card {
            padding: 16px;
            background: var(--bg-app);
            border: 1px solid var(--border);
            border-radius: 8px;
            transition: all 0.2s;
            cursor: pointer;
        }

        .resource-card:hover {
            border-color: var(--brand-primary);
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .resource-icon {
            font-size: 24px;
            color: var(--brand-primary);
            margin-bottom: 8px;
        }

        .resource-name {
            font-weight: 600;
            font-size: 14px;
            color: var(--text-main);
            margin-bottom: 4px;
        }

        .resource-url {
            font-size: 11px;
            color: var(--text-muted);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .resource-actions {
            margin-top: 8px;
            display: flex;
            gap: 8px;
        }

        .resource-btn {
            padding: 4px 8px;
            border: none;
            background: transparent;
            color: var(--text-muted);
            cursor: pointer;
            font-size: 12px;
            transition: color 0.2s;
        }

        .resource-btn:hover {
            color: var(--brand-primary);
        }


        /* STAT WIDGETS */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 16px;
        }

        .stat-widget {
            background: var(--bg-app);
            padding: 20px;
            border-radius: 10px;
            text-align: center;
            border: 1px solid var(--border);
            transition: all 0.2s;
        }

        .stat-widget:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .stat-widget .stat-icon {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 12px;
            font-size: 18px;
        }

        .stat-widget .stat-icon.blue {
            background: rgba(59, 130, 246, 0.1);
            color: #3B82F6;
        }

        .stat-widget .stat-icon.yellow {
            background: rgba(251, 191, 36, 0.1);
            color: #FBBF24;
        }

        .stat-widget .stat-icon.orange {
            background: rgba(251, 146, 60, 0.1);
            color: #FB923C;
        }

        .stat-widget .stat-icon.green {
            background: rgba(16, 185, 129, 0.1);
            color: #10B981;
        }

        .stat-widget .stat-icon.purple {
            background: rgba(139, 92, 246, 0.1);
            color: #8B5CF6;
        }

        .stat-widget .stat-icon.red {
            background: rgba(239, 68, 68, 0.1);
            color: #EF4444;
        }

        .stat-widget .stat-value {
            font-size: 28px;
            font-weight: 700;
            color: var(--text-main);
            margin-bottom: 4px;
        }

        .stat-widget .stat-label {
            font-size: 12px;
            color: var(--text-muted);
            font-weight: 600;
        }

        /* PROGRESS BAR */
        .progress-bar {
            height: 12px;
            background: var(--bg-app);
            border-radius: 6px;
            overflow: hidden;
            border: 1px solid var(--border);
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--brand-primary), #8B5CF6);
            transition: width 0.5s ease;
        }

        /* PEOPLE CARDS */
        .people-card {
            background: var(--bg-app);
            padding: 16px;
            border-radius: 8px;
            border: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .people-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--brand-primary);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 14px;
        }

        .people-info {
            flex: 1;
        }

        .people-name {
            font-weight: 600;
            color: var(--text-main);
            margin-bottom: 2px;
        }

        .people-tasks {
            font-size: 12px;
            color: var(--text-muted);
        }

        /* ACTIVITY LOG */
        .activity-item {
            padding: 12px 0;
            border-bottom: 1px solid var(--border);
            display: flex;
            gap: 12px;
            align-items: flex-start;
        }

        .activity-item:last-child {
            border-bottom: none;
        }

        .activity-icon {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--bg-app);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            font-size: 12px;
            color: var(--text-muted);
        }

        .activity-content {
            flex: 1;
        }

        .activity-text {
            font-size: 14px;
            color: var(--text-main);
            margin-bottom: 2px;
        }

        .activity-time {
            font-size: 12px;
            color: var(--text-muted);
        }

        /* FILE ITEMS */
        .file-item {
            padding: 12px;
            background: var(--bg-app);
            border: 1px solid var(--border);
            border-radius: 6px;
            margin-bottom: 8px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .file-info {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .file-icon {
            color: var(--brand-primary);
            font-size: 18px;
        }

        .file-name {
            font-weight: 600;
            color: var(--text-main);
        }

        .file-actions {
            display: flex;
            gap: 8px;
        }

        .file-btn {
            padding: 4px 8px;
            border: none;
            background: transparent;
            cursor: pointer;
            color: var(--text-muted);
            font-size: 14px;
            transition: color 0.2s;
        }

        .file-btn:hover {
            color: var(--text-main);
        }

        /* CONTENTEDITABLE PLACEHOLDER */
        [contenteditable][placeholder]:is(:empty, :focus)::before {
            content: attr(placeholder);
            color: var(--text-muted);
            opacity: 0.7;
        }


        .dashboard-chart-container {
            background: var(--bg-panel);
            padding: 25px;
            border-radius: 12px;
            box-shadow: var(--shadow);
            margin-bottom: 20px;
        }

        .dashboard-section-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 15px;
            color: var(--text-main);
        }

        .dashboard-recent-tasks {
            background: var(--bg-panel);
            padding: 25px;
            border-radius: 12px;
            box-shadow: var(--shadow);
        }

        .recent-task-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid var(--border-light);
        }

        .recent-task-item:last-child {
            border-bottom: none;
        }

        .task-title {
            font-weight: 500;
        }

        .task-status {
            font-size: 11px;
            padding: 4px 8px;
            border-radius: 12px;
        }

        /* Enhanced Dashboard Styles */
        .dashboard-filters {
            display: flex;
            gap: 10px;
            margin-bottom: 4px;
            flex-wrap: wrap;
        }

        .dashboard-filter-btn {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            color: var(--text-muted);
            padding: 8px 16px;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.2s ease;
        }

        .dashboard-filter-btn:hover {
            border-color: var(--brand-red);
            color: var(--brand-red);
        }

        .dashboard-filter-btn.active {
            background: var(--brand-red);
            color: white;
            border-color: var(--brand-red);
        }

        /* Dashboard role + action chips (Phase 1) */
        .dashboard-toolbar {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 8px;
        }

        .dashboard-role-seg {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 6px;
        }

        .dashboard-role-btn {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            color: var(--text-muted);
            padding: 6px 14px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
            transition: all 0.2s ease;
        }

        .dashboard-role-btn:hover {
            border-color: var(--brand-red);
            color: var(--brand-red);
        }

        .dashboard-role-btn.active {
            background: var(--brand-red);
            color: #fff;
            border-color: var(--brand-red);
        }

        .dashboard-template-type-btn {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            color: var(--text-muted);
            padding: 6px 12px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 11px;
            font-weight: 600;
            transition: all 0.2s ease;
        }

        .dashboard-template-type-btn:hover {
            border-color: var(--brand-primary);
            color: var(--brand-primary);
        }

        .dashboard-template-type-btn.active {
            background: var(--brand-primary);
            color: #fff;
            border-color: var(--brand-primary);
        }

        .dashboard-template-exclusive {
            margin-bottom: 22px;
        }

        .dash-portfolio-ws-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 12px;
            margin-top: 12px;
        }

        .dash-portfolio-ws-card {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 12px 14px;
            cursor: pointer;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }

        .dash-portfolio-ws-card:hover {
            border-color: var(--brand-primary);
            box-shadow: var(--shadow-sm);
        }

        .dash-portfolio-ws-name {
            font-weight: 700;
            font-size: 13px;
            color: var(--text-main);
            margin-bottom: 8px;
        }

        .dash-portfolio-ws-meta {
            font-size: 11px;
            color: var(--text-muted);
            line-height: 1.5;
        }

        /* ClickUp-style customizable widget board */
        .dashboard-widgets-embed {
            margin-top: 28px;
            padding-top: 24px;
            border-top: 1px solid rgba(15, 23, 42, 0.08);
        }

        .dash-widgets-toolbar {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 16px;
            padding: 12px 14px;
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 12px;
        }

        .dash-widgets-hint {
            font-size: 12px;
            color: var(--text-muted);
            max-width: 420px;
            line-height: 1.4;
        }

        .dash-widgets-grid {
            display: grid;
            grid-template-columns: repeat(12, 1fr);
            gap: 16px;
            grid-auto-rows: minmax(100px, auto);
            align-items: stretch;
        }

        .dash-widget {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 12px;
            box-shadow: var(--shadow-sm);
            min-height: 120px;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
            border-top: 3px solid var(--widget-accent, var(--border));
        }

        .dash-widget:hover {
            box-shadow: var(--shadow-md);
            border-color: var(--widget-accent, var(--border));
        }

        .dash-widget.drag-over {
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 2px var(--brand-primary-light);
        }

        .dash-widgets-empty-zone {
            grid-column: 1 / -1;
            min-height: 420px;
            border: 2px dashed var(--border);
            border-radius: 16px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0;
            padding: 40px 28px;
            text-align: center;
            background: var(--bg-panel);
            color: var(--text-muted);
            font-size: 13px;
            transition: border-color 0.2s ease, background 0.2s ease;
        }

        .dash-widgets-empty-zone.drag-over {
            border-color: var(--brand-primary);
            background: var(--brand-primary-light);
        }

        .dash-widgets-empty-zone strong {
            color: var(--text-main);
            font-size: 15px;
        }
        .dash-empty-hero-icon { width: 64px; height: 64px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 18px; }
        .dash-empty-title { font-size: 20px; font-weight: 800; color: var(--text-main); margin-bottom: 6px; }
        .dash-empty-desc { font-size: 13px; color: var(--text-muted); max-width: 480px; line-height: 1.6; margin-bottom: 24px; }
        .dash-empty-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 28px; }
        .dash-empty-add-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; border: none; color: #fff; background: var(--brand-primary); transition: background .15s, transform .15s; }
        .dash-empty-add-btn:hover { background: var(--brand-primary-dark); transform: translateY(-1px); }
        .dash-empty-quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; width: 100%; max-width: 600px; }
        .dash-empty-quick-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; border-radius: 10px; cursor: pointer; border: 1px solid var(--border); background: var(--bg-app); transition: border-color .15s, transform .15s, box-shadow .15s; font-size: 11px; font-weight: 600; color: var(--text-secondary); }
        .dash-empty-quick-card:hover { border-color: var(--brand-primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }

        .dash-widget-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 10px 14px;
            background: var(--bg-panel);
            border-bottom: 1px solid var(--border);
            flex-shrink: 0;
        }

        .dash-widget-grip {
            cursor: grab;
            color: var(--text-secondary);
            padding: 4px 8px;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            font-weight: 700;
            user-select: none;
            flex: 1;
            min-width: 0;
        }

        .dash-widget-grip:active {
            cursor: grabbing;
        }

        .dash-widget-controls {
            position: relative;
            display: flex;
            align-items: center;
        }

        .dash-widget-controls .dwc-trigger {
            background: none;
            border: none;
            padding: 4px 6px;
            cursor: pointer;
            color: var(--text-muted);
            font-size: 14px;
            border-radius: 6px;
            transition: background 0.15s, color 0.15s;
            opacity: 0;
        }

        .dash-widget:hover .dwc-trigger { opacity: 1; }

        .dwc-trigger:hover {
            background: var(--bg-secondary, #f3f4f6);
            color: var(--text-main);
        }

        .dwc-dropdown {
            display: none;
            position: absolute;
            top: 100%;
            right: 0;
            z-index: 200;
            background: var(--bg-panel, #fff);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 6px 0;
            min-width: 160px;
            box-shadow: 0 8px 24px rgba(0,0,0,.12);
        }

        .dwc-dropdown.open { display: block; }

        .dwc-dropdown button {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            background: none;
            border: none;
            padding: 8px 14px;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            color: var(--text-secondary);
            text-align: left;
            transition: background 0.12s, color 0.12s;
        }

        .dwc-dropdown button i { width: 14px; text-align: center; font-size: 11px; }

        .dwc-dropdown button:hover {
            background: var(--bg-secondary, #f3f4f6);
            color: var(--text-main);
        }

        .dwc-dropdown .dwc-sep {
            height: 1px;
            background: var(--border);
            margin: 4px 0;
        }

        .dwc-dropdown button.dwc-danger { color: var(--brand-red, #ef4444); }
        .dwc-dropdown button.dwc-danger:hover { background: #fef2f2; }

        .dash-widget-body {
            padding: 14px 16px;
            flex: 1;
            min-height: 0;
            overflow: auto;
        }

        .dash-add-cards-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 12px;
            max-height: 60vh;
            overflow-y: auto;
            padding: 4px;
        }

        .dash-add-card-option {
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 14px;
            cursor: pointer;
            text-align: left;
            background: var(--bg-panel);
            transition: border-color 0.15s ease, background 0.15s ease;
        }

        .dash-add-card-option:hover {
            border-color: var(--brand-primary);
            background: var(--brand-primary-light);
        }

        .dash-add-card-option .icon {
            font-size: 22px;
            margin-bottom: 8px;
            color: var(--brand-primary);
        }

        .dash-add-card-option .title {
            font-weight: 700;
            font-size: 13px;
            color: var(--text-main);
        }

        .dash-add-card-option .desc {
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 4px;
            line-height: 1.35;
        }

        .dash-ai-collapse-wrap { position: relative; overflow: hidden; transition: max-height .4s ease; }
        .dash-ai-collapse-wrap.collapsed { max-height: 320px; }
        .dash-ai-collapse-wrap.collapsed::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 80px; background: linear-gradient(to bottom, transparent, var(--bg-panel, #fff)); pointer-events: none; }
        .dash-ai-toggle-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 10px 0; margin-top: 4px; border: none; border-top: 1px solid var(--border); background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--brand-primary); transition: color .15s; }
        .dash-ai-toggle-btn:hover { color: var(--brand-primary-dark); }
        .dash-ai-toggle-btn i { font-size: 10px; transition: transform .3s; }
        .dash-ai-toggle-btn.expanded i { transform: rotate(180deg); }

        .dash-ai-prose {
            font-size: 13px;
            line-height: 1.65;
            color: var(--text-main);
        }
        .dash-ai-prose .ai-section { margin-bottom: 18px; }
        .dash-ai-prose .ai-section:last-child { margin-bottom: 0; }
        .dash-ai-prose h2 { font-size: 16px; font-weight: 700; color: var(--text-main); margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--border); }
        .dash-ai-prose h3 { font-size: 14px; font-weight: 700; color: var(--text-main); margin: 14px 0 8px; }
        .dash-ai-prose h4 { font-size: 13px; font-weight: 700; color: var(--text-secondary); margin: 10px 0 6px; text-transform: uppercase; letter-spacing: 0.5px; }
        .dash-ai-prose p { margin: 4px 0; font-size: 13px; line-height: 1.65; }
        .dash-ai-prose ul, .dash-ai-prose ol { margin: 4px 0 8px 0; padding-left: 20px; font-size: 13px; line-height: 1.7; }
        .dash-ai-prose li { margin-bottom: 3px; }
        .dash-ai-prose strong { font-weight: 700; }
        .dash-ai-prose em { font-style: italic; color: var(--text-muted); }
        .dash-ai-prose blockquote { margin: 8px 0; padding: 8px 14px; border-left: 3px solid var(--brand-primary); background: var(--bg-panel); border-radius: 4px; font-size: 12px; color: var(--text-secondary); }
        .dash-ai-prose hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
        .dash-ai-prose table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 12px; }
        .dash-ai-prose th { text-align: left; padding: 8px 10px; background: var(--bg-panel); border-bottom: 2px solid var(--border); font-weight: 700; color: var(--text-main); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
        .dash-ai-prose td { padding: 7px 10px; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
        .dash-ai-prose tr:last-child td { border-bottom: none; }
        .dash-ai-prose .ai-metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 10px 0 14px; }
        .dash-ai-prose .ai-metric-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; padding: 12px; text-align: center; }
        .dash-ai-prose .ai-metric-card .ai-metric-val { font-size: 22px; font-weight: 800; line-height: 1.2; }
        .dash-ai-prose .ai-metric-card .ai-metric-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-top: 4px; }
        .dash-ai-prose .ai-health-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
        .dash-ai-prose .ai-health-good { background: rgba(16,185,129,.12); color: #059669; }
        .dash-ai-prose .ai-health-warn { background: rgba(245,158,11,.12); color: #d97706; }
        .dash-ai-prose .ai-health-bad { background: rgba(239,68,68,.12); color: #dc2626; }
        .dash-ai-prose .ai-risk-item { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 6px; margin-bottom: 6px; font-size: 12px; line-height: 1.5; }
        .dash-ai-prose .ai-risk-high { background: rgba(239,68,68,.06); border-left: 3px solid #ef4444; }
        .dash-ai-prose .ai-risk-med { background: rgba(245,158,11,.06); border-left: 3px solid #f59e0b; }
        .dash-ai-prose .ai-risk-low { background: rgba(59,130,246,.06); border-left: 3px solid #3b82f6; }
        .dash-ai-prose .ai-progress-bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; margin: 4px 0 2px; }
        .dash-ai-prose .ai-progress-fill { height: 100%; border-radius: 4px; transition: width .3s ease; }

        .dashboard-action-chips {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px;
            margin-bottom: 12px;
        }

        .dashboard-chip-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: var(--bg-panel);
            border: 1px solid var(--border);
            color: var(--text-main);
            padding: 6px 12px;
            border-radius: 999px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
            transition: all 0.2s ease;
        }

        .dashboard-chip-btn:hover {
            border-color: var(--brand-red);
            color: var(--brand-red);
        }

        .dashboard-chip-btn .chip-count {
            background: var(--bg-app);
            color: var(--text-muted);
            border-radius: 999px;
            padding: 2px 8px;
            font-size: 11px;
            font-weight: 700;
        }

        .dashboard-my-work {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 16px 18px;
            margin-bottom: 20px;
            box-shadow: var(--shadow-sm);
        }

        .dashboard-my-work-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
            margin-bottom: 12px;
        }

        .my-work-item {
            padding: 10px 12px;
            border-radius: 8px;
            border: 1px solid var(--border);
            margin-bottom: 8px;
            cursor: pointer;
            transition: background 0.15s ease;
        }

        .my-work-item:hover {
            background: var(--brand-primary-light);
        }

        .my-work-item-title {
            font-weight: 600;
            font-size: 13px;
            color: var(--text-main);
        }

        .my-work-item-meta {
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 4px;
        }

        #view-dashboard.dashboard-role-executive .hide-on-executive {
            display: none !important;
        }

        #view-dashboard.dashboard-role-member .hide-on-member {
            display: none !important;
        }

        /* Phase 3: Dependency risk + team capacity */
        .dashboard-phase3-wrap {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-bottom: 24px;
        }

        @media (max-width: 960px) {
            .dashboard-phase3-wrap {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 640px) {
            .phase3-dep-cols {
                grid-template-columns: 1fr !important;
            }
        }

        .dashboard-phase3-panel {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 16px 18px;
            box-shadow: var(--shadow-sm);
            min-width: 0;
        }

        .dashboard-phase3-sub {
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--text-muted);
            margin-bottom: 10px;
        }

        .phase3-mini-row {
            padding: 8px 10px;
            border-radius: 8px;
            border: 1px solid var(--border);
            margin-bottom: 8px;
            cursor: pointer;
            transition: background 0.15s ease;
            font-size: 13px;
        }

        .phase3-mini-row:hover {
            background: var(--brand-primary-light);
        }

        .phase3-mini-title {
            font-weight: 600;
            color: var(--text-main);
        }

        .phase3-mini-meta {
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 4px;
        }

        .phase3-capacity-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
        }

        .phase3-capacity-name {
            flex: 0 0 120px;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-main);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .phase3-capacity-track {
            flex: 1;
            height: 8px;
            background: var(--bg-app);
            border-radius: 999px;
            overflow: hidden;
            border: 1px solid var(--border);
        }

        .phase3-capacity-fill {
            height: 100%;
            border-radius: 999px;
            transition: width 0.2s ease;
        }

        .phase3-capacity-count {
            flex: 0 0 52px;
            text-align: right;
            font-size: 12px;
            font-weight: 700;
            color: var(--text-muted);
        }

        .phase3-capacity-badge {
            flex: 0 0 auto;
            font-size: 10px;
            font-weight: 700;
            padding: 2px 8px;
            border-radius: 999px;
            text-transform: uppercase;
        }

        .phase3-capacity-badge.ok {
            background: #DCFCE7;
            color: #166534;
        }

        .phase3-capacity-badge.warn {
            background: #FEF3C7;
            color: #92400E;
        }

        .phase3-capacity-badge.hot {
            background: #FEE2E2;
            color: #991B1B;
        }

        .dashboard-quick-actions {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 15px;
            margin-bottom: 25px;
        }

        .quick-action-card {
            background: var(--bg-panel);
            padding: 20px;
            border-radius: 12px;
            box-shadow: var(--shadow);
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
            border-left: 4px solid transparent;
        }

        .quick-action-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        .quick-action-card.overdue {
            border-left-color: #EF4444;
        }

        .quick-action-card.high-priority {
            border-left-color: #F59E0B;
        }

        .quick-action-card.in-progress {
            border-left-color: #10B981;
        }

        .quick-action-card.due-today {
            border-left-color: #3B82F6;
        }

        .quick-action-icon {
            font-size: 24px;
            margin-bottom: 10px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .quick-action-card.overdue .quick-action-icon {
            background: #FEE2E2;
            color: #EF4444;
        }

        .quick-action-card.high-priority .quick-action-icon {
            background: #FEF3C7;
            color: #F59E0B;
        }

        .quick-action-card.in-progress .quick-action-icon {
            background: #D1FAE5;
            color: #10B981;
        }

        .quick-action-card.due-today .quick-action-icon {
            background: #DBEAFE;
            color: #3B82F6;
        }

        .quick-action-title {
            font-weight: 600;
            font-size: 14px;
            margin-bottom: 5px;
        }

        .quick-action-count {
            font-size: 24px;
            font-weight: 700;
        }

        .quick-action-card.overdue .quick-action-count {
            color: #EF4444;
        }

        .quick-action-card.high-priority .quick-action-count {
            color: #F59E0B;
        }

        .quick-action-card.in-progress .quick-action-count {
            color: #10B981;
        }

        .quick-action-card.due-today .quick-action-count {
            color: #3B82F6;
        }

        /* Chat conversations (team chat + private messages) */
        .chat-conv-list {
            width: 220px;
            flex-shrink: 0;
            border-right: 1px solid var(--border);
            overflow-y: auto;
            background: var(--bg-panel, #fff);
            padding: 8px 0;
        }
        .chat-conv-main {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-width: 0;
            min-height: 0;
            overflow: hidden;
        }
        .chat-conv-section {
            padding: 10px 14px 4px;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            color: var(--text-muted);
        }
        .chat-conv-item {
            display: flex;
            align-items: center;
            gap: 8px;
            width: 100%;
            padding: 8px 14px;
            border: none;
            background: transparent;
            color: var(--text-main);
            font-size: 13px;
            text-align: left;
            cursor: pointer;
        }
        .chat-conv-item:hover { background: var(--bg-hover, #f3f4f6); }
        .chat-conv-item.active { background: color-mix(in srgb, var(--brand-primary) 12%, transparent); font-weight: 600; }
        .chat-conv-item .chat-conv-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .chat-conv-item .chat-conv-badge {
            background: #EF4444;
            color: #fff;
            border-radius: 10px;
            padding: 1px 7px;
            font-size: 11px;
            font-weight: 700;
        }
        .chat-conv-item.unread .chat-conv-name { font-weight: 700; }
        @media (max-width: 720px) {
            #inbox-pane-chat { flex-direction: column !important; }
            .chat-conv-list {
                width: auto;
                display: flex;
                overflow-x: auto;
                overflow-y: hidden;
                border-right: none;
                border-bottom: 1px solid var(--border);
                padding: 6px;
                gap: 4px;
            }
            .chat-conv-section { display: none; }
            .chat-conv-item { width: auto; flex-shrink: 0; border-radius: 16px; padding: 6px 12px; }
            .chat-conv-item .chat-conv-name { max-width: 140px; }
        }

        /* Chat member tagging */
        .chat-member-tag {
            background: #DBEAFE;
            color: #1D4ED8;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: 500;
            display: inline-block;
            margin: 0 2px;
        }

        .chat-member-selector {
            position: relative;
            display: inline-block;
        }

        .chat-member-dropdown {
            position: absolute;
            bottom: 100%;
            left: 0;
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 8px;
            box-shadow: var(--shadow-lg);
            width: 200px;
            max-height: 150px;
            overflow-y: auto;
            z-index: 1000;
            display: none;
        }

        .chat-member-dropdown.show {
            display: block;
        }

        .chat-member-item {
            padding: 8px 12px;
            cursor: pointer;
            font-size: 13px;
            transition: all 0.2s ease;
        }

        .chat-member-item:hover {
            background: var(--brand-red-light);
            color: var(--brand-red);
        }

        .chat-tag-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 8px;
            border-radius: 6px;
            transition: all 0.2s ease;
        }

        .chat-tag-btn:hover {
            background: var(--brand-red-light);
            color: var(--brand-red);
        }

        /* IMPROVED DASHBOARD STYLES */
        .dashboard-grid {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 20px;
            margin-bottom: 20px;
        }

        .dashboard-main {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .dashboard-sidebar {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .completion-progress {
            background: var(--bg-panel);
            padding: 20px;
            border-radius: 12px;
            box-shadow: var(--shadow);
        }

        .progress-bar {
            height: 8px;
            background: var(--bg-app);
            border-radius: 4px;
            overflow: hidden;
            margin: 15px 0;
        }

        .progress-fill {
            height: 100%;
            background: var(--brand-red);
            border-radius: 4px;
            transition: width 0.5s ease;
        }

        .progress-stats {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: var(--text-muted);
        }

        .priority-distribution {
            background: var(--bg-panel);
            padding: 20px;
            border-radius: 12px;
            box-shadow: var(--shadow);
        }

        .priority-bar {
            display: flex;
            align-items: center;
            margin-bottom: 12px;
        }

        .priority-label {
            width: 100px;
            font-size: 12px;
            font-weight: 600;
        }

        .priority-bar-fill {
            height: 20px;
            border-radius: 4px;
            margin: 0 10px;
            transition: width 0.5s ease;
        }

        .priority-count {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-muted);
        }

        .upcoming-tasks {
            background: var(--bg-panel);
            padding: 20px;
            border-radius: 12px;
            box-shadow: var(--shadow);
        }

        .upcoming-task-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 0;
            border-bottom: 1px solid var(--border-light);
        }

        .upcoming-task-item:last-child {
            border-bottom: none;
        }

        .upcoming-task-title {
            font-size: 13px;
            font-weight: 500;
            flex: 1;
        }

        .upcoming-task-date {
            font-size: 11px;
            color: var(--text-muted);
            margin-left: 10px;
        }

        .workspace-stats {
            background: var(--bg-panel);
            padding: 20px;
            border-radius: 12px;
            box-shadow: var(--shadow);
        }

        .workspace-stat-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 0;
            border-bottom: 1px solid var(--border-light);
        }

        .workspace-stat-item:last-child {
            border-bottom: none;
        }

        .workspace-name {
            font-size: 13px;
            font-weight: 500;
        }

        .workspace-count {
            font-size: 13px;
            font-weight: 600;
            color: var(--brand-red);
        }

        .dashboard-tabs {
            display: flex;
            gap: 6px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .dashboard-tab {
            background: var(--bg-panel, #fff);
            border: 1px solid rgba(15, 23, 42, 0.08);
            color: #64748b;
            padding: 10px 18px;
            border-radius: 10px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
        }

        .dashboard-tab:hover {
            border-color: rgba(15, 23, 42, 0.14);
            color: #0f172a;
            background: #fafafa;
        }

        .dashboard-tab.active {
            background: #fff;
            color: #0f172a;
            border: 1px solid rgba(15, 23, 42, 0.22);
            font-weight: 600;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 0 0 3px rgba(99, 102, 241, 0.12);
        }

        /* ClickUp-style control card: VIEW AS / TYPE / PERIOD / SHORTCUTS */
        .dashboard-control-panel {
            background: var(--bg-panel, #fff);
            border: 1px solid rgba(15, 23, 42, 0.08);
            border-radius: 16px;
            padding: 6px 20px 16px;
            margin-bottom: 0;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 28px rgba(15, 23, 42, 0.06);
        }

        .dashboard-control-row {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 12px 20px;
            padding: 14px 0;
            border-bottom: 1px solid rgba(15, 23, 42, 0.06);
        }

        .dashboard-control-row:last-child {
            border-bottom: none;
            padding-bottom: 8px;
        }

        .dashboard-control-row-top {
            justify-content: space-between;
            align-items: flex-start;
        }

        .dashboard-control-row-top .dashboard-control-left {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 20px 28px;
            flex: 1;
            min-width: 0;
        }

        .dashboard-control-group {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 10px;
        }

        .dashboard-control-label {
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.07em;
            text-transform: uppercase;
            color: #94a3b8;
            min-width: max-content;
        }

        .dashboard-control-pills {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px;
        }

        .dashboard-layout-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            flex-shrink: 0;
        }

        .dashboard-layout-action-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: var(--bg-panel, #fff);
            border: 1px solid var(--border);
            color: var(--text-secondary);
            padding: 7px 14px;
            border-radius: 10px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
            transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
        }

        .dashboard-layout-action-btn:hover {
            border-color: rgba(211, 16, 39, 0.32);
            color: var(--brand-primary);
            background: #fff5f6;
        }

        #dashboard-control-panel .dashboard-template-type-btn,
        #dashboard-control-panel .dashboard-period-btn {
            background: #fafafa;
            border: 1px solid rgba(15, 23, 42, 0.08);
            color: #475569;
            font-weight: 600;
        }

        #dashboard-control-panel .dashboard-template-type-btn:hover,
        #dashboard-control-panel .dashboard-period-btn:hover {
            border-color: rgba(15, 23, 42, 0.14);
            color: #0f172a;
            background: #fff;
        }

        #dashboard-control-panel .dashboard-template-type-btn.active,
        #dashboard-control-panel .dashboard-period-btn.active {
            background: #fff1f2;
            border-color: #fecdd3;
            color: #9f1239;
            box-shadow: 0 1px 2px rgba(211, 16, 39, 0.08);
        }

        #dashboard-control-panel .dashboard-period-btn {
            padding: 8px 14px;
            border-radius: 10px;
            cursor: pointer;
            font-size: 13px;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: all 0.2s ease;
        }

        #dashboard-control-panel .dashboard-shortcuts-row {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px;
            flex: 1;
            min-width: 0;
        }

        #dashboard-control-panel .dashboard-chip-btn {
            background: var(--bg-panel, #fff);
            border: 1px solid var(--border);
            border-radius: 999px;
            padding: 7px 12px;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-main);
        }

        #dashboard-control-panel .dashboard-chip-btn:hover {
            border-color: rgba(99, 102, 241, 0.35);
            color: #4338ca;
            background: #fafaff;
        }

        #dashboard-control-panel .dashboard-chip-btn .chip-count {
            background: #f1f5f9;
            color: #64748b;
            font-variant-numeric: tabular-nums;
        }

        .dashboard-control-row-period .dashboard-control-group {
            width: 100%;
            align-items: flex-start;
        }

        @media (max-width: 720px) {
            .dashboard-control-row-top {
                flex-direction: column;
            }

            .dashboard-layout-actions {
                width: 100%;
            }
        }

        /* Dashboard step 1 (configuration) → step 2 (metrics & widgets) */
        .dashboard-setup-layer {
            margin-bottom: 12px;
        }

        .dashboard-setup-footer {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
            margin-top: 20px;
            align-items: stretch;
        }

        @media (max-width: 900px) {
            .dashboard-setup-footer {
                grid-template-columns: 1fr;
            }
        }

        .dashboard-setup-card {
            background: var(--bg-panel, #fff);
            border: 1px solid rgba(15, 23, 42, 0.08);
            border-radius: 16px;
            padding: 22px 24px;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
            text-align: left;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .dashboard-setup-card--accent {
            background: linear-gradient(165deg, #fff7f8 0%, #fff 48%);
            border-color: rgba(211, 16, 39, 0.20);
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 32px rgba(211, 16, 39, 0.10);
        }

        .dashboard-setup-card-kicker {
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: #94a3b8;
        }

        .dashboard-setup-card-title {
            margin: 0;
            font-size: 17px;
            font-weight: 700;
            color: #0f172a;
            letter-spacing: -0.02em;
        }

        .dashboard-setup-card-desc {
            margin: 0;
            font-size: 13px;
            line-height: 1.55;
            color: #64748b;
        }

        .dashboard-setup-card-bullets {
            margin: 4px 0 8px;
            padding-left: 18px;
            font-size: 12px;
            line-height: 1.65;
            color: #64748b;
        }

        .dashboard-setup-card-actions {
            margin-top: auto;
            padding-top: 8px;
        }

        .dashboard-open-main-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 11px 22px;
            border-radius: 10px;
            border: none;
            cursor: pointer;
            font-size: 13px;
            font-weight: 600;
            color: #fff;
            background: #0f172a;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
            transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
        }

        .dashboard-open-main-btn:hover {
            transform: translateY(-1px);
            background: #1e293b;
            box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
        }

        .dashboard-open-main-btn--indigo {
            background: var(--brand-primary);
            box-shadow: 0 1px 2px rgba(211, 16, 39, 0.22);
        }

        .dashboard-open-main-btn--indigo:hover {
            background: var(--brand-primary-dark);
            box-shadow: 0 4px 18px rgba(211, 16, 39, 0.35);
        }

        .dashboard-setup-footnote {
            margin: 14px 0 0;
            font-size: 12px;
            color: #94a3b8;
            text-align: center;
            line-height: 1.5;
            max-width: 640px;
            margin-left: auto;
            margin-right: auto;
        }

        /* ── Saved Dashboards Gallery ── */
        .saved-dash-section { margin-top: 28px; }
        .saved-dash-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
        .saved-dash-section-title { font-size: 15px; font-weight: 800; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
        .saved-dash-section-title i { color: var(--brand-primary); font-size: 13px; }
        .saved-dash-section-count { font-size: 11px; font-weight: 600; color: var(--text-muted); background: var(--bg-app); border-radius: 20px; padding: 2px 10px; }
        .saved-dash-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
        .saved-dash-card { position: relative; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; display: flex; flex-direction: column; gap: 8px; }
        .saved-dash-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand-primary); }
        .saved-dash-card-name { font-size: 14px; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .saved-dash-card-meta { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
        .saved-dash-card-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
        .saved-dash-card-badge--team { background: #dbeafe; color: #2563eb; }
        .saved-dash-card-badge--private { background: #fef3c7; color: #d97706; }
        .saved-dash-card-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
        .saved-dash-card:hover .saved-dash-card-actions { opacity: 1; }
        .saved-dash-card-actions button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-panel); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-muted); transition: color .15s, border-color .15s; }
        .saved-dash-card-actions button:hover { color: var(--brand-primary); border-color: var(--brand-primary); }
        .saved-dash-card-actions button.saved-dash-delete:hover { color: #ef4444; border-color: #ef4444; }
        .saved-dash-empty { text-align: center; padding: 24px 16px; color: var(--text-muted); font-size: 13px; border: 2px dashed var(--border); border-radius: 14px; background: var(--bg-app); }

        /* ── Save Dashboard Modal ── */
        .save-dash-modal-body { padding: 28px 32px; max-width: 440px; width: 90vw; background: var(--bg-panel); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); position: relative; }
        .save-dash-modal-body h3 { margin: 0 0 18px; font-size: 18px; font-weight: 800; color: var(--text-main); }
        .save-dash-field { margin-bottom: 16px; }
        .save-dash-field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
        .save-dash-field input[type="text"] { width: 100%; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-app); font-size: 13px; font-weight: 600; color: var(--text-main); outline: none; transition: border-color .15s; box-sizing: border-box; }
        .save-dash-field input[type="text"]:focus { border-color: var(--brand-primary); }
        .save-dash-visibility { display: flex; gap: 10px; }
        .save-dash-vis-option { flex: 1; padding: 12px 14px; border-radius: 10px; border: 2px solid var(--border); background: var(--bg-app); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
        .save-dash-vis-option:hover { border-color: var(--brand-primary); }
        .save-dash-vis-option.active { border-color: var(--brand-primary); background: var(--brand-primary-light); }
        .save-dash-vis-option i { font-size: 18px; display: block; margin-bottom: 6px; color: var(--brand-primary); }
        .save-dash-vis-option .vis-label { font-size: 12px; font-weight: 700; color: var(--text-main); }
        .save-dash-vis-option .vis-desc { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
        .save-dash-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
        .save-dash-modal-actions button { padding: 10px 20px; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; border: none; transition: background .15s, transform .15s; }
        .save-dash-btn-cancel { background: var(--bg-app); color: var(--text-secondary); border: 1px solid var(--border) !important; }
        .save-dash-btn-cancel:hover { background: var(--border); }
        .save-dash-btn-save { background: var(--brand-primary); color: #fff; }
        .save-dash-btn-save:hover { transform: translateY(-1px); }
        .delete-dash-modal-body { padding: 26px 30px; max-width: 460px; width: 90vw; background: var(--bg-panel); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); border: 1px solid var(--border); }
        .delete-dash-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
        .delete-dash-icon { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: rgba(239,68,68,.12); color: #dc2626; font-size: 15px; }
        .delete-dash-title { margin: 0; font-size: 17px; font-weight: 800; color: var(--text-main); }
        .delete-dash-copy { margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
        .delete-dash-copy strong { color: var(--text-main); }
        .delete-dash-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
        .delete-dash-actions button { padding: 9px 18px; border-radius: 10px; border: none; font-size: 13px; font-weight: 700; cursor: pointer; }
        .delete-dash-cancel { background: var(--bg-app); color: var(--text-secondary); border: 1px solid var(--border) !important; }
        .delete-dash-confirm { background: #dc2626; color: #fff; }
        .delete-dash-confirm:hover { background: #b91c1c; }

        .dashboard-main-layer {
            padding-top: 4px;
        }

        .dashboard-back-to-setup-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 8px 14px;
            border-radius: 10px;
            border: 1px solid rgba(15, 23, 42, 0.1);
            background: var(--bg-panel, #fff);
            color: #475569;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
        }

        .dashboard-back-to-setup-btn:hover {
            border-color: rgba(99, 102, 241, 0.35);
            color: #4338ca;
            background: #fafaff;
        }

        .dash-refresh-btn { gap: 6px; }
        .dash-refresh-btn .fa-sync-alt { transition: transform .5s ease; }
        .dash-refresh-btn.spinning .fa-sync-alt { animation: dashSpin .8s linear infinite; }
        @keyframes dashSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
        .dash-last-sync { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 4px 10px; border-radius: 8px; background: var(--bg-app); border: 1px solid var(--border); white-space: nowrap; }
        .dash-last-sync i { font-size: 10px; color: var(--text-muted); }

        .empty-dashboard-message {
            text-align: center;
            padding: 40px 20px;
            color: var(--text-muted);
        }

        .empty-dashboard-message i {
            font-size: 48px;
            margin-bottom: 15px;
            color: var(--border);
        }

        .dashboard-welcome {
            background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-red-dark) 100%);
            color: white;
            padding: 25px;
            border-radius: 12px;
            box-shadow: var(--shadow-lg);
            margin-bottom: 20px;
        }

        .welcome-title {
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 8px;
        }

        .welcome-subtitle {
            font-size: 14px;
            opacity: 0.9;
            margin-bottom: 15px;
        }

        .welcome-stats {
            display: flex;
            gap: 20px;
        }

        .welcome-stat {
            display: flex;
            flex-direction: column;
        }

        .welcome-stat-value {
            font-size: 28px;
            font-weight: 700;
        }

        .welcome-stat-label {
            font-size: 12px;
            opacity: 0.8;
        }

        /* PDF Export Button */
        .pdf-export-btn {
            background: #DC2626;
            color: #ffffff;
            border: none;
            padding: 8px 16px;
            border-radius: 8px;
            font-weight: 600;
            font-size: 13px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.2s ease;
        }

        .pdf-export-btn:hover {
            background: #B91C1C;
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        /* Notification Panel Styles */
        .notification-panel {
            position: absolute;
            top: 100%;
            right: 0;
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 15px;
            box-shadow: var(--shadow-lg);
            z-index: 1000;
            width: 250px;
            display: none;
        }

        .notification-panel.show {
            display: block;
        }

        .notification-option {
            margin-bottom: 15px;
        }

        .notification-option label {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 13px;
            cursor: pointer;
            color: var(--text-main);
        }

        .notification-option input {
            width: auto;
            margin: 0;
        }

        .notification-section-title {
            font-size: 12px;
            font-weight: 700;
            color: var(--text-muted);
            margin-bottom: 10px;
            text-transform: uppercase;
        }

        /* =========================================== */
        /* NEW: COMMENTS & DEPENDENCIES STYLES */
        /* =========================================== */
        .section-card {
            background: var(--bg-app);
            padding: 20px;
            border-radius: 12px;
            border: 1px solid var(--border);
            margin-bottom: 15px;
        }

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

        .section-header h3,
        .section-header h4 {
            margin: 0;
            font-size: 14px;
            color: var(--text-main);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .btn-small {
            padding: 6px 12px;
            font-size: 12px;
            background: var(--brand-red);
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 5px;
            transition: all 0.2s ease;
        }

        .btn-small:hover {
            background: var(--brand-red-dark);
            transform: translateY(-1px);
        }

        .comment-item {
            padding: 12px;
            background: var(--bg-panel);
            border-radius: 8px;
            margin-bottom: 10px;
            border-left: 3px solid var(--border);
        }

        .comment-author {
            font-weight: 600;
            color: var(--brand-red);
        }

        .comment-time {
            color: var(--text-muted);
            font-size: 11px;
        }

        .comment-text {
            font-size: 13px;
            line-height: 1.5;
            margin-top: 5px;
        }

        .comment-avatar {
            width: 32px;
            height: 32px;
            background: var(--brand-red);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 12px;
            flex-shrink: 0;
        }

        .top-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            padding: 10px;
            background: var(--bg-panel);
            border-radius: 24px;
            border: 1px solid var(--border);
            transition: all 0.2s ease;
        }

        .dependency-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px;
            background: var(--bg-panel);
            border-radius: 8px;
            margin-bottom: 8px;
            border: 1px solid var(--border);
            transition: all 0.2s ease;
        }

        .dependency-item:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow);
        }

        .dependency-title {
            font-weight: 500;
            font-size: 13px;
            margin-bottom: 3px;
        }

        .dependency-type {
            font-size: 11px;
            color: var(--text-muted);
        }

        .dependency-status {
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 10px;
            display: inline-block;
            margin-left: 8px;
        }

        .dependency-remove {
            background: none;
            border: none;
            color: var(--brand-red);
            cursor: pointer;
            font-size: 14px;
            padding: 5px;
            border-radius: 4px;
            transition: all 0.2s ease;
        }

        .dependency-remove:hover {
            background: var(--brand-red-light);
        }

        /* Task dependency indicators */
        .dependency-indicator {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 11px;
            margin-left: 8px;
        }

        .is-blocked {
            border-left: 3px solid #EF4444 !important;
            background: rgba(239, 68, 68, 0.05) !important;
        }

        .blocks-others {
            border-left: 3px solid #F59E0B !important;
            background: rgba(245, 158, 11, 0.05) !important;
        }

        .dependency-selector {
            background: var(--bg-panel);
            padding: 15px;
            border-radius: 8px;
            border: 1px dashed var(--border);
            margin-top: 15px;
        }

        .empty-state {
            text-align: center;
            padding: 20px;
            color: var(--text-muted);
        }

        .empty-state i {
            font-size: 24px;
            margin-bottom: 10px;
            opacity: 0.5;
        }

        /* Modal layout for enhanced task view */
        .modal-columns {
            display: flex;
            gap: 20px;
            height: 100%;
        }

        .modal-left-column {
            flex: 3;
            display: flex;
            flex-direction: column;
            gap: 20px;
            overflow-y: auto;
        }

        .modal-right-column {
            flex: 2;
            display: flex;
            flex-direction: column;
            gap: 20px;
            min-width: 300px;
        }

        .comment-input-area textarea {
            width: 100%;
            padding: 10px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-panel);
            color: var(--text-main);
            font-family: inherit;
            resize: vertical;
            min-height: 60px;
        }

        /* Status indicators */
        .status-indicator {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            display: inline-block;
            margin-right: 6px;
        }

        .status-todo {
            background: #9CA3AF;
        }

        .status-inprogress {
            background: #F59E0B;
        }

        .status-done {
            background: #10B981;
        }

        /* Enhanced modal sizing - wider for 3 columns */
        .modal-large {
            width: 1200px;
            max-width: 98%;
            max-height: 85%;
        }

        /* 3-Column Grid Layout - Better organization */
        .modal-columns {
            display: grid;
            grid-template-columns: 1.3fr 1fr 1.3fr;
            gap: 16px;
            height: 100%;
        }

        /* Task modal (enhanced) — premium layout + density */
        #task-modal-enhanced {
            align-items: center;
            padding: 0;
        }

        #task-modal-enhanced .modal.modal-large {
            width: min(1240px, calc(100vw - 24px));
            height: calc(100vh - 28px);
            max-height: calc(100vh - 28px);
        }

        #task-modal-enhanced .modal-header {
            padding: 10px 12px;
        }

        #task-modal-enhanced #template-selector-bar {
            padding: 8px 12px !important;
        }

        /* Remove fixed inline height, let modal body fill */
        #task-modal-enhanced .modal-body {
            flex: 1;
            height: auto !important;
            padding: 10px !important;
            overflow: hidden;
            display: block !important; /* prevent global flex modal-body causing "extra column" */
        }

        #task-modal-enhanced .modal-columns {
            height: 100%;
            min-height: 0;
            gap: 12px;
            width: 100%;
        }

        /* Force 3-grid always for task modal */
        #task-modal-enhanced .modal-columns {
            grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.3fr) !important;
        }

        /* Column 1: Task Details + Dependencies */
        .modal-left-column {
            display: flex;
            flex-direction: column;
            gap: 20px;
            overflow-y: auto;
            padding-right: 8px;
        }

        /* Column 2: Task Properties + Actions */
        .modal-center-column {
            display: flex;
            flex-direction: column;
            gap: 16px;
            overflow-y: auto;
            padding-right: 8px;
        }

        /* Column 3: Comments & Activity */
        .modal-right-column {
            display: flex;
            flex-direction: column;
            gap: 16px;
            overflow-y: auto;
            padding-right: 8px;
        }

        /* Make columns scroll nicely without extra padding */
        #task-modal-enhanced .modal-left-column,
        #task-modal-enhanced .modal-center-column,
        #task-modal-enhanced .modal-right-column {
            min-height: 0;
            padding-right: 0;
            scrollbar-gutter: stable;
        }

        /* Section Cards - Enhanced Design */
        .section-card {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 20px;
            transition: all 0.2s;
        }

        #task-modal-enhanced .section-card {
            padding: 14px;
            border-radius: 14px;
        }

        #task-modal-enhanced .section-header {
            margin-bottom: 10px;
        }

        #task-modal-enhanced .section-header h3 {
            font-size: 13px;
        }

        /* Task modal title/textarea styling now lives in ui-base.css ("Task modal"). */

        .section-card:hover {
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }

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

        .section-header h3 {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-main);
            margin: 0;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .section-header h3 i {
            color: var(--brand-primary);
            font-size: 14px;
        }

        /* Enhanced Input Fields */
        .section-card input[type="text"],
        .section-card input[type="date"],
        .section-card select,
        .section-card textarea {
            width: 100%;
            padding: 12px 14px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-app);
            color: var(--text-main);
            font-family: inherit;
            font-size: 14px;
            transition: all 0.2s;
        }

        .section-card input[type="text"]:focus,
        .section-card input[type="date"]:focus,
        .section-card select:focus,
        .section-card textarea:focus {
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
            outline: none;
        }

        /* Property Field Icons */
        .property-field {
            position: relative;
        }

        .property-field label {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 8px;
        }

        .property-field label i {
            font-size: 11px;
            opacity: 0.7;
        }

        /* Status & Priority Badges */
        .badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            line-height: 1;
        }

        .badge-todo {
            background: #E5E7EB;
            color: #374151;
        }

        .badge-inprogress {
            background: #FEF3C7;
            color: #92400E;
        }

        .badge-done {
            background: #D1FAE5;
            color: #065F46;
        }

        .badge-high {
            background: #FEE2E2;
            color: #991B1B;
        }

        .badge-medium {
            background: #FEF3C7;
            color: #92400E;
        }

        .badge-low {
            background: #DBEAFE;
            color: #1E40AF;
        }

        /* Comments Enhancement */
        .comment-item {
            padding: 12px;
            background: var(--bg-app);
            border-radius: 10px;
            margin-bottom: 12px;
            border: 1px solid transparent;
            transition: all 0.2s;
        }

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

        .comment-avatar {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            background: var(--brand-primary);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 13px;
        }

        .comment-author {
            font-weight: 600;
            font-size: 13px;
            color: var(--text-main);
        }

        .comment-time {
            font-size: 11px;
            color: var(--text-muted);
        }

        .comment-text {
            font-size: 14px;
            color: var(--text-secondary);
            line-height: 1.5;
            margin-top: 6px;
        }

        .comment-input-area textarea {
            width: 100%;
            padding: 12px 14px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-panel);
            color: var(--text-main);
            font-family: inherit;
            resize: vertical;
            min-height: 80px;
            transition: all 0.2s;
        }

        .comment-input-area textarea:focus {
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        }

        /* Dependency Cards */
        .dependency-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            background: var(--bg-app);
            border-radius: 8px;
            border: 1px solid var(--border);
            margin-bottom: 8px;
            transition: all 0.2s;
        }

        .dependency-item:hover {
            border-color: var(--brand-primary);
            box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
        }

        .dependency-type-badge {
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .dependency-blocks {
            background: #FEE2E2;
            color: #991B1B;
        }

        .dependency-blocked-by {
            background: #FEF3C7;
            color: #92400E;
        }

        .dependency-related {
            background: #DBEAFE;
            color: #1E40AF;
        }

        /* Empty States */
        .empty-state {
            text-align: center;
            padding: 40px 20px;
            color: var(--text-muted);
        }

        .empty-state i {
            font-size: 48px;
            color: var(--border);
            margin-bottom: 16px;
        }


        /* NEW: PROFILE MODAL STYLES */
        .profile-modal {
            width: 400px;
            max-height: 90vh;
        }

        /* Remove forced tall bodies that create empty bottom space */
        #profile-modal .modal-body,
        #team-modal .modal-body {
            max-height: none !important;
            overflow: auto !important;
        }

        #profile-modal .modal.profile-modal,
        #team-modal .modal.modal-large {
            height: auto !important;
        }

        .profile-field {
            margin-bottom: 15px;
        }

        .profile-field label {
            display: block;
            margin-bottom: 5px;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-muted);
        }

        .profile-field input {
            width: 100%;
            padding: 10px;
            border: 1px solid var(--border);
            border-radius: 6px;
            background: var(--bg-app);
            color: var(--text-main);
        }

        .profile-field input:disabled {
            background: var(--bg-panel);
            color: var(--text-muted);
        }

        .password-strength {
            height: 4px;
            background: var(--bg-app);
            border-radius: 2px;
            margin-top: 5px;
            overflow: hidden;
        }

        .password-strength-fill {
            height: 100%;
            border-radius: 2px;
            transition: width 0.3s ease;
        }

        .password-strength-weak {
            background: #EF4444;
            width: 33%;
        }

        .password-strength-medium {
            background: #F59E0B;
            width: 66%;
        }

        .password-strength-strong {
            background: #10B981;
            width: 100%;
        }

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            display: none;
            /* Hidden by default */
            justify-content: center;
            align-items: center;
            z-index: 10000;
            backdrop-filter: blur(4px);
            transition: opacity 0.3s ease;
        }

        .modal-overlay.active {
            display: flex;
            /* Show when active */
        }

        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            backdrop-filter: blur(4px);
        }

        .modal-content {
            background: var(--surface-2);
            padding: 24px;
            border-radius: 16px;
            width: 90%;
            max-width: 500px;
            box-shadow: var(--shadow-xl);
            animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            border: 1px solid var(--border);
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--gridline-strong);
        }

        .modal-header h3 {
            margin: 0;
            font-size: 18px;
            font-weight: 900;
        }

        .close-btn {
            background: transparent;
            border: 1px solid transparent;
            font-size: 24px;
            cursor: pointer;
            color: var(--text-muted);
            border-radius: 10px;
            width: 36px;
            height: 36px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .close-btn:hover {
            background: var(--surface-3);
            border-color: var(--gridline-strong);
            color: var(--text-main);
        }

        .modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            margin-top: 24px;
        }

        @keyframes modalSlideIn {
            from {
                opacity: 0;
                transform: translateY(20px) scale(0.95);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .password-requirements {
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 5px;
        }

        .password-match {
            color: #10B981;
            font-size: 11px;
            margin-top: 5px;
        }

        .password-mismatch {
            color: #EF4444;
            font-size: 11px;
            margin-top: 5px;
        }

        .profile-section-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-main);
            margin: 15px 0 10px 0;
            padding-bottom: 5px;
            border-bottom: 1px solid var(--border);
        }

        /* =========================================== */
        /* PRODUCT VALIDATION DASHBOARD (COCKPIT) */
        /* =========================================== */
        .cockpit-container {
            display: flex;
            flex-direction: column;
            gap: 20px;
            padding-bottom: 40px;
        }

        .cockpit-zone {
            width: 100%;
        }

        /* ZONE A: NPI TRACKER */
        .npi-tracker {
            display: flex;
            background: var(--bg-panel);
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            border: 1px solid var(--border);
            padding: 4px;
            gap: 2px;
        }

        .npi-step {
            flex: 1;
            position: relative;
            padding: 16px 12px;
            background: var(--bg-app);
            color: var(--text-muted);
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            clip-path: polygon(0% 0%, 92% 0%, 100% 50%, 92% 100%, 0% 100%, 8% 50%);
            margin-right: -18px;
            z-index: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
        }

        .npi-step:first-child {
            clip-path: polygon(0% 0%, 92% 0%, 100% 50%, 92% 100%, 0% 100%);
            padding-left: 20px;
            margin-left: 0;
            border-top-left-radius: 12px;
            border-bottom-left-radius: 12px;
        }

        .npi-step:last-child {
            clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 8% 50%);
            margin-right: 0;
            padding-right: 20px;
            border-top-right-radius: 12px;
            border-bottom-right-radius: 12px;
        }

        .npi-step:hover {
            background: var(--bg-hover);
            transform: translateY(-1px);
        }

        .npi-step.completed {
            background: #10B981;
            color: white;
        }

        .npi-step.active {
            background: #3B82F6;
            color: white;
            z-index: 10;
            box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
            transform: scale(1.05);
        }

        .step-label {
            font-weight: 800;
            font-size: 15px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            line-height: 1.2;
        }

        .step-sub {
            font-size: 11px;
            opacity: 0.9;
            margin-top: 4px;
            font-weight: 500;
        }

        /* ZONE B: STABILITY MATRIX */
        .zone-b {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 24px;
        }

        .cockpit-card {
            background: var(--bg-panel);
            border-radius: 16px;
            border: 1px solid var(--border);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            transition: all 0.3s ease;
        }

        .cockpit-card:hover {
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
            border-color: var(--border-hover);
        }

        .card-header {
            padding: 15px 20px;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: var(--bg-app);
            border-radius: 12px 12px 0 0;
        }

        .card-header h3 {
            margin: 0;
            font-size: 14px;
            color: var(--text-main);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .card-body {
            padding: 20px;
            flex: 1;
        }

        /* Firmware Styles */
        .fw-status-badge {
            font-size: 11px;
            font-weight: 700;
            padding: 4px 8px;
            border-radius: 4px;
            background: var(--border);
            color: var(--text-muted);
        }

        .fw-status-badge.stable {
            background: #D1FAE5;
            color: #065F46;
        }

        .fw-status-badge.risk {
            background: #FEE2E2;
            color: #991B1B;
        }

        .fw-inputs {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-bottom: 20px;
        }

        .input-group label {
            display: block;
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            margin-bottom: 5px;
        }

        .input-group input {
            width: 100%;
            padding: 8px;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 13px;
        }

        .fw-metrics {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 10px;
        }

        .metric-box {
            background: var(--bg-app);
            padding: 10px;
            border-radius: 8px;
            text-align: center;
            border: 1px solid var(--border);
        }

        .metric-val {
            display: block;
            font-size: 20px;
            font-weight: 700;
            color: var(--text-main);
        }

        .metric-lbl {
            font-size: 10px;
            color: var(--text-muted);
            text-transform: uppercase;
        }

        .text-red {
            color: #EF4444;
        }

        .stability-input-wrapper {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 2px;
        }

        .stability-input-wrapper input {
            width: 40px;
            text-align: right;
            border: none;
            background: transparent;
            font-size: 20px;
            font-weight: 700;
            padding: 0;
        }

        /* Hardware Styles */
        .hw-list-header {
            display: grid;
            grid-template-columns: 2fr 2fr 3fr 1fr;
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            padding: 0 10px 8px 10px;
            border-bottom: 1px solid var(--border);
            margin-bottom: 10px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .hw-sample-list {
            max-height: 200px;
            overflow-y: auto;
            margin-bottom: 15px;
            padding-right: 4px;
        }

        .hw-sample-item {
            display: grid;
            grid-template-columns: 2fr 2fr 3fr 1fr;
            padding: 10px;
            border-bottom: 1px solid var(--border-light);
            font-size: 13px;
            align-items: center;
            border-radius: 6px;
            transition: background 0.2s ease;
        }

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

        .hw-status-select {
            padding: 4px 8px;
            font-size: 11px;
            border-radius: 4px;
            border: 1px solid var(--border);
            background: white;
            cursor: pointer;
        }

        .add-sample-btn {
            width: 100%;
            padding: 12px;
            background: var(--bg-app);
            border: 1px dashed var(--border);
            color: var(--text-muted);
            border-radius: 8px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .add-sample-btn:hover {
            background: var(--bg-panel);
            border-color: var(--brand-primary);
            color: var(--brand-primary);
        }



        /* ZONE C: GATEWAY */
        .gateway-card {
            background: var(--bg-panel);
            border-radius: 12px;
            border: 1px solid var(--border);
            box-shadow: var(--shadow);
        }

        .gateway-header {
            padding: 15px 20px;
            background: #1F2937;
            /* Dark header for gateway */
            color: white;
            border-radius: 12px 12px 0 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .gateway-header h3 {
            margin: 0;
            font-size: 14px;
            color: white;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .gateway-status {
            font-size: 11px;
            font-weight: 800;
            padding: 4px 8px;
            background: #374151;
            border-radius: 4px;
            letter-spacing: 1px;
        }

        .gateway-body {
            padding: 20px;
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 20px;
            align-items: start;
        }

        .checklist-item {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
            font-size: 13px;
        }

        .file-drop-zone {
            border: 2px dashed var(--border);
            border-radius: 8px;
            padding: 20px;
            text-align: center;
            color: var(--text-muted);
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        .file-drop-zone:hover {
            border-color: var(--brand-primary);
            background: var(--brand-primary-light);
        }

        .file-drop-zone.uploaded {
            border-color: #10B981;
            background: #D1FAE5;
            color: #065F46;
        }

        .btn-dispatch {
            width: 100%;
            height: 100%;
            background: #10B981;
            color: white;
            border: none;
            border-radius: 8px;
            font-weight: 700;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 20px;
        }

        .btn-dispatch:disabled {
            background: var(--border);
            color: var(--text-muted);
            cursor: not-allowed;
            opacity: 0.7;
        }

        .btn-dispatch:not(:disabled):hover {
            background: #059669;
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        /* CALENDAR VIEW STYLES */
        #view-calendar {
            padding: var(--s-6) !important;
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 16px;
            overflow: auto;
        }

        .calendar-header-controls {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 20px;
            margin-bottom: 20px;
        }

        .calendar-grid-header {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            text-align: center;
            font-weight: bold;
            margin-bottom: 10px;
            color: var(--text-muted);
        }

        .calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 0;
            grid-auto-rows: minmax(100px, auto);
            border: 1px solid var(--border);
            border-radius: 16px;
            overflow: hidden;
            background: var(--surface-2);
        }

        .calendar-day {
            background: transparent;
            border: none;
            border-right: 1px solid var(--gridline-strong);
            border-bottom: 1px solid var(--gridline-strong);
            padding: 10px;
            min-height: 100px;
            position: relative;
            transition: background 0.2s;
        }

        .calendar-day:hover {
            background: var(--surface-3);
        }

        .calendar-day.today {
            background: color-mix(in srgb, var(--brand-primary-light) 35%, transparent);
            outline: 2px solid color-mix(in srgb, var(--brand-primary) 40%, transparent);
            outline-offset: -2px;
        }

        .calendar-day-number {
            font-weight: bold;
            margin-bottom: 5px;
            color: var(--text-muted);
            font-size: 14px;
        }

        .calendar-task-chip {
            background: var(--surface-3);
            padding: 4px 6px;
            border-radius: 4px;
            font-size: 11px;
            margin-bottom: 4px;
            cursor: pointer;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            border-left: 3px solid var(--brand-primary);
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }

        /* NOTIFICATION CENTER STYLES */
        .notification-dropdown {
            position: absolute;
            top: 100%;
            right: 0;
            width: 320px;
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 14px;
            box-shadow: var(--shadow-xl);
            z-index: 2200;
            display: none;
            margin-top: 10px;
            overflow: hidden;
        }

        .notification-bell-container {
            position: relative;
            z-index: 2100;
        }

        .notification-dropdown.active {
            display: block;
            animation: slideDown 0.2s ease-out;
        }

        .dropdown-header {
            padding: 12px 15px;
            border-bottom: 1px solid var(--gridline-strong);
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: 900;
            font-size: 13px;
            background: var(--surface-1);
        }

        .notification-list {
            max-height: 350px;
            overflow-y: auto;
        }

        .notif-item {
            padding: 12px 15px;
            border-bottom: 1px solid var(--gridline);
            font-size: 13px;
            display: flex;
            gap: 12px;
            cursor: pointer;
            transition: background 0.2s;
            align-items: start;
        }

        .notif-item:hover {
            background: var(--surface-3);
        }

        .notif-item.unread {
            background: color-mix(in srgb, var(--info) 10%, transparent);
        }

        .notif-icon {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--icon-pill);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            flex-shrink: 0;
        }

        .notif-content {
            flex: 1;
        }

        .notif-time {
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 4px;
        }

        .badge-count {
            position: absolute;
            top: -5px;
            right: -5px;
            background: var(--brand-red);
            color: white;
            border-radius: 10px;
            padding: 2px 6px;
            font-size: 10px;
            font-weight: bold;
            border: 2px solid var(--bg-panel);
        }

        .mark-read-btn {
            background: none;
            border: none;
            color: var(--brand-primary);
            font-size: 11px;
            cursor: pointer;
            font-weight: 600;
        }

        .mark-read-btn:hover {
            text-decoration: underline;
        }

        /* KANBAN BOARD DRAG-AND-DROP STYLES */
        .board-card {
            cursor: move;
            user-select: none;
            transition: all 0.2s ease;
        }

        .board-card:hover {
            transform: scale(1.02);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .board-card.dragging {
            opacity: 0.5;
            transform: rotate(2deg);
        }

        .board-tasks.drag-over {
            background: var(--brand-primary-light);
            border: 2px dashed var(--brand-primary);
            border-radius: 8px;
        }

        .board-tasks {
            transition: all 0.2s ease;
            min-height: 100px;
            padding: 10px;
        }

        /* ============================================
           ENHANCED HOVER EFFECTS
           ============================================ */

        /* 1. TASK CARDS - Lift, Border Glow, Quick Actions */
        .board-card {
            position: relative;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            overflow: visible;
        }

        .board-card:hover {
            transform: translateY(-6px) scale(1.02);
            box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15), 0 0 0 2px var(--brand-primary-light);
        }

        .board-card::after {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: inherit;
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none;
            box-shadow: 0 0 20px var(--brand-primary);
        }

        .board-card:hover::after {
            opacity: 0.15;
        }

        /* Quick action buttons that appear on hover */
        .board-card .quick-actions {
            position: absolute;
            top: 8px;
            right: 8px;
            display: flex;
            gap: 4px;
            opacity: 0;
            transform: translateY(-5px);
            transition: all 0.2s ease;
        }

        .board-card:hover .quick-actions {
            opacity: 1;
            transform: translateY(0);
        }

        /* List view row hover */
        .list-table tbody tr {
            transition: background 0.25s ease;
        }

        .list-table tbody tr:hover {
            background: var(--surface-3);
        }

        .list-table tbody tr td:first-child {
            position: relative;
        }

        .list-table tbody tr td:first-child::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background: var(--brand-primary);
            transform: scaleY(0);
            transition: transform 0.2s ease;
            z-index: 1;
        }

        .list-table tbody tr:hover td:first-child::before {
            transform: scaleY(1);
        }

        /* 2. SIDEBAR ITEMS - Icon Animation, Background Sweep */
        .sidebar-item {
            position: relative;
            overflow: hidden;
            transition: all 0.3s ease;
        }

        .sidebar-item::before {
            content: '';
            position: absolute;
            left: -100%;
            top: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, var(--brand-primary-light), transparent);
            transition: left 0.5s ease;
        }

        .sidebar-item:hover::before {
            left: 100%;
        }

        .sidebar-item i {
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .sidebar-item:hover i {
            transform: scale(1.2) rotate(-5deg);
            color: var(--brand-primary);
        }

        .space-header {
            transition: all 0.2s ease;
        }

        .space-header:hover {
            padding-left: 20px;
        }

        .space-header:hover i {
            transform: scale(1.15);
        }

        /* 3. BUTTONS - Ripple Effect, Gradient Shift */
        .btn-primary,
        .login-btn {
            position: relative;
            overflow: hidden;
            transition: all 0.3s ease;
        }

        .btn-primary::before,
        .login-btn::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            background: rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            transition: width 0.6s ease, height 0.6s ease;
        }

        .btn-primary:hover::before,
        .login-btn:hover::before {
            width: 300px;
            height: 300px;
        }

        .btn-primary:hover,
        .login-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 10px 20px rgba(239, 68, 68, 0.3);
        }

        .btn-primary:active,
        .login-btn:active {
            transform: translateY(-1px) scale(0.98);
        }

        .btn-small {
            transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .btn-small:hover {
            transform: translateY(-2px) scale(1.05);
        }

        /* 4. STATUS PILLS - Pulse, Scale Bounce */
        .status-pill {
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            cursor: pointer;
        }

        .status-pill:hover {
            transform: scale(1.1);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .st-inprogress {
            animation: pulse-inprogress 2s ease-in-out infinite;
        }

        @keyframes pulse-inprogress {

            0%,
            100% {
                box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.4);
            }

            50% {
                box-shadow: 0 0 0 6px rgba(185, 28, 28, 0);
            }
        }

        .badge,
        .dependency-type-badge {
            transition: all 0.2s ease;
        }

        .badge:hover,
        .dependency-type-badge:hover {
            transform: scale(1.08);
            filter: brightness(1.1);
        }

        /* 5. FILTER DROPDOWNS - Underline Draw, Focus Effects */
        .filter-select {
            transition: all 0.3s ease;
            position: relative;
        }

        .filter-select:hover {
            border-color: var(--brand-primary);
            box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
        }

        .filter-select:focus {
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 3px var(--brand-primary-light), 0 4px 12px rgba(239, 68, 68, 0.2);
        }

        .filter-btn {
            transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .filter-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .search-box input {
            transition: all 0.3s ease;
        }

        .search-box input:focus {
            width: 280px;
            box-shadow: 0 0 0 3px var(--brand-primary-light), 0 4px 16px rgba(0, 0, 0, 0.1);
        }

        /* 6. DASHBOARD STAT CARDS - 3D Tilt, Hover Glow */
        .stat-card,
        .dashboard-stat-card,
        .quick-action-card {
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            transform-style: preserve-3d;
            perspective: 1000px;
        }

        .stat-card:hover,
        .dashboard-stat-card:hover,
        .quick-action-card:hover {
            transform: translateY(-8px) rotateX(2deg) rotateY(-2deg);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--brand-primary-light);
        }

        .stat-card:hover .stat-value,
        .dashboard-stat-card:hover .dashboard-stat-value,
        .quick-action-card:hover .quick-action-count {
            transform: scale(1.1);
            transition: transform 0.3s ease;
        }

        .stat-icon-bg {
            transition: all 0.3s ease;
        }

        .stat-card:hover .stat-icon-bg,
        .dashboard-stat-card:hover .stat-icon-bg {
            transform: scale(1.15) rotate(-10deg);
        }

        .quick-action-icon {
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .quick-action-card:hover .quick-action-icon {
            transform: scale(1.2);
            animation: icon-float 1.5s ease-in-out infinite;
        }

        @keyframes icon-float {

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

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

        /* 7. USER AVATARS - Ring Animation */
        .user-profile-avatar,
        .comment-avatar,
        .people-avatar,
        .workload-avatar,
        .assignee-avatar {
            transition: all 0.3s ease;
            position: relative;
        }

        .user-profile-avatar::before,
        .comment-avatar::before,
        .people-avatar::before {
            content: '';
            position: absolute;
            inset: -4px;
            border-radius: 50%;
            border: 2px solid transparent;
            transition: all 0.3s ease;
        }

        .user-profile-avatar:hover::before,
        .comment-avatar:hover::before,
        .people-avatar:hover::before {
            border-color: var(--brand-primary);
            animation: ring-expand 0.5s ease;
        }

        @keyframes ring-expand {
            0% {
                transform: scale(0.8);
                opacity: 0;
            }

            50% {
                opacity: 1;
            }

            100% {
                transform: scale(1);
                opacity: 1;
            }
        }

        .user-profile-avatar:hover,
        .comment-avatar:hover,
        .people-avatar:hover {
            transform: scale(1.1);
            box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
        }

        /* 8. TABLE ROWS - Cell Spotlight */
        .list-table td {
            transition: all 0.2s ease;
            position: relative;
        }

        .list-table tbody tr:hover td {
            color: var(--text-main);
        }

        .list-table th {
            transition: all 0.2s ease;
        }

        .list-table th:hover {
            color: var(--brand-primary);
            cursor: pointer;
        }

        /* 9. MODAL CLOSE BUTTONS - Rotate Spin */
        .close-btn,
        .close-modal,
        .chat-close,
        .ai-close {
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .close-btn:hover,
        .close-modal:hover,
        .chat-close:hover,
        .ai-close:hover {
            transform: rotate(90deg) scale(1.2);
            color: var(--brand-red);
            background: var(--brand-red-light);
        }

        .modal-header button {
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .modal-header button:hover {
            transform: rotate(90deg);
            background: var(--brand-red-light);
            color: var(--brand-red);
        }

        /* 10. KANBAN COLUMNS - Enhanced Drop Zone */
        .board-col {
            transition: all 0.3s ease;
        }

        .board-col:hover {
            transform: translateY(-3px);
        }

        .board-col:hover .board-head {
            color: var(--brand-primary);
        }

        .board-tasks.drag-over {
            background: linear-gradient(135deg, var(--brand-primary-light), rgba(239, 68, 68, 0.1));
            border: 2px dashed var(--brand-primary);
            border-radius: 12px;
            animation: drop-zone-pulse 1s ease-in-out infinite;
        }

        @keyframes drop-zone-pulse {

            0%,
            100% {
                box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3);
            }

            50% {
                box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
            }
        }

        /* ADDITIONAL POLISH */

        /* View buttons hover */
        .view-btn {
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .view-btn:not(.active):hover {
            transform: translateY(-2px) scale(1.02);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        /* Notification items */
        .notif-item {
            transition: all 0.2s ease;
        }

        .notif-item:hover {
            background: var(--brand-primary-light);
            transform: translateX(5px);
        }

        .notif-item:hover .notif-icon {
            background: var(--brand-primary);
            color: white;
        }

        /* Dependency items */
        .dependency-item {
            transition: all 0.25s ease;
        }

        .dependency-item:hover {
            transform: translateX(5px);
            border-left-width: 4px;
        }

        /* Comment items */
        .comment-item {
            transition: all 0.2s ease;
        }

        .comment-item:hover {
            transform: translateX(5px);
            border-left-color: var(--brand-primary);
            background: var(--brand-primary-light);
        }

        /* Chat toggle button */
        .chat-toggle {
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .chat-toggle:hover {
            transform: scale(1.15) rotate(-5deg);
            box-shadow: 0 12px 30px rgba(79, 70, 229, 0.5);
        }

        /* AI Agent button */
        .ai-agent-btn {
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .ai-agent-btn:hover {
            transform: scale(1.15) rotate(5deg);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
        }

        /* Calendar day hover */
        .calendar-day {
            transition: all 0.2s ease;
        }

        .calendar-day:hover {
            transform: scale(1.02);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            border-color: var(--brand-primary);
            z-index: 10;
        }

        .calendar-task-chip {
            transition: all 0.2s ease;
        }

        .calendar-task-chip:hover {
            transform: translateX(3px);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        }

        /* Folder items */
        .folder-item {
            transition: all 0.2s ease;
        }

        .folder-item:hover {
            padding-left: 36px;
        }

        .folder-item:hover i {
            transform: scale(1.2);
            color: var(--brand-primary);
        }

        /* Content cards */
        .content-card,
        .overview-panel,
        .cockpit-card {
            transition: all 0.3s ease;
        }

        .content-card:hover,
        .overview-panel:hover,
        .cockpit-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
        }

        /* Resource cards */
        .resource-card {
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .resource-card:hover {
            transform: translateY(-6px) scale(1.02);
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
        }

        .resource-card:hover .resource-icon {
            transform: scale(1.2);
            animation: icon-bounce 0.5s ease;
        }

        @keyframes icon-bounce {

            0%,
            100% {
                transform: scale(1.2);
            }

            50% {
                transform: scale(1.3);
            }
        }

        /* Auth tabs */
        .auth-tab {
            transition: all 0.3s ease;
        }

        .auth-tab:hover:not(.active) {
            transform: translateY(-2px);
            background: var(--bg-app);
        }

        /* Login features */
        .login-feature {
            transition: all 0.3s ease;
        }

        .login-feature:hover {
            transform: translateX(10px);
            background: rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding-left: 10px;
            margin-left: -10px;
        }

        .login-feature:hover i {
            transform: scale(1.2);
        }

        /* 4. INLINE EDITING STYLES */
        .inline-edit-select {
            background: transparent;
            border: 1px solid transparent;
            border-radius: 4px;
            padding: 2px 4px;
            font-size: 13px;
            color: var(--text-main);
            cursor: pointer;
            transition: all 0.2s ease;
            width: 100%;
            max-width: 140px;
            appearance: none;
            -webkit-appearance: none;
        }

        .inline-edit-select:hover {
            background: var(--bg-app);
            border-color: var(--border);
        }

        .inline-edit-select:focus {
            outline: none;
            background: var(--bg-panel);
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 2px var(--brand-primary-light);
        }

        .inline-edit-checkbox {
            width: 16px;
            height: 16px;
            cursor: pointer;
            accent-color: var(--brand-primary);
        }

        .inline-edit-input {
            background: transparent;
            border: 1px solid transparent;
            border-radius: 4px;
            padding: 2px 4px;
            font-size: 13px;
            color: var(--text-main);
            width: 100%;
            transition: all 0.2s ease;
        }

        .inline-edit-input:hover {
            background: var(--bg-app);
            border-color: var(--border);
        }

        .inline-edit-input:focus {
            outline: none;
            background: var(--bg-panel);
            border-color: var(--brand-primary);
        }

        .status-pill.clickable {
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }


        /* 5. MULTI-SELECT & BULK EDIT STYLES - ENHANCED */
        .task-checkbox {
            width: 18px;
            height: 18px;
            cursor: pointer;
            accent-color: var(--brand-primary);
            margin: 0;
            transition: all 0.2s ease;
        }

        .task-checkbox:hover {
            transform: scale(1.1);
        }

        .checkbox-column {
            width: 50px;
            text-align: center;
            padding: 12px 8px !important;
            background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.02));
        }

        .checkbox-column:hover {
            background: linear-gradient(to right, transparent, var(--bg-hover));
        }

        .task-row.selected {
            background: linear-gradient(90deg, rgba(230, 57, 70, 0.12) 0%, rgba(230, 57, 70, 0.05) 100%) !important;
            border-left: 4px solid var(--brand-primary);
            box-shadow: inset 0 0 0 1px rgba(230, 57, 70, 0.1);
        }

        .task-row.selected:hover {
            background: linear-gradient(90deg, rgba(230, 57, 70, 0.18) 0%, rgba(230, 57, 70, 0.08) 100%) !important;
        }

        .bulk-action-toolbar {
            position: fixed;
            bottom: 16px;
            left: calc(var(--sidebar-width) + var(--sidebar-gap) * 2);
            right: var(--sidebar-gap);
            transform: none;
            width: auto;
            background: rgba(255, 255, 255, 0.96);
            border: 1px solid rgba(17, 24, 39, 0.10);
            border-radius: 20px;
            padding: 10px;
            box-shadow: 0 22px 50px rgba(0, 0, 0, 0.14);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            z-index: 999;
            animation: slideUp 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
            backdrop-filter: blur(16px);
        }

        .bulk-action-toolbar .bulk-left,
        .bulk-action-toolbar .bulk-right {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
        }

        .bulk-action-toolbar .bulk-left {
            flex: 1;
            overflow: hidden;
            padding: 0;
        }

        .bulk-action-toolbar .bulk-right {
            flex: 0 0 auto;
            padding: 0;
        }

        .bulk-action-toolbar .bulk-divider {
            width: 1px;
            height: 28px;
            background: rgba(17, 24, 39, 0.12);
            flex: 0 0 auto;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(16px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .bulk-action-toolbar span {
            font-weight: 950;
            color: #111827;
            font-size: 12px;
            letter-spacing: 0.25px;
            padding: 6px 10px;
            background: rgba(220, 38, 38, 0.10);
            border: 1px solid rgba(220, 38, 38, 0.18);
            border-radius: 999px;
            white-space: nowrap;
        }

        .bulk-action-toolbar select {
            height: 36px;
            padding: 0 12px;
            border: 1px solid rgba(17, 24, 39, 0.12);
            border-radius: 14px;
            background: white;
            color: #111827;
            font-size: 13px;
            font-weight: 850;
            cursor: pointer;
            transition: all 0.15s ease;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            max-width: 190px;
            text-overflow: ellipsis;
        }

        .bulk-action-toolbar select:hover {
            border-color: rgba(17, 24, 39, 0.22);
            transform: translateY(-1px);
        }

        .bulk-action-toolbar select:focus {
            outline: none;
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.14);
        }

        .bulk-action-toolbar button {
            height: 36px;
            padding: 0 12px;
            border: 1px solid rgba(17, 24, 39, 0.12);
            border-radius: 14px;
            font-size: 13px;
            font-weight: 900;
            cursor: pointer;
            transition: all 0.15s ease;
            background: white;
            color: #111827;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            display: inline-flex;
            align-items: center;
            gap: 8px;
            white-space: nowrap;
        }

        .bulk-action-toolbar button.icon {
            width: 36px;
            padding: 0;
            justify-content: center;
            gap: 0;
        }

        .bulk-action-toolbar button:hover {
            transform: translateY(-1px);
            border-color: rgba(17, 24, 39, 0.22);
        }

        .bulk-action-toolbar button.danger {
            background: #dc2626;
            color: white;
            border-color: #dc2626;
        }

        .bulk-action-toolbar button.danger:hover {
            box-shadow: 0 10px 24px rgba(220, 38, 38, 0.28);
        }

        .bulk-action-toolbar button.clear {
            background: transparent;
            color: var(--text-muted);
            border: 1px solid transparent;
            box-shadow: none;
        }

        .bulk-action-toolbar button.clear:hover {
            background: rgba(0, 0, 0, 0.06);
            color: var(--text-main);
            transform: translateY(-1px);
        }

        /* Bulk "More" menu (ClickUp-like behavior, Flowtive UI) */
        .ft-bulk-menu {
            position: fixed;
            inset: 0;
            z-index: 2147483647;
            background: rgba(15, 23, 42, 0.35);
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
            display: flex;
            align-items: flex-start;
            justify-content: center;
            padding: 18px;
        }

        .ft-bulk-menu-panel {
            width: 820px;
            max-width: calc(100vw - 32px);
            max-height: calc(100vh - 36px);
            background: #ffffff;
            border-radius: 18px;
            border: 1px solid rgba(17, 24, 39, 0.12);
            box-shadow: 0 30px 80px rgba(0,0,0,0.25);
            overflow: hidden;
        }

        .ft-bulk-menu-head {
            padding: 14px 16px;
            border-bottom: 1px solid #e5e7eb;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            background: linear-gradient(180deg, #ffffff 0%, rgba(2, 6, 23, 0.02) 100%);
        }

        .ft-bulk-menu-search {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 10px;
            border: 1px solid rgba(17, 24, 39, 0.12);
            border-radius: 14px;
            padding: 10px 12px;
            background: #fff;
        }

        .ft-bulk-menu-search input {
            border: none;
            outline: none;
            width: 100%;
            font-size: 14px;
            font-weight: 800;
            color: #111827;
            background: transparent;
        }

        .ft-bulk-menu-close {
            width: 36px;
            height: 36px;
            border-radius: 12px;
            border: 1px solid rgba(17, 24, 39, 0.12);
            background: #fff;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: #111827;
        }

        .ft-bulk-menu-body {
            padding: 14px 16px 16px;
            overflow: auto;
            max-height: calc(100vh - 140px);
        }

        .ft-bulk-menu-section {
            margin-top: 14px;
        }

        .ft-bulk-menu-section:first-child {
            margin-top: 0;
        }

        .ft-bulk-menu-title {
            font-size: 12px;
            font-weight: 950;
            color: #6b7280;
            letter-spacing: 0.3px;
            text-transform: uppercase;
            margin: 0 0 10px 0;
        }

        .ft-bulk-menu-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }

        .ft-bulk-menu-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            border: 1px solid rgba(17, 24, 39, 0.10);
            border-radius: 16px;
            background: #fff;
            cursor: pointer;
            transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
        }

        .ft-bulk-menu-item:hover {
            transform: translateY(-1px);
            border-color: rgba(17, 24, 39, 0.18);
            box-shadow: 0 10px 18px rgba(0,0,0,0.06);
        }

        .ft-bulk-menu-ico {
            width: 36px;
            height: 36px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex: 0 0 auto;
            background: rgba(2, 6, 23, 0.04);
            border: 1px solid rgba(17, 24, 39, 0.08);
            color: #111827;
        }

        .ft-bulk-menu-item.danger .ft-bulk-menu-ico {
            background: rgba(220, 38, 38, 0.10);
            border-color: rgba(220, 38, 38, 0.18);
            color: #dc2626;
        }

        .ft-bulk-menu-item .t1 {
            font-size: 13px;
            font-weight: 950;
            color: #111827;
        }

        .ft-bulk-menu-item .t2 {
            margin-top: 2px;
            font-size: 12px;
            font-weight: 750;
            color: #6b7280;
        }

        @media (max-width: 760px) {
            .ft-bulk-menu-grid { grid-template-columns: 1fr; }
        }

        @media (max-width: 900px) {
            .bulk-action-toolbar {
                left: var(--sidebar-gap);
                right: var(--sidebar-gap);
                padding: 10px;
            }
            .bulk-action-toolbar .bulk-left {
                flex-wrap: wrap;
                row-gap: 8px;
            }
            .bulk-action-toolbar .bulk-right {
                flex-wrap: wrap;
                row-gap: 8px;
            }
        }

        /* Priority color classes */
        .priority-high {
            border-left: 3px solid #dc2626 !important;
        }

        .priority-medium {
            border-left: 3px solid #f59e0b !important;
        }

        .priority-low {
            border-left: 3px solid #10b981 !important;
        }

        /* Activity Tab Styles (Comments/History) */
        .activity-tab {
            background: none;
            border: none;
            padding: 10px 16px;
            font-size: 14px;
            font-weight: 600;
            color: var(--text-muted);
            cursor: pointer;
            border-bottom: 2px solid transparent;
            transition: all 0.2s ease;
        }

        .activity-tab:hover {
            color: var(--text-main);
            background: rgba(0, 0, 0, 0.03);
        }

        .activity-tab.active {
            color: var(--brand-primary);
            border-bottom-color: var(--brand-primary);
        }

        /* ==========================================================================
           CLICKUP-STYLE LIST VIEW
           ========================================================================== */

        .list-group-header {
            background: var(--bg-app);
            padding: 10px 16px;
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            user-select: none;
            position: sticky;
            top: 40px;
            z-index: 5;
            transition: background 0.2s;
            border-bottom: 1px solid var(--border);
        }

        .list-group-header:hover {
            background: rgba(0, 0, 0, 0.02);
        }

        .list-group-badge {
            padding: 2px 8px;
            border-radius: 4px;
            color: white;
            font-size: 10px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
        }
        .list-group-badge[contenteditable="true"] {
            outline: 2px solid rgba(211, 16, 39, 0.20);
            background: rgba(0,0,0,0.15) !important;
            box-shadow: 0 6px 16px rgba(0,0,0,0.12);
        }

        /* Badge Colors */
        .badge-complete {
            background: #10B981;
        }

        .badge-inprogress {
            background: #3B82F6;
        }

        .badge-todo {
            background: #6B7280;
        }

        .list-row-custom {
            border-bottom: 1px solid var(--border);
            transition: background 0.1s;
        }

        .list-row-custom:hover {
            background: rgba(0, 0, 0, 0.015);
        }

        .list-row-custom td {
            padding: 6px 12px;
            font-size: 13px;
            color: var(--text-main);
            vertical-align: middle;
            height: 40px;
        }

        /* Avatar styling */
        .list-avatar {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: var(--brand-primary-light);
            color: var(--brand-primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            font-weight: 700;
            border: 1px solid rgba(0, 0, 0, 0.05);
            text-transform: uppercase;
        }

        .list-avatar-empty {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            border: 1px dashed var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            font-size: 10px;
        }

        .list-avatar-empty:hover {
            border-color: var(--brand-primary);
            color: var(--brand-primary);
        }

        /* Status Icon Styling */
        .status-icon-btn {
            background: none;
            border: none;
            cursor: pointer;
            padding: 0;
            display: flex;
            align-items: center;
        }

        .status-icon-check {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            cursor: pointer;
            margin-right: 10px;
            transition: all 0.2s;
            flex-shrink: 0;
        }

        .status-icon-complete {
            background: #10B981;
            color: white;
            border: 1px solid #10B981;
        }

        .status-icon-todo {
            background: transparent;
            color: transparent;
            border: 1.5px solid #D1D5DB;
        }

        .status-icon-todo:hover {
            border-color: #10B981;
            color: #10B981;
        }

        .status-icon-inprogress {
            background: transparent;
            color: #3B82F6;
            border: 1.5px solid #3B82F6;
            position: relative;
        }

        /* Add Task Row */
        .list-add-row {
            padding: 8px 16px;
            font-size: 13px;
            color: var(--text-muted);
            cursor: pointer;
            transition: color 0.2s;
            display: flex;
            align-items: center;
            gap: 8px;
            border-bottom: 1px solid transparent;
        }

        .list-add-row:hover {
            color: var(--brand-primary);
            background: rgba(0, 0, 0, 0.01);
        }

        /* Flag Colors */
        .flag-urgent {
            color: #EF4444;
        }

        .flag-high {
            color: #F59E0B;
        }

        .flag-normal {
            color: #6B7280;
        }

        .flag-low {
            color: #10B981;
        }

        /* Subtask inline section - alignment & polish */
        .subtask-inline-container {
            overflow-x: auto;
        }
        .subtask-inline-card {
            margin: 8px 12px 12px 0;
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 10px;
            box-shadow: 0 1px 2px rgba(0,0,0,0.03);
            overflow: hidden;
        }
        .subtask-inline-table {
            min-width: 680px;
        }
        .subtask-row-inline {
            transition: background 0.15s ease;
        }
        .subtask-row-inline.is-selected {
            background: rgba(211, 16, 39, 0.06);
        }
        .subtask-row-inline.is-selected td:first-child {
            box-shadow: inset 3px 0 0 var(--brand-primary);
        }
        .subtask-row-inline:hover {
            background: rgba(0, 0, 0, 0.02);
        }
        .subtask-delete-btn {
            opacity: 0.35; /* always discoverable */
            transition: opacity 0.15s ease, color 0.15s ease;
        }
        .subtask-row-inline:hover .subtask-delete-btn,
        .subtask-row-inline.is-selected .subtask-delete-btn {
            opacity: 0.9;
        }
        .subtask-delete-btn:hover {
            opacity: 1;
            color: var(--brand-red);
        }

        /* Keep action (delete) column visible when scrolling horizontally */
        .subtask-inline-table td:last-child {
            position: sticky;
            right: 0;
            background: inherit;
            z-index: 2;
        }
        .subtask-inline-table tr:hover td:last-child,
        .subtask-inline-table tr.is-selected td:last-child {
            background: linear-gradient(to left, rgba(0,0,0,0.03), rgba(0,0,0,0));
        }
        .subtask-tree-btn {
            opacity: 0.7;
            transition: opacity 0.15s ease, background 0.15s ease;
        }
        .subtask-tree-btn:hover {
            opacity: 1;
            background: rgba(0,0,0,0.04);
        }
        .subtask-add-child-btn {
            opacity: 0;
            transform: translateX(-2px);
            transition: opacity 0.15s ease, transform 0.15s ease;
        }
        .subtask-row-inline:hover .subtask-add-child-btn {
            opacity: 0.9;
            transform: translateX(0);
        }
        .subtask-select-btn {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            border: 1.5px solid rgba(107,114,128,0.6);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            cursor: pointer;
            transition: all 0.15s ease;
            background: transparent;
        }
        .subtask-select-btn:hover {
            border-color: var(--brand-primary);
        }
        .subtask-select-btn.is-selected {
            border-color: var(--brand-primary);
            background: rgba(211, 16, 39, 0.12);
        }
        .subtask-select-btn.is-selected::after {
            content: '';
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--brand-primary);
        }
        /* Add child subtask row should match main "Add a subtask..." UX */
        .subtask-add-child-row {
            opacity: 0.7;
        }
        .subtask-add-child-row:hover {
            opacity: 1;
            background: rgba(0, 0, 0, 0.02);
        }
        .subtask-add-child-input {
            border: none;
            background: transparent;
            flex: 1;
            min-width: 120px;
            font-size: 13px;
            color: var(--text-muted);
            outline: none;
        }
        .subtask-add-child-input::placeholder {
            color: var(--text-muted);
            opacity: 0.8;
        }
        .subtask-assignee-select {
            white-space: nowrap;
        }
        .subtask-assignee-select option {
            white-space: normal;
        }
        .subtask-add-row:hover {
            background: rgba(0, 0, 0, 0.02);
        }
        .subtask-add-input::placeholder {
            color: var(--text-muted);
            opacity: 0.8;
        }

        .list-cell-name {
            display: flex;
            align-items: center;
            font-weight: 500;
        }

        .list-cell-name:hover {
            color: var(--brand-primary);
            cursor: pointer;
        }

        /* ========================================
           SIDEBAR COLLAPSE FEATURE - ClickUp Style
           ======================================== */

        .sidebar-collapsed {
            width: 0px !important;
            min-width: 0px !important;
            max-width: 0px !important;
            opacity: 0 !important;
            pointer-events: none !important;
            overflow: hidden !important;
            transition: all 0.3s ease !important;
        }

        /* Hide ALL text and labels in collapsed mode - Ultra Comprehensive */
        .sidebar-collapsed span,
        .sidebar-collapsed .sidebar-item span,
        .sidebar-collapsed .space-header span,
        .sidebar-collapsed .folder-name,
        .sidebar-collapsed .nav-label,
        .sidebar-collapsed .space-label-wrapper span,
        .sidebar-collapsed p,
        .sidebar-collapsed h1,
        .sidebar-collapsed h2,
        .sidebar-collapsed h3,
        .sidebar-collapsed h4,
        .sidebar-collapsed h5,
        .sidebar-collapsed label,
        .sidebar-collapsed .text,
        .sidebar-collapsed .brand-text,
        .sidebar-collapsed .brand-name,
        .sidebar-collapsed .sidebar-brand span,
        .sidebar-collapsed .sidebar-logo span,
        .sidebar-collapsed .nav-section-title,
        .sidebar-collapsed .section-header,
        .sidebar-collapsed .section-title,
        .sidebar-collapsed .account-section h4,
        .sidebar-collapsed .account-section span,
        .sidebar-collapsed div:not(.sidebar-toggle-btn):not([class*="icon"]) span,
        .sidebar-collapsed a span,
        .sidebar-collapsed button:not(.sidebar-toggle-btn) span {
            display: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
            width: 0 !important;
            height: 0 !important;
            font-size: 0 !important;
            overflow: hidden !important;
        }

        /* Center ALL items in collapsed mode */
        .sidebar-collapsed .sidebar-item,
        .sidebar-collapsed .space-header,
        .sidebar-collapsed>div,
        .sidebar-collapsed>* {
            justify-content: center !important;
            align-items: center !important;
            text-align: center !important;
            padding-left: 0 !important;
            padding-right: 0 !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
        }

        /* Icons in collapsed mode - prominently displayed */
        .sidebar-collapsed i,
        .sidebar-collapsed .nav-icon,
        .sidebar-collapsed .fas,
        .sidebar-collapsed .far,
        .sidebar-collapsed .fab {
            font-size: 20px !important;
            margin: 0 auto !important;
            display: block !important;
            text-align: center !important;
        }

        /* Toggle Button - Vertical Divider Style (Abstract/Linear like) */
        .sidebar-toggle-btn {
            position: fixed;
            top: 350px !important;
            /* Forces 350px (User Request) */
            transform: translateY(-50%);
            width: 24px;
            height: 48px;
            /* Taller pill shape */
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 12px;
            /* Pill radius */
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 9999;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
            opacity: 0;
            /* Invisible by default to appear on hover only */
            color: var(--text-muted);
            font-size: 14px;
        }

        /* Small precise hit area to avoid overlapping */
        .sidebar-toggle-btn::after {
            content: '';
            position: absolute;
            top: -10px;
            bottom: -10px;
            left: -10px;
            right: -10px;
            z-index: -1;
        }

        .sidebar-toggle-btn:hover {
            opacity: 1;
            transform: translateY(-50%) scale(1.1);
            background: var(--brand-primary);
            color: white;
            border-color: var(--brand-primary);
        }

        /* Hide folder lists, dropdowns, and complex elements */
        .sidebar-collapsed .folder-container,
        .sidebar-collapsed .space-arrow,
        .sidebar-collapsed .add-folder-icon,

        .sidebar-collapsed .space-settings-icon,
        .sidebar-collapsed select,
        .sidebar-collapsed input,
        .sidebar-collapsed textarea,
        .sidebar-collapsed button:not(.sidebar-toggle-btn) {
            display: none !important;
        }

        /* Tooltip for collapsed items */
        .sidebar-collapsed [title]:hover::after {
            content: attr(title);
            position: absolute;
            left: 100%;
            top: 50%;
            transform: translateY(-50%);
            background: #1e293b;
            color: white;
            padding: 8px 12px;
            border-radius: 6px;
            margin-left: 10px;
            white-space: nowrap;
            z-index: 10000;
            font-size: 12px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }


        /* Smooth transitions for sidebar */
        aside,
        nav,
        .sidebar {
            transition: width 0.3s ease, min-width 0.3s ease !important;
        }

        /* Main content area adjustments */
        main {
            transition: margin-left 0.3s ease, width 0.3s ease !important;
        }

        /* When sidebar is collapsed, expand main content */
        body:has(.sidebar-collapsed) main,
        body:has(aside.sidebar-collapsed) main {
            margin-left: calc(16px + var(--content-inset)) !important;
            margin-right: calc(16px + var(--content-inset)) !important;
            width: calc(100% - 32px - var(--content-inset) * 2) !important;
            max-width: calc(100% - 32px - var(--content-inset) * 2) !important;
        }

        /* When sidebar is expanded */
        body:has(aside:not(.sidebar-collapsed)) main {
            margin-left: calc(var(--sidebar-width, 260px) + 8px + var(--content-inset)) !important;
            margin-right: calc(16px + var(--content-inset)) !important;
            width: calc(100% - var(--sidebar-width, 260px) - 24px - var(--content-inset) * 2) !important;
            max-width: calc(100% - var(--sidebar-width, 260px) - 24px - var(--content-inset) * 2) !important;
        }

        /* ============================================ */
        /* TEMPLATE ONBOARDING MODAL                   */
        /* ============================================ */
        .template-onboarding-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            display: none;
            z-index: 10000;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .template-onboarding-overlay.active {
            display: flex;
            opacity: 1;
        }

        .template-onboarding-modal {
            background: var(--bg-panel);
            width: 880px;
            max-width: 95%;
            border-radius: 24px;
            box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
            overflow: hidden;
            transform: scale(0.92) translateY(20px);
            opacity: 0;
            transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .template-onboarding-overlay.active .template-onboarding-modal {
            transform: scale(1) translateY(0);
            opacity: 1;
        }

        .template-onboarding-header {
            padding: 36px 40px 0;
            text-align: center;
        }

        .template-onboarding-header h2 {
            font-size: 24px;
            font-weight: 800;
            color: var(--text-main);
            margin: 0 0 8px;
            letter-spacing: -0.02em;
            line-height: 1.3;
        }

        .template-onboarding-header p {
            font-size: 14px;
            color: var(--text-muted);
            margin: 0;
            line-height: 1.5;
        }

        .template-cards-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 14px;
            padding: 28px 40px 36px;
        }

        .template-card {
            background: var(--bg-app);
            border: 2px solid var(--border);
            border-radius: 16px;
            padding: 22px 20px;
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
            position: relative;
            overflow: hidden;
        }

        .template-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: var(--brand-primary);
            transform: scaleX(0);
            transition: transform 0.3s ease;
        }

        .template-card:hover {
            border-color: var(--brand-primary);
            transform: translateY(-3px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
        }

        .template-card:hover::before {
            transform: scaleX(1);
        }

        .template-card:active {
            transform: translateY(-1px) scale(0.98);
        }

        .template-card-icon {
            width: 44px;
            height: 44px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            margin-bottom: 14px;
        }

        .template-card-icon.agency {
            background: #FEF3C7;
            color: #D97706;
        }

        .template-card-icon.dev {
            background: #DBEAFE;
            color: #2563EB;
        }

        .template-card-icon.crm {
            background: #FCE7F3;
            color: #DB2777;
        }

        .template-card-icon.hr {
            background: #EDE9FE;
            color: #7C3AED;
        }

        .template-card-icon.ops {
            background: #D1FAE5;
            color: #059669;
        }

        .template-card-icon.blank {
            background: var(--border-light);
            color: var(--text-muted);
        }

        .template-card h4 {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-main);
            margin: 0 0 4px;
            line-height: 1.3;
        }

        .template-card p {
            font-size: 12px;
            color: var(--text-muted);
            margin: 0;
            line-height: 1.4;
        }

        /* LOADING STATE */
        .template-loading-container {
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 60px 40px;
            text-align: center;
        }

        .template-loading-container.active {
            display: flex;
        }

        .template-spinner {
            width: 56px;
            height: 56px;
            border: 4px solid var(--border-light);
            border-top-color: var(--brand-primary);
            border-radius: 50%;
            animation: templateSpin 0.8s linear infinite;
            margin-bottom: 24px;
        }

        @keyframes templateSpin {
            to {
                transform: rotate(360deg);
            }
        }

        .template-loading-text {
            font-size: 16px;
            font-weight: 600;
            color: var(--text-main);
            margin-bottom: 8px;
            min-height: 24px;
        }

        .template-loading-sub {
            font-size: 13px;
            color: var(--text-muted);
        }

        .template-progress-bar {
            width: 240px;
            height: 4px;
            background: var(--border-light);
            border-radius: 2px;
            margin-top: 20px;
            overflow: hidden;
        }

        .template-progress-fill {
            height: 100%;
            background: var(--brand-primary);
            border-radius: 2px;
            width: 0%;
            transition: width 0.5s ease;
        }

        @media (max-width: 900px) {
            .template-cards-grid {
                grid-template-columns: repeat(2, 1fr);
                padding: 20px 24px 28px;
            }
        }

        @media (max-width: 600px) {
            .template-cards-grid {
                grid-template-columns: 1fr;
                padding: 20px 24px 28px;
            }

            .template-onboarding-header {
                padding: 28px 24px 0;
            }

            .template-onboarding-header h2 {
                font-size: 20px;
            }
        }

        /* DYNAMIC KPI TAB */
        .kpi-cards-row {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
            margin-top: 20px;
        }

        .kpi-card {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 28px 24px;
            text-align: center;
            transition: all 0.25s ease;
            position: relative;
            overflow: hidden;
        }

        .kpi-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: var(--brand-primary);
        }

        /* Sparkline wave backgrounds — enterprise analytics polish */
        .kpi-card::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60%;
            opacity: 0.06;
            pointer-events: none;
            background-repeat: no-repeat;
            background-position: bottom center;
            background-size: 100% 100%;
        }

        .kpi-card:nth-child(1)::after {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 80'%3E%3Cpath d='M0,60 C30,45 60,25 90,35 C120,45 150,65 180,50 C210,35 240,20 270,30 L300,25 L300,80 L0,80Z' fill='%236366f1'/%3E%3C/svg%3E");
        }

        .kpi-card:nth-child(2)::after {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 80'%3E%3Cpath d='M0,40 C40,55 80,30 120,45 C160,60 200,20 240,35 C260,42 280,30 300,38 L300,80 L0,80Z' fill='%2310b981'/%3E%3C/svg%3E");
        }

        .kpi-card:nth-child(3)::after {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 80'%3E%3Cpath d='M0,55 C50,30 100,50 150,25 C200,50 250,40 300,45 L300,80 L0,80Z' fill='%23f59e0b'/%3E%3C/svg%3E");
        }

        .kpi-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
        }

        .kpi-card-value {
            font-size: 36px;
            font-weight: 800;
            color: var(--text-main);
            line-height: 1;
            margin-bottom: 8px;
            letter-spacing: -0.02em;
        }

        .kpi-card-label {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        @media (max-width: 768px) {
            .kpi-cards-row {
                grid-template-columns: 1fr;
            }
        }



        /* =========================================================
           UNIFIED INBOX STYLES
           ========================================================= */
        .inbox-nav-item {
            padding: 10px 16px;
            margin-bottom: 4px;
            border-radius: 12px;
            cursor: pointer;
            font-weight: 900;
            font-size: 13px;
            color: var(--text-secondary);
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.2s;
            border: 1px solid transparent;
        }

        .inbox-nav-item:hover {
            background: var(--surface-3);
            color: var(--text-main);
            border-color: var(--gridline-strong);
        }

        .inbox-nav-item.active {
            background: color-mix(in srgb, var(--brand-primary-light) 55%, transparent);
            color: var(--text-main);
            border-color: color-mix(in srgb, var(--brand-primary) 30%, transparent);
        }

        .inbox-notif-row {
            padding: 16px;
            border-bottom: 1px solid var(--gridline);
            cursor: pointer;
            transition: background 0.2s;
            display: flex;
            gap: 12px;
        }

        .inbox-notif-row:hover {
            background: var(--surface-3);
        }

        .inbox-notif-row.unread {
            background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
            border-left: 4px solid var(--brand-primary);
        }

        /* =========================================================
           PDF EXPORT - ANTI-CROPPING & LANDSCAPE LOCK
           ========================================================= */
        html.pdf-export-mode,
        body.pdf-export-mode {
            overflow: visible !important;
            width: 1400px !important;
            height: auto !important;
            background: white !important;
        }

        html.pdf-export-mode #app-ui {
            position: static !important;
            overflow: visible !important;
            width: 1400px !important;
            max-width: 1400px !important;
            height: auto !important;
            max-height: none !important;
            padding: 0 !important;
            margin: 0 !important;
            transform: none !important;
            background: white !important;
            display: block !important;
        }

        html.pdf-export-mode main {
            position: static !important;
            overflow: visible !important;
            width: 1400px !important;
            max-width: 1400px !important;
            min-width: 1400px !important;
            height: auto !important;
            max-height: none !important;
            padding: 0 !important;
            margin: 0 !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
            padding-top: 0 !important;
            transform: none !important;
            background: white !important;
        }

        html.pdf-export-mode .content {
            position: static !important;
            overflow: visible !important;
            width: 1400px !important;
            max-width: 1400px !important;
            min-width: 1400px !important;
            height: auto !important;
            max-height: none !important;
            padding: 0 !important;
            margin: 0 !important;
            transform: none !important;
            background: white !important;
        }

        html.pdf-export-mode #view-dashboard {
            position: static !important;
            overflow: visible !important;
            width: 1400px !important;
            max-width: 1400px !important;
            min-width: 1400px !important;
            height: auto !important;
            max-height: none !important;
            padding: 20px !important;
            margin: 0 !important;
            transform: none !important;
            background: white !important;
        }

        /* Hide the sidebar, top bar, and floaters completely */
        html.pdf-export-mode aside,
        html.pdf-export-mode .filter-bar,
        html.pdf-export-mode .top-bar,
        html.pdf-export-mode #chat-toggle,
        html.pdf-export-mode .chat-toggle,
        html.pdf-export-mode .ai-agent-btn,
        html.pdf-export-mode #ai-agent-btn,
        html.pdf-export-mode .ai-agent-panel,
        html.pdf-export-mode #ai-agent-panel,
        html.pdf-export-mode #ft-mobile-fab,
        html.pdf-export-mode .ft-mobile-fab,
        html.pdf-export-mode .dashboard-main-toolbar,
        html.pdf-export-mode .dashboard-back-to-setup-btn,
        html.pdf-export-mode .dashboard-layout-action-btn,
        html.pdf-export-mode .pdf-export-btn,
        html.pdf-export-mode .dashboard-tabs,
        html.pdf-export-mode #dashboard-control-panel {
            display: none !important;
        }

        /* Onboarding / empty widget board — not part of exported reports */
        html.pdf-export-mode #dashboard-widgets-embed:has(.dash-widgets-empty-zone) {
            display: none !important;
        }

        /* Report header: avoid horizontal overflow / right-edge clipping */
        html.pdf-export-mode #premium-pdf-header {
            flex-wrap: wrap !important;
            align-items: flex-start !important;
            max-width: 100% !important;
            width: 100% !important;
            box-sizing: border-box !important;
            padding: 28px 24px !important;
            gap: 20px !important;
        }
        html.pdf-export-mode #premium-pdf-header > div:last-child {
            min-width: 0 !important;
            max-width: 100% !important;
            flex: 1 1 260px !important;
            padding-right: 0 !important;
            text-align: right !important;
        }

        html.pdf-export-mode #view-dashboard .dash-widgets-grid {
            max-width: 100% !important;
            overflow: hidden !important;
        }

        /* Prevent widgets from slicing across pages */
        html.pdf-export-mode .dashboard-widget,
        html.pdf-export-mode .stat-card,
        html.pdf-export-mode .overview-panel {
            page-break-inside: avoid !important;
            break-inside: avoid !important;
            box-shadow: none !important;
            border: 1px solid #E5E7EB !important;
        }

        /* Prevent padding from blowing out the 1400px container width */
        html.pdf-export-mode * {
            box-sizing: border-box !important;
        }
    