/* CSS Variables */
:root {
    --color-bg: #F7F5F2;
    --color-bg-warm: #EDE9E3;
    --color-surface: #FFFFFF;
    --color-text: #1A1A1A;
    --color-text-secondary: #6B6560;
    --color-text-muted: #9A938C;
    --color-primary: #CD6E58;
    --color-primary-dark: #b85d47;
    --color-accent: #C45D3A;
    --color-accent-hover: #A84D2F;
    --color-metric: #5B6BBB;
    --color-metric-hover: #4A5AA8;
    --color-metric-bg: rgba(91, 107, 187, 0.1);
    --color-source: #2A9D8F;
    --color-source-hover: #238B7F;
    --color-success: #4A7C59;
    --color-border: #E5E0DA;
    --color-border-light: #F0EBE5;
    
    --font-sans: 'DM Sans', -apple-system, sans-serif;
    --font-display: 'Plus Jakarta Sans', 'DM Sans', -apple-system, sans-serif;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --transition: 0.2s ease;
}

/* Dark mode */
[data-theme="dark"] {
    --color-bg: #1A1A1A;
    --color-bg-warm: #252525;
    --color-surface: #2D2D2D;
    --color-text: #F5F5F0;
    --color-text-secondary: #B8B4AE;
    --color-text-muted: #8A8580;
    --color-primary: #E07D68;
    --color-primary-dark: #CD6E58;
    --color-accent: #E07D68;
    --color-accent-hover: #EF8E78;
    --color-metric: #7B8BD4;
    --color-metric-hover: #8B9BE4;
    --color-metric-bg: rgba(123, 139, 212, 0.15);
    --color-source: #3AB5A8;
    --color-source-hover: #4AC5B8;
    --color-success: #5A9D6A;
    --color-border: #3D3D3D;
    --color-border-light: #353535;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.15);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.2);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.3), 0 4px 8px rgba(0,0,0,0.25);
}

/* Dark mode: priority colors with higher contrast */
[data-theme="dark"] .priority-badge--low {
    background: rgba(34, 197, 94, 0.4);
    color: #fff;
}

[data-theme="dark"] .priority-badge--medium {
    background: rgba(250, 204, 21, 0.55);
    color: #1a1a1a;
}

[data-theme="dark"] .priority-badge--high {
    background: rgba(234, 88, 12, 0.5);
    color: #fff;
}

[data-theme="dark"] .priority-badge--critical {
    background: rgba(239, 68, 68, 0.5);
    color: #fff;
}

[data-theme="dark"] .priority-dot--unset {
    background: #9ca3af;
}

[data-theme="dark"] .priority-dot--low {
    background: #4ade80;
}

[data-theme="dark"] .priority-dot--medium {
    background: #fde047;
}

[data-theme="dark"] .priority-dot--high {
    background: #fb923c;
}

[data-theme="dark"] .priority-dot--critical {
    background: #f87171;
}

[data-theme="dark"] .detail-panel-row .detail-panel-priority:has(.priority-badge--low) {
    background: rgba(34, 197, 94, 0.35);
    border-color: rgba(34, 197, 94, 0.5);
}

[data-theme="dark"] .detail-panel-row .detail-panel-priority:has(.priority-badge--medium) {
    background: rgba(250, 204, 21, 0.45);
    border-color: rgba(250, 204, 21, 0.55);
}

[data-theme="dark"] .detail-panel-row .detail-panel-priority:has(.priority-badge--high) {
    background: rgba(234, 88, 12, 0.45);
    border-color: rgba(234, 88, 12, 0.55);
}

[data-theme="dark"] .detail-panel-row .detail-panel-priority:has(.priority-badge--critical) {
    background: rgba(239, 68, 68, 0.45);
    border-color: rgba(239, 68, 68, 0.55);
}

[data-theme="dark"] .priority-dropdown {
    background: var(--color-surface);
    border-color: var(--color-border);
}

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

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
}

/* Full-window app layout with persistent sidebar */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-sidebar {
    flex: 0 0 240px;
    width: 240px;
    min-width: 0;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.app-sidebar-brand {
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.app-sidebar-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
    margin: 0;
}

.settings-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: background var(--transition), color var(--transition);
}

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

.settings-icon {
    flex-shrink: 0;
    pointer-events: none;
}

.app-sidebar-nav {
    flex: 1;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    padding: 10px 16px;
    margin: 0 8px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    text-align: left;
}

.sidebar-nav-item:hover {
    color: var(--color-text);
    background: var(--color-bg-warm);
}

.sidebar-nav-item.active {
    background: rgba(196, 93, 58, 0.12);
    color: var(--color-accent);
}

.sidebar-nav-item.active[data-tab="projects"] {
    background: rgba(196, 93, 58, 0.12);
    color: var(--color-accent);
}

.sidebar-nav-item.active[data-tab="metrics"] {
    background: rgba(91, 107, 187, 0.12);
    color: var(--color-metric);
}

.sidebar-nav-item.active[data-tab="data"] {
    background: rgba(42, 157, 143, 0.12);
    color: var(--color-source);
}

.sidebar-nav-icon {
    font-size: 1rem;
    flex: 0 0 24px;
    width: 24px;
    min-width: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-nav-icon svg {
    display: block;
}

.sidebar-section {
    margin-top: 8px;
    padding: 0 8px;
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px 6px 0;
    margin-bottom: 4px;
}

.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.app-sidebar .projects-add-btn {
    width: 22px;
    height: 22px;
    font-size: 1rem;
}

.app-sidebar .projects-list {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    min-width: 0;
}

.app-sidebar .projects-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 8px 16px;
    margin: 0 8px;
}

.app-sidebar .projects-item-icon-placeholder {
    flex: 0 0 24px;
    width: 24px;
    min-width: 24px;
}

/* Projects page - item-style list like tasks/data */
.list-section--projects .list-columns-header--projects,
.list-section--projects .items-list--projects .item,
.list-section--projects .quick-add-row--projects {
    min-width: 0;
}

.list-col-star {
    flex: 0 0 36px;
}

.item-col-star {
    flex: 0 0 36px;
    display: flex;
    align-items: center;
}

.project-star-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-muted);
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--transition), color var(--transition);
}

.project-star-btn:hover {
    opacity: 1;
}

.project-star-btn.starred {
    color: var(--color-accent);
    opacity: 1;
}

.project-star-btn .project-star-icon,
.project-title-star-btn .project-star-icon {
    display: block;
}

.quick-add-star {
    flex: 0 0 36px;
}

.quick-add-row--projects {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-surface);
    cursor: pointer;
    transition: background var(--transition);
}

.quick-add-row--projects:hover {
    background: var(--color-bg);
}

.quick-add-row--projects .quick-add-input {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.quick-add-row--projects .quick-add-input:focus {
    cursor: text;
}

.quick-add-row--projects .quick-add-actions {
    flex: 0 0 36px;
}

.app-sidebar .projects-item {
    margin: 0 0 2px 8px;
    padding: 10px 16px 10px 16px;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    min-width: 0;
    transition: background var(--transition), color var(--transition);
}

.app-sidebar .projects-item:hover {
    background: var(--color-bg-warm);
}

.app-sidebar .projects-item.active {
    background: rgba(196, 93, 58, 0.12);
    color: var(--color-accent);
}

.projects-item-grip {
    flex: 0 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    opacity: 0;
    transition: opacity 0.15s ease;
    color: var(--color-text-muted);
    padding: 6px 4px;
    margin: -6px 0;
}

.projects-item:hover .projects-item-grip {
    opacity: 0.5;
}

.projects-item-grip:hover {
    opacity: 1 !important;
    color: var(--color-text);
}

.projects-item.drag-ready .projects-item-grip {
    cursor: grabbing;
    opacity: 1;
}

.projects-item.dragging {
    opacity: 0.25;
}

.projects-list .drop-indicator {
    list-style: none;
    margin: 0 8px 0 8px;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.app-main-content {
    flex: 1;
    min-width: 0;
    overflow: auto;
    padding: 24px 32px 48px;
}

/* Mobile header (hidden on desktop) */
.mobile-header {
    display: none;
}

.mobile-header-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    border-radius: var(--radius-md);
    transition: background var(--transition);
}

.mobile-header-hamburger:hover {
    background: var(--color-bg-warm);
}

.mobile-header-hamburger-icon {
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1;
    display: block;
}

.mobile-header-title {
    flex: 1;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    text-align: center;
}

.mobile-header-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    transition: background var(--transition), color var(--transition);
}

.mobile-header-settings:hover {
    color: var(--color-text);
    background: var(--color-bg-warm);
}

/* Sidebar backdrop (mobile only) */
.sidebar-backdrop {
    display: none;
}

/* ========== Mobile layout (max-width: 768px) ========== */
@media (max-width: 768px) {
    /* Prevent zoom on focus - iOS zooms when input font-size < 16px */
    input,
    select,
    textarea,
    [contenteditable="true"] {
        font-size: 16px !important;
    }

    /* Mobile header - show and style */
    .mobile-header {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 16px;
        min-height: 52px;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border-light);
        flex-shrink: 0;
    }

    /* Sidebar: hide by default, show as overlay drawer when .open */
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: var(--shadow-lg);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    /* Sidebar backdrop - show when sidebar open */
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 199;
        background: rgba(0, 0, 0, 0.3);
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .sidebar-backdrop.visible {
        display: block;
        opacity: 1;
    }

    .sidebar-backdrop.hidden {
        display: none !important;
    }

    /* Main content - reduce padding */
    .app-main-content {
        padding: 16px;
    }

    /* Tasks list: no padding, edge-to-edge */
    .app-main:has(#tasksPanel.active) .app-main-content {
        padding: 0;
        /* Full-bleed: extend to viewport edge so body bg doesn't show as "padding" */
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(50% - 50vw);
        background: var(--color-surface);
        /* Hide scrollbar so it doesn't reserve space (causes right "padding") */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .app-main:has(#tasksPanel.active) .app-main-content::-webkit-scrollbar {
        display: none;
    }

    /* Force full width: sidebar is fixed but may still affect layout in some browsers */
    .app-layout:has(#tasksPanel.active) .app-main {
        width: 100%;
        min-width: 100%;
    }

    /* Prevent horizontal scroll from 100vw; clip overflow */
    html:has(#tasksPanel.active) {
        overflow-x: hidden;
    }

    /* Force no right padding/margin anywhere in tasks flow */
    .app-main:has(#tasksPanel.active) .tasks-panel-main,
    .app-main:has(#tasksPanel.active) .form-section,
    .app-main:has(#tasksPanel.active) .list-section--tasks {
        padding-right: 0 !important;
        margin-right: 0 !important;
    }


    /* Detail panel - full screen on mobile (fixed overlay + panel) */
    .app-main.detail-open .detail-panel-overlay.visible {
        position: fixed;
        inset: 0;
        z-index: 100;
    }

    .app-main.detail-open .detail-panel.visible {
        position: fixed;
        inset: 0;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        width: 100%;
        min-width: 0;
        max-width: none;
        z-index: 101;
        border-left: none;
    }

    .app-main.detail-open .detail-panel.visible .detail-panel-header {
        padding-top: max(20px, env(safe-area-inset-top));
    }

    .app-main.detail-open .detail-panel.visible .detail-panel-content {
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }

    /* Task list - card layout */
    .list-section--tasks .list-columns-header--tasks {
        display: none;
    }

    .list-section--tasks .items-list--tasks .item {
        display: grid;
        grid-template-columns: 24px 1fr;
        grid-template-rows: auto auto;
        gap: 8px 6px;
        padding: 12px 16px 12px 16px;
    }

    .list-section--tasks .items-list--tasks .item .item-col-checkbox {
        grid-column: 1;
        grid-row: 1;
    }

    .list-section--tasks .items-list--tasks .item .item-col-name {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .item-col-grip,
    .list-col-grip {
        display: none;
    }

    .list-section--tasks .items-list--tasks .item .item-col-actions {
        display: none;
    }

    .list-section--tasks .items-list--tasks .item .item-col-goal {
        display: none;
    }

    /* Row 2: due date left, priority right - hide assignee on mobile, hide due/priority when empty */
    .list-section--tasks .items-list--tasks .item .item-col-assignee {
        display: none;
    }

    .list-section--tasks .items-list--tasks .item .item-col-due,
    .list-section--tasks .items-list--tasks .item .item-col-priority {
        grid-row: 2;
        margin-left: 0;
        font-size: 0.7rem;
        color: var(--color-text-muted);
        pointer-events: none;
    }

    .list-section--tasks .items-list--tasks .item .item-col-due {
        grid-column: 1 / 3;
        display: flex;
        align-items: center;
        margin-left: 30px; /* align with task name (24px checkbox + 6px gap) */
    }

    .list-section--tasks .items-list--tasks .item .item-col-priority {
        grid-column: 2;
        justify-self: end;
        display: flex;
        align-items: center;
    }

    .list-section--tasks .items-list--tasks .item .item-col-due:has(.item-col-empty) {
        display: none;
    }

    .list-section--tasks .items-list--tasks .item .item-col-priority:has(.priority-badge--unset) {
        display: none;
    }

    .list-section--tasks .items-list--tasks .item .item-col-due .item-due-display {
        font-size: 0.7rem;
    }

    .list-section--tasks .items-list--tasks .item .item-col-priority .priority-selector {
        flex: none;
        width: auto;
    }

    .list-section--tasks .items-list--tasks .item .item-col-priority .priority-badge {
        flex: none;
        width: auto;
        font-size: 0.65rem;
        padding: 2px 8px;
    }

    .list-section--tasks .quick-add-row--tasks {
        flex-direction: row;
        padding: 10px 0 10px 16px;
    }

    .list-section--tasks .quick-add-row--tasks .quick-add-grip,
    .list-section--tasks .quick-add-row--tasks .quick-add-assignee,
    .list-section--tasks .quick-add-row--tasks .quick-add-due,
    .list-section--tasks .quick-add-row--tasks .quick-add-priority,
    .list-section--tasks .quick-add-row--tasks .quick-add-goal,
    .list-section--tasks .quick-add-row--tasks .quick-add-actions {
        display: none;
    }

    .list-section--tasks .quick-add-row--tasks .quick-add-input {
        flex: 1;
    }

    /* Metrics list - allow wrap on narrow screens */
    .list-section--metrics .list-columns-header--metrics,
    .list-section--metrics .items-list--metrics .item {
        flex-wrap: wrap;
    }

    /* Projects and Data - ensure touch targets */
    .list-section--projects .items-list--projects .item,
    .list-section .items-list--data .item {
        min-height: 48px;
        padding: 12px 16px;
    }

    .list-section .items-list--data .item .item-col-actions,
    .list-section--projects .items-list--projects .item .item-col-actions {
        opacity: 1;
    }

    /* Detail panel - larger close button for touch */
    .detail-panel-close {
        min-width: 44px;
        min-height: 44px;
    }

    /* List header - hide title on mobile (mobile header already shows it) */
    .list-section--tasks .list-header {
        display: none;
    }

    /* Tasks: hide desktop add + filter bar; use floating bar instead (Asana-style) */
    #tasksPanel .form-section .add-btn {
        display: none;
    }

    .list-section--tasks .list-header-actions--tasks {
        display: none;
    }

    /* Tasks mobile bar - fixed at bottom, only when tasks tab active */
    .app-main:has(#tasksPanel.active) .tasks-mobile-bar {
        display: flex;
        align-items: center;
        gap: 12px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 12px 16px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        background: var(--color-surface);
        border-top: 1px solid var(--color-border-light);
        z-index: 100;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
    }

    .tasks-mobile-bar-filter-wrap {
        position: relative;
        flex: 1;
    }

    .tasks-mobile-bar-filter-btn {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 10px 14px;
        background: var(--color-bg-warm);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        font-family: var(--font-sans);
        font-size: 0.95rem;
        font-weight: 500;
        color: var(--color-text);
        cursor: pointer;
        transition: background 0.15s, border-color 0.15s;
    }

    .tasks-mobile-bar-filter-btn:hover {
        background: var(--color-bg);
        border-color: var(--color-border);
    }

    .tasks-mobile-bar-filter-chevron {
        margin-left: 8px;
        font-size: 0.75rem;
        color: var(--color-text-muted);
    }

    .tasks-mobile-bar-filter-dropdown {
        position: absolute;
        bottom: 100%;
        left: 0;
        right: 0;
        margin-bottom: 8px;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-lg);
        overflow: hidden;
        z-index: 10;
    }

    .tasks-mobile-bar-filter-dropdown.hidden {
        display: none;
    }

    .tasks-mobile-bar-filter-option {
        display: block;
        width: 100%;
        padding: 12px 14px;
        background: none;
        border: none;
        font-family: var(--font-sans);
        font-size: 0.95rem;
        text-align: left;
        color: var(--color-text-secondary);
        cursor: pointer;
        transition: background 0.15s, color 0.15s;
    }

    .tasks-mobile-bar-filter-option:hover {
        background: var(--color-bg);
        color: var(--color-text);
    }

    .tasks-mobile-bar-filter-option.active {
        background: var(--color-bg-warm);
        color: var(--color-text);
        font-weight: 500;
    }

    .tasks-mobile-bar-add-btn {
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        min-width: 44px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: var(--color-primary) !important;
        color: white !important;
        border: none;
        border-radius: var(--radius-md);
        font-size: 1.5rem;
        font-weight: 400;
        line-height: 1;
        cursor: pointer;
        transition: background 0.15s, transform 0.1s;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .tasks-mobile-bar-add-btn:hover {
        background: var(--color-primary-dark) !important;
    }

    .tasks-mobile-bar-add-btn:active {
        transform: scale(0.96);
    }

    /* Pad tasks content so list doesn't hide behind fixed bar */
    #tasksPanel .list-section--tasks {
        padding-bottom: 80px;
    }

    /* No scrollbar gutter on mobile - avoids right padding */
    .list-section--tasks {
        scrollbar-gutter: auto;
        overflow-x: hidden;
    }


    /* List header - stack on mobile (for other panels) */
    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .list-header-actions {
        width: 100%;
    }

    .filter-tabs {
        width: 100%;
    }

    .filter-tab {
        flex: 1;
        min-height: 44px;
        text-align: center;
    }
}

/* When detail is open, content stays full width; panel sits on right half */

/* Legacy (unused with new layout) */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
    animation: fadeInDown 0.6s ease;
}

.logo {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 400;
    font-style: italic;
    color: var(--color-text);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.tagline {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
}

/* Main Navigation */
.main-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    background: var(--color-surface);
    padding: 6px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    animation: fadeInDown 0.5s ease 0.1s both;
}

.nav-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

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

.nav-tab.active {
    background: var(--color-accent);
    color: white;
    box-shadow: var(--shadow-sm);
}

.nav-tab.active[data-tab="metrics"] {
    background: var(--color-metric);
}

.nav-tab.active[data-tab="data"] {
    background: var(--color-text-muted);
}

.nav-icon {
    font-size: 1.1rem;
}

/* Tab Panels */
.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Form Section */
.form-section {
    animation: fadeInUp 0.5s ease 0.1s both;
    position: relative;
    z-index: 50;
}

.add-btn {
    display: none; /* Hidden - using quick-add instead */
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 18px 24px;
    background: var(--color-surface);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--color-text-secondary);
    transition: all var(--transition);
}

.add-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: rgba(196, 93, 58, 0.03);
}

.add-btn--goal:hover {
    border-color: var(--color-metric);
    color: var(--color-metric);
    background: rgba(91, 107, 187, 0.03);
}

.add-btn--metric:hover {
    border-color: var(--color-metric);
    color: var(--color-metric);
    background: rgba(91, 107, 187, 0.03);
}

.add-btn.hidden {
    display: none;
}

/* Add button in list header (top of list view) */
.add-btn--list {
    display: inline-flex;
    width: auto;
    padding: 8px 14px;
    font-size: 0.9rem;
}

.plus-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--color-bg-warm);
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 500;
    transition: all var(--transition);
}

.add-btn:hover .plus-icon {
    background: var(--color-accent);
    color: white;
}

.add-btn--goal:hover .plus-icon {
    background: var(--color-metric);
    color: white;
}

.add-btn--metric:hover .plus-icon {
    background: var(--color-metric);
    color: white;
}

/* Item Form */
.item-form {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    animation: formSlideIn 0.3s ease;
    overflow: visible;
}

.item-form.hidden {
    display: none;
}

@keyframes formSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.form-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
}

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

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

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

.form-group.hidden {
    display: none;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--color-text);
    transition: all var(--transition);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B6560' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Native appearance for selects that need reliable dropdown behavior (e.g. Latency) */
.form-group select.form-select-native {
    appearance: auto;
    -webkit-appearance: menulist;
    background-image: none;
    padding-right: 16px;
}

.form-group select[multiple] {
    appearance: auto;
    background-image: none;
    padding-right: 16px;
    min-height: 100px;
    resize: vertical;
}

.form-group select[multiple] option {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
}

.form-group select[multiple] option:checked {
    background: linear-gradient(0deg, var(--color-accent) 0%, var(--color-accent) 100%);
    color: white;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 6px;
}

.dimension-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.form-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--color-text);
    cursor: pointer;
}

.form-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* GA4 Dimension Selector Component */
.ga4-dimension-selector {
    position: relative;
}

.ga4-dimension-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0;
}

.ga4-dimension-tags:not(:empty) {
    margin-bottom: 10px;
}

.ga4-dimension-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 12px;
    background: linear-gradient(135deg, rgba(234, 67, 53, 0.12), rgba(251, 188, 5, 0.12));
    color: #C04A3E;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    animation: tagPopIn 0.2s ease;
    border: 1px solid rgba(234, 67, 53, 0.2);
}

.ga4-dimension-tag-name {
    font-weight: 600;
}

.ga4-dimension-tag-api {
    font-size: 0.7rem;
    opacity: 0.7;
    font-family: 'SF Mono', Monaco, monospace;
}

.ga4-dimension-tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    transition: all var(--transition);
    padding: 0;
}

.ga4-dimension-tag-remove:hover {
    background: rgba(0, 0, 0, 0.2);
}

.btn-add-dimension {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--color-bg);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-add-dimension:hover {
    border-color: #EA4335;
    color: #EA4335;
    background: rgba(234, 67, 53, 0.05);
}

.btn-add-dimension:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-add-icon {
    font-size: 1rem;
    font-weight: 600;
}

.ga4-dimension-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 4px;
    background: white;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 300px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ga4-dimension-dropdown.hidden {
    display: none;
}

.ga4-dimension-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-bg);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text);
}

.ga4-dimension-dropdown-close {
    padding: 4px 12px;
    background: #EA4335;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.ga4-dimension-dropdown-close:hover {
    background: #C5362D;
}

.ga4-dimension-dropdown-search {
    padding: 10px;
    border-bottom: 1px solid var(--color-border-light);
}

.ga4-dimension-dropdown-search input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.ga4-dimension-dropdown-search input:focus {
    outline: none;
    border-color: #EA4335;
}

.ga4-dimension-dropdown-list {
    overflow-y: auto;
    max-height: 280px;
    padding: 8px;
}

.ga4-dimension-dropdown-category {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    padding: 8px 10px 4px;
    margin-top: 8px;
}

.ga4-dimension-dropdown-category:first-child {
    margin-top: 0;
}

.ga4-dimension-dropdown-item {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.ga4-dimension-dropdown-item:hover {
    background: rgba(234, 67, 53, 0.08);
}

.ga4-dimension-dropdown-item.selected {
    background: rgba(234, 67, 53, 0.15);
}

.ga4-dimension-dropdown-item-name {
    font-weight: 500;
    color: var(--color-text);
}

.ga4-dimension-dropdown-item-api {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-family: 'SF Mono', Monaco, monospace;
}

.ga4-dimension-dropdown-empty {
    padding: 20px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.ga4-dimension-dropdown-loading {
    padding: 20px;
    text-align: center;
    color: var(--color-text-muted);
}

/* Query Input Component */
.query-input-wrapper {
    position: relative;
}

.query-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
    transition: all var(--transition);
}

.query-input:focus {
    outline: none;
    border-color: var(--color-metric);
    background: white;
    box-shadow: 0 0 0 3px rgba(91, 107, 187, 0.1);
}

.query-input::placeholder {
    color: var(--color-text-muted);
    font-family: var(--font-sans);
}

.query-dropdown {
    position: absolute;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    min-width: 200px;
}

.query-dropdown.hidden {
    display: none;
}

.query-dropdown-header {
    padding: 8px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-bg);
}

.query-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background var(--transition);
}

.query-dropdown-item:hover,
.query-dropdown-item.selected {
    background: var(--color-bg);
}

.query-dropdown-item-icon {
    font-size: 0.8rem;
    color: var(--color-metric);
}

.query-dropdown-item-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--color-text);
}

.query-dropdown-item-source {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.query-dropdown-empty {
    padding: 16px 12px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Tag Picker Component */
.tag-picker {
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    transition: all var(--transition);
}

.tag-picker:focus-within {
    border-color: var(--color-accent);
    background: white;
    box-shadow: 0 0 0 3px rgba(196, 93, 58, 0.1);
}

.tag-picker-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0;
}

.tag-picker-tags:not(:empty) {
    margin-bottom: 8px;
}

.detail-panel-project-tag--builtin {
    background: var(--color-border-light);
    color: var(--color-text-secondary);
}

.task-projects-picker {
    position: relative;
}

.task-projects-picker .tag-picker-input {
    min-width: 120px;
}

.task-projects-select,
.detail-panel-projects-select {
    margin-top: 6px;
    max-width: 240px;
}

.task-projects-picker .tag-picker-dropdown,
.tag-picker-dropdown--projects {
    z-index: 100;
}

.detail-panel-projects-picker .tag-picker-dropdown {
    z-index: 100;
}

.tag-picker-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    animation: tagPopIn 0.2s ease;
}

@keyframes tagPopIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tag-picker-tag--goal {
    background: var(--color-metric-bg);
    color: var(--color-metric);
}

.tag-picker-tag--task {
    background: rgba(196, 93, 58, 0.15);
    color: var(--color-accent);
}

.tag-picker-tag--metric {
    background: var(--color-metric-bg);
    color: var(--color-metric);
}

.tag-picker-tag-icon {
    font-size: 0.7rem;
}

.tag-picker-tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    transition: all var(--transition);
    padding: 0;
}

.tag-picker-tag-remove:hover {
    background: rgba(0, 0, 0, 0.2);
}

.tag-picker-input-wrapper {
    position: relative;
}

.tag-picker-input {
    width: 100%;
    padding: 6px 0;
    background: transparent;
    border: none;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--color-text);
}

.tag-picker-input:focus {
    outline: none;
}

.tag-picker-input::placeholder {
    color: var(--color-text-muted);
}

.tag-picker-dropdown {
    position: absolute;
    top: 100%;
    left: -12px;
    right: -12px;
    margin-top: 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
}

.tag-picker {
    position: relative;
    z-index: 10;
}

.tag-picker:focus-within {
    z-index: 100;
}

.tag-picker-dropdown.hidden {
    display: none;
}

.tag-picker-dropdown-group {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-light);
}

.tag-picker-dropdown-group:last-child {
    border-bottom: none;
}

.tag-picker-dropdown-label {
    padding: 6px 14px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag-picker-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition);
}

.tag-picker-dropdown-item:hover {
    background: var(--color-bg);
}

.tag-picker-dropdown-item-icon {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.tag-picker-dropdown-item--goal .tag-picker-dropdown-item-icon {
    color: var(--color-metric);
}

.tag-picker-dropdown-item--task .tag-picker-dropdown-item-icon {
    color: var(--color-accent);
}

.tag-picker-dropdown-item--metric .tag-picker-dropdown-item-icon {
    color: var(--color-metric);
}

.tag-picker-dropdown-item-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--color-text);
}

.tag-picker-dropdown-empty {
    padding: 16px 14px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-accent);
    background: white;
    box-shadow: 0 0 0 3px rgba(196, 93, 58, 0.1);
}

#metricsPanel .form-group input:focus,
#metricsPanel .form-group textarea:focus {
    border-color: var(--color-metric);
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border-light);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
}

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

.btn-primary:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-primary--goal {
    background: var(--color-metric);
}

.btn-primary--goal:hover {
    background: var(--color-metric-hover);
}

.btn-primary--metric {
    background: var(--color-metric);
}

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

.btn-secondary {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

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

/* List Section */
.list-section {
    animation: fadeInUp 0.5s ease 0.2s both;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.list-header h2 {
    font-family: var(--font-sans);
    font-size: 1.75rem;
    font-weight: 500;
    line-height: 1.35;
    min-height: 1.35em;
    margin: 0;
}

.project-title-block {
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-title-star-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-muted);
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--transition), color var(--transition);
}

.project-title-star-btn:hover {
    opacity: 1;
}

.project-title-star-btn.starred {
    color: var(--color-accent);
    opacity: 1;
}

.project-title-dropdown {
    position: relative;
    flex-shrink: 0;
}

.project-title-menu-trigger {
    width: 28px;
    height: 28px;
    font-size: 1.25rem;
}

.project-title-editable {
    cursor: text;
    padding: 2px 6px;
    margin: -2px -6px;
    border-radius: var(--radius-sm);
}

.project-title-editable:hover {
    background: var(--color-bg-warm);
}

.project-title-input {
    font-family: var(--font-sans);
    font-size: 1.75rem;
    font-weight: 500;
    line-height: 1.35;
    height: 1.35em;
    width: 100%;
    min-width: 120px;
    padding: 0 6px;
    margin: 0;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    background: transparent;
    box-sizing: border-box;
}

.project-title-input:hover {
    background: var(--color-bg-warm);
}

.project-title-input:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    background: white;
}

.list-header-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: -8px;
    margin-bottom: 16px;
}

.list-header-actions--tasks {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* Metrics View mode sections */
.metrics-view-section {
    margin-bottom: 2rem;
}

.metrics-view-section:last-child {
    margin-bottom: 0;
}

.metrics-view-hint {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0 0 1rem 0;
}

.metrics-view-list-wrap {
    margin-top: 0.5rem;
}

.metrics-view-task-goals .goals-derived-icon {
    color: var(--color-accent);
}

/* Detail panel: settings button and back to view */
.detail-panel-header-settings-btn {
    padding: 6px 10px;
    margin-right: 8px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s, color 0.15s;
}

.detail-panel-header-settings-btn:hover {
    background: var(--color-bg-warm);
    color: var(--color-text);
}

.detail-panel-metric-back-wrap {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border-light);
}

.detail-panel-back-to-view-btn {
    font-size: 0.9rem;
}

/* Goals tab: read-only derived list + detail (used in Metrics View mode) */
.goals-readonly-hint {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0 0 1rem 0;
}

.goals-readonly-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 768px) {
    .goals-readonly-layout {
        grid-template-columns: 1fr;
    }
}

.goals-derived-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.goals-derived-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.goals-derived-item:hover {
    background: var(--color-bg-warm);
    border-color: var(--color-border);
}

.goals-derived-item--subgoal {
    margin-left: 20px;
    padding-left: 12px;
    border-left: 3px solid var(--color-border);
}

.goals-derived-item.goals-item--selected {
    border-color: var(--color-metric);
    background: rgba(91, 107, 187, 0.08);
}

.goals-derived-icon {
    font-size: 1rem;
    color: var(--color-metric);
}

.goals-derived-name {
    flex: 1;
    font-weight: 500;
    color: var(--color-text);
}

.goals-derived-count {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.goals-derived-count-sep {
    margin: 0 4px;
    color: var(--color-text-muted);
    opacity: 0.7;
}

.goals-derived-count-active {
    color: var(--color-text-muted);
}

.goals-derived-count-completed {
    color: var(--color-text-muted);
    font-style: italic;
}

.goals-derived-item--completed .goals-derived-name,
.goals-derived-item--completed .goals-derived-icon {
    opacity: 0.7;
}

.goals-derived-item--completed .goals-derived-count-completed {
    color: var(--color-success, #2d7d46);
}

.goals-readonly-detail.hidden {
    display: none;
}

.goals-readonly-detail {
    padding: 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
}

.goals-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 8px;
}

.goals-detail-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--color-text);
}

.goals-detail-chart-wrap {
    margin-bottom: 1rem;
    overflow: visible;
}

.goals-detail-chart-wrap.hidden {
    display: none;
}

.goals-detail-chart-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin: 0 0 8px 0;
}

.goals-detail-chart-title-source {
    font-size: 0.8em;
    font-weight: 500;
    color: var(--color-text-muted);
}

.goals-detail-chart {
    width: 100%;
    padding: 0 8px;
    box-sizing: border-box;
    overflow: visible;
}

.goals-detail-chart-svg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100px;
    overflow: visible;
}

.goals-detail-chart-area {
    fill: var(--color-metric);
    opacity: 0.15;
}

.goals-detail-chart--tasks .goals-detail-chart-area {
    fill: var(--color-accent);
}

.goals-detail-chart-line {
    stroke: var(--color-metric);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.goals-detail-chart--tasks .goals-detail-chart-line {
    stroke: var(--color-accent);
}

.goals-detail-chart-point {
    fill: var(--color-metric);
}

.goals-detail-chart--tasks .goals-detail-chart-point {
    fill: var(--color-accent);
}

.goals-detail-chart--tasks .goals-detail-chart-point-hit {
    fill: transparent;
}

.goals-detail-chart-has-tooltip {
    position: relative;
}

.goals-detail-chart-tooltip-floating {
    position: fixed;
    z-index: 10000;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease;
    white-space: nowrap;
}

.goals-detail-chart-tooltip-floating.is-visible {
    opacity: 1;
}

.goals-detail-chart-tooltip {
    position: fixed;
    z-index: 100;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease;
}

.goals-detail-chart-tooltip.is-visible {
    opacity: 1;
}

.goals-detail-chart-tooltip-bg {
    fill: var(--color-bg);
    stroke: var(--color-border);
    stroke-width: 1;
}

.goals-detail-chart-tooltip-text {
    font-size: 9px;
    font-weight: 500;
    fill: var(--color-text);
}

.goals-detail-chart-point {
    cursor: pointer;
}

.goals-detail-chart-point-hit {
    fill: transparent;
}

.goals-detail-chart-y-label {
    font-size: 9px;
    fill: var(--color-text-muted);
}

.goals-detail-chart-label {
    font-size: 10px;
    fill: var(--color-text-muted);
}

.goals-detail-chart-x-label {
    font-size: 8px;
    fill: var(--color-text-muted);
}

/* Metric detail chart: date range and task markers */
.metric-chart-section {
    margin-top: 0.5rem;
}

.metric-chart-date-range {
    margin-bottom: 8px;
}

.metric-chart-granularity {
    margin-bottom: 12px;
}

.metric-chart-granularity-select {
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--color-text);
    background: var(--color-bg);
}

.metric-chart-granularity-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.metric-chart-date-range-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.metric-chart-preset {
    font-size: 0.8rem;
    padding: 4px 10px;
}

.metric-chart-date-input {
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--color-text);
    background: var(--color-bg);
}

.metric-chart-date-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.metric-chart-task-marker {
    cursor: pointer;
    outline: none;
}

.metric-chart-task-marker:focus {
    outline: none;
}

.metric-chart-task-marker:focus-visible .metric-chart-task-marker-pill {
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 2;
}

.metric-chart-task-marker-pill {
    fill: var(--color-primary, #6366f1);
    stroke: none;
    cursor: pointer;
}

.metric-chart-task-marker:hover .metric-chart-task-marker-pill {
    fill: var(--color-primary-hover, #4f46e5);
}

.metric-chart-task-marker-icon {
    fill: white;
}

.metric-chart-task-marker-hit {
    cursor: pointer;
}

.metric-chart-task-marker-popup {
    position: fixed;
    z-index: 10001;
    min-width: 160px;
    max-width: 280px;
    max-height: 240px;
    overflow-y: auto;
    padding: 6px 0;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.metric-chart-task-marker-popup-list {
    list-style: none;
    margin: 0;
    padding: 0;
    pointer-events: auto;
}

.metric-chart-task-marker-popup-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    font-size: 0.9rem;
    color: var(--color-text);
    background: none;
    border: none;
    cursor: pointer;
}

.metric-chart-task-marker-popup-item:hover {
    background: var(--color-bg-hover, rgba(0, 0, 0, 0.05));
}

.goals-task-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.goals-detail-by-actual {
    list-style: none;
    margin: 0 0 1rem 0;
    padding: 0 0 1rem 0;
    border-bottom: 1px solid var(--color-border-light);
}

.goals-detail-by-actual:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.goals-detail-actual-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 6px;
}

.goals-task-list-by-goal {
    list-style: none;
    margin: 0;
    padding: 0;
}

.goals-task-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px 0;
}

.goals-task-item-icon {
    flex-shrink: 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    width: 1.2em;
}

.goals-task-item--completed .goals-task-item-icon {
    color: var(--color-success, #2d7d46);
}

.goals-task-item--completed .goals-task-link {
    color: var(--color-text-muted);
}

.goals-task-link {
    display: block;
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.15s;
}

.goals-task-link:hover {
    background: var(--color-bg-warm);
}

.goals-task-item--completed .goals-task-link:hover {
    color: var(--color-text);
}

.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--color-bg-warm);
    padding: 4px;
    border-radius: var(--radius-md);
}

.filter-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.filter-tab:hover {
    color: var(--color-text);
}

.filter-tab.active {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

/* Mobile tasks bar - hidden on desktop */
.tasks-mobile-bar {
    display: none;
}

/* Items List */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 0; /* No gap - items use border-bottom */
}

/* Item (Task/Goal) - Spreadsheet Row Style */
.item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-surface);
    cursor: pointer;
    transition: background var(--transition);
    gap: 10px;
}

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

.item.completed {
    opacity: 0.6;
}

.item.completed .item-name {
    color: var(--color-text-muted);
}

/* Item columns */
.item-col-checkbox {
    flex: 0 0 24px;
}

.item-col-name {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}


.item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    cursor: text;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.item-name:hover {
    background: var(--color-bg-warm);
}

@media (max-width: 768px) {
    /* Tasks: no hover on name (opens detail, not inline edit) */
    .list-section--tasks .item .item-name:hover {
        background: transparent;
    }
}

.item-name-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    background: transparent;
    box-sizing: border-box;
}

.item-name-input:hover {
    border-color: var(--color-border);
    background: var(--color-bg);
}

.item-name-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: white;
}

.item-col-priority {
    flex: 0 0 var(--task-col-priority-width, 105px);
    min-width: 0;
    align-self: stretch;
    display: flex;
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.item-col-priority:hover {
    background: var(--color-bg-warm);
}

.item-col-assignee {
    flex: 0 0 var(--task-col-assignee-width, 100px);
    min-width: 0;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.item-col-assignee:hover {
    background: var(--color-bg-warm);
}

.item-col-assignee .item-col-empty.item-assignee-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

.item-col-assignee .item-col-empty.item-assignee-add-btn:hover {
    color: var(--color-text-secondary);
    background: var(--color-bg-warm);
}

.item-assignee-add-icon {
    display: block;
}

.item-assignee-display {
    padding: 2px 4px;
}

.item-col-due {
    flex: 0 0 var(--task-col-due-width, 135px);
    min-width: 0;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.item-col-due:hover {
    background: var(--color-bg-warm);
}

.item-col-due.overdue {
    color: #DC2626;
}

.item-col-due .item-col-empty.item-due-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

.item-col-due .item-col-empty.item-due-add-btn:hover {
    color: var(--color-text-secondary);
    background: var(--color-bg-warm);
}

.item-due-add-icon {
    display: block;
}

.item-due-display {
    padding: 2px 4px;
}

.item-due-display.item-due--today,
.item-due-display.item-due--tomorrow {
    color: #16a34a;
}

.item-due-input {
    width: 100%;
    min-width: 110px;
    max-width: 120px;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: inherit;
    background: transparent;
    cursor: pointer;
    box-sizing: border-box;
}

.item-due-input::-webkit-calendar-picker-indicator {
    display: none;
    -webkit-appearance: none;
}

.item-due-input::-moz-calendar-picker-indicator {
    display: none;
}

.item-due-input:hover {
    border-color: var(--color-border);
    background: var(--color-bg);
}

.item-due-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: white;
}

.item-col-goal {
    flex: 0 0 var(--task-col-goal-width, 185px);
    min-width: 0;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.item-col-goal:hover {
    background: var(--color-bg-warm);
}

.item-col-goal .item-col-empty.item-goal-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

.item-col-goal .item-col-empty.item-goal-add-btn:hover {
    color: var(--color-text-secondary);
    background: var(--color-bg-warm);
}

.item-goal-add-icon {
    display: block;
}

.item-col-actions {
    flex: 0 0 40px;
    opacity: 0;
    transition: opacity var(--transition);
    display: flex;
    justify-content: flex-end;
}

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

.item-col-empty {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Metric tags in list view (task Metric column, Goals list) – use sidebar --color-metric */
.item-goal-tag-compact,
.item-metric-tag-compact {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    background: var(--color-metric-bg);
    color: var(--color-metric);
}

.item-dimension-count {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Priority Selector - fills the list cell */
.item-col-priority .priority-selector {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
}

.priority-selector {
    position: relative;
    display: inline-block;
}

.item-col-priority .priority-badge {
    flex: 1;
    width: 100%;
    min-height: 0;
    max-height: 28px;
    justify-content: center;
    border-radius: var(--radius-sm);
    padding: 4px 10px;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    border: none;
    background: none;
    transition: all var(--transition);
}


.priority-badge--unset {
    background: transparent;
    color: var(--color-text-muted);
}

.item-col-priority .priority-badge--unset {
    justify-content: flex-start;
}

.priority-badge--unset .item-priority-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: 2px;
    color: var(--color-text-muted);
}

.priority-badge--unset .item-priority-add-btn:hover {
    color: var(--color-text-secondary);
}

.item-priority-add-icon {
    display: block;
}

.priority-badge--low {
    background: rgba(34, 197, 94, 0.15);
    color: #000;
}

.priority-badge--medium {
    background: rgba(250, 204, 21, 0.28);
    color: #000;
}

.priority-badge--high {
    background: rgba(234, 88, 12, 0.2);
    color: #000;
}

.priority-badge--critical {
    background: rgba(239, 68, 68, 0.15);
    color: #000;
}

.priority-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    min-width: 120px;
    overflow: hidden;
}

.priority-dropdown.hidden {
    display: none;
}

/* Portal wrapper: dropdown is positioned by wrapper, not absolute within it */
.priority-dropdown-open .priority-dropdown {
    position: static;
    margin: 0;
}

.priority-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background var(--transition);
}

.priority-option:hover {
    background: var(--color-bg);
}

.priority-option.selected {
    background: var(--color-bg);
    font-weight: 600;
}

.goal-dropdown-option.selected {
    background: var(--color-bg);
    font-weight: 600;
}

/* Goal picker: search box + autocomplete (max 5 results) */
.goal-picker {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.goal-picker-input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 0.95rem;
    border: none;
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
    box-sizing: border-box;
}

.goal-picker-input::placeholder {
    color: var(--color-text-muted);
}

.goal-picker-results {
    max-height: 200px;
    overflow-y: auto;
}

.goal-picker-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--color-text);
}

.goal-picker-option:hover {
    background: var(--color-bg-warm);
}

.goal-picker-option.selected {
    background: var(--color-bg);
    font-weight: 600;
}

.goal-picker-option-icon {
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.assignee-picker-option-icon,
.source-picker-option-icon {
    flex-shrink: 0;
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
}

.assignee-picker-icon-svg,
.source-picker-icon-svg {
    display: block;
}

.goal-picker-empty {
    padding: 12px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Goal dimension value pickers (under Goal when metric has dimensions with options) */
.detail-panel-goal-dimension-fields {
    margin-top: 0;
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.detail-panel-goal-dimension-field .detail-panel-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}
.detail-panel-goal-dimension-picker {
    position: relative;
}
.detail-panel-goal-dimension-input {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
    box-sizing: border-box;
}
.detail-panel-goal-dimension-input::placeholder {
    color: var(--color-text-muted);
}
.detail-panel-goal-dimension-input:focus {
    border-color: var(--color-primary);
}
.detail-panel-goal-dimension-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
}
.detail-panel-goal-dimension-dropdown.hidden {
    display: none;
}

.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.priority-dot--unset {
    background: #D1D5DB;
}

.priority-dot--low {
    background: #22c55e;
}

.priority-dot--medium {
    background: #facc15;
}

.priority-dot--high {
    background: #ea580c;
}

.priority-dot--critical {
    background: #EF4444;
}

/* List Column Headers */
.list-columns-header {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--color-bg);
    border-bottom: 2px solid var(--color-border-light);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    gap: 10px;
}

.list-col-grip,
.item-col-grip,
.quick-add-grip {
    flex: 0 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
}

.item-col-grip {
    cursor: grab;
    opacity: 0;
    transition: opacity 0.15s ease;
    color: var(--color-text-muted);
    align-self: stretch;
    margin-top: -10px;
    margin-bottom: -10px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.item:hover .item-col-grip {
    opacity: 0.5;
}

.item-col-grip:hover {
    opacity: 1 !important;
    color: var(--color-text);
}

.item.drag-ready .item-col-grip {
    cursor: grabbing;
    opacity: 1;
}

.item.dragging {
    opacity: 0.25;
    background: var(--color-bg);
}

.grip-icon {
    display: block;
}

/* Drag preview (floating box with task name near cursor) */
.drag-preview {
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border-light, #e0e0e0);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text, #222);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 10000;
}

/* Drop indicator line */
.drop-indicator {
    height: 2px;
    background: var(--color-primary, #4f46e5);
    border-radius: 1px;
    position: relative;
    pointer-events: none;
    margin: -1px 0;
}

.drop-indicator::before {
    content: '';
    position: absolute;
    left: 0;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary, #4f46e5);
}

.list-col-checkbox {
    flex: 0 0 24px;
}

.list-col-name {
    flex: 1;
    min-width: 0;
}

.list-col-assignee {
    flex: 0 0 var(--task-col-assignee-width, 100px);
    min-width: 0;
    cursor: pointer;
    user-select: none;
}

.list-col-assignee:hover {
    color: var(--color-text);
}

.list-col-priority {
    flex: 0 0 var(--task-col-priority-width, 105px);
    min-width: 0;
    cursor: pointer;
    user-select: none;
}

.list-col-due {
    flex: 0 0 var(--task-col-due-width, 135px);
    min-width: 0;
    cursor: pointer;
    user-select: none;
}

.list-col-due:hover {
    color: var(--color-text);
}

.list-col-due.sorted::after {
    content: ' ↓';
}

.list-col-due.sorted.asc::after {
    content: ' ↑';
}

.list-col-priority:hover {
    color: var(--color-text);
}

.list-col-priority.sorted::after {
    content: ' ↓';
}

.list-col-priority.sorted.asc::after {
    content: ' ↑';
}

.list-col-goal {
    flex: 0 0 var(--task-col-goal-width, 185px);
    min-width: 0;
}

.list-section--tasks .list-columns-header--tasks .list-col-goal,
.list-section--tasks .item-col-goal {
    margin-left: 24px;
}

.list-col-actions {
    flex: 0 0 36px;
}

/* Resizable columns */
.resizable-col {
    position: relative;
    overflow: visible;
}

.col-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 12px;
    cursor: col-resize;
    z-index: 10;
}

.col-resize-handle::after {
    content: '';
    position: absolute;
    top: 15%;
    bottom: 15%;
    left: 5px;
    width: 2px;
    background: var(--color-text-muted);
    border-radius: 1px;
    opacity: 0.5;
}

.col-resize-handle:hover::after,
.col-resize-handle.resizing::after {
    background: var(--color-accent);
    width: 3px;
    opacity: 1;
}

.col-resize-handle:hover {
    background: rgba(196, 93, 58, 0.08);
}

.col-resize-handle.resizing {
    background: rgba(196, 93, 58, 0.15);
}

/* Tasks panel: sidebar + main */
.tasks-panel-layout {
    display: flex;
    gap: 24px;
    min-width: 0;
}

.projects-sidebar {
    flex: 0 0 200px;
    min-width: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 0;
    box-shadow: var(--shadow-sm);
}

.projects-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 8px;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 8px;
}

.projects-sidebar-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.projects-add-btn {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--color-border-light);
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.projects-add-btn:hover {
    background: var(--color-accent);
    color: white;
}

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

.projects-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.projects-item:hover {
    background: var(--color-bg-warm);
}

.projects-item.active {
    background: rgba(196, 93, 58, 0.12);
    color: var(--color-accent);
}

.projects-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}

/* Projects page */
/* Project row dropdown menu (replaces inline delete button) */
.projects-item-dropdown {
    position: relative;
    flex-shrink: 0;
}

.projects-item-menu-trigger {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity var(--transition), background var(--transition);
}

.projects-item-menu-trigger:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.08);
}

.projects-item-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 160px;
    padding: 4px 0;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 100;
}

.projects-item-dropdown.is-open .projects-item-menu,
.project-title-dropdown.is-open .projects-item-menu {
    display: block;
}

/* Project title menu opens to the right so it isn't clipped by list-section overflow */
.project-title-dropdown.is-open .projects-item-menu {
    right: auto;
    left: 100%;
    margin-left: 4px;
}

.projects-item-menu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 0;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    text-align: left;
    color: var(--color-text);
    cursor: pointer;
    transition: background var(--transition);
}

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

.projects-item-menu-item--delete {
    color: var(--color-danger, #b91c1c);
}

.projects-item-menu-item--delete:hover {
    background: rgba(185, 28, 28, 0.08);
}

.tasks-panel-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Wider task list - reserve scrollbar space to avoid horizontal shift */
.list-section--tasks {
    min-width: 0;
    overflow-x: auto;
    overflow-y: auto;
    scrollbar-gutter: stable;
    --task-col-assignee-width: 100px;
    --task-col-due-width: 135px;
    --task-col-priority-width: 105px;
    --task-col-goal-width: 185px;
}

.list-section--tasks .list-columns-header--tasks,
.list-section--tasks .items-list--tasks,
.list-section--tasks .quick-add-row--tasks {
    min-width: 0;
}

.items-list--tasks .item {
    min-width: 0;
    min-height: 48px;
}

.quick-add-row--tasks {
    min-width: 0;
}

/* Match task list: spacer same width as checkbox column (24px) so name aligns with task names */
.quick-add-row--tasks .quick-add-spacer {
    flex: 0 0 24px;
    min-width: 24px;
}

.quick-add-row--tasks .quick-add-input {
    min-width: 0;
}

.quick-add-row--tasks .quick-add-assignee {
    flex: 0 0 var(--task-col-assignee-width, 100px);
}

.quick-add-row--tasks .quick-add-priority {
    flex: 0 0 var(--task-col-priority-width, 105px);
}

.quick-add-row--tasks .quick-add-due {
    flex: 0 0 var(--task-col-due-width, 135px);
}

.quick-add-row--tasks .quick-add-goal {
    flex: 0 0 var(--task-col-goal-width, 185px);
}

.quick-add-row--tasks .quick-add-actions {
    flex: 0 0 36px;
}

/* Quick Add Row */
.quick-add-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-surface);
    gap: 10px;
}

.quick-add-row--tasks:hover {
    background: var(--color-bg);
    cursor: pointer;
}

.quick-add-row--tasks .quick-add-input {
    cursor: pointer;
}

.quick-add-row--tasks .quick-add-input:focus {
    cursor: text;
}

/* Metrics quick-add: same UX as tasks (align columns, hover, pointer) */
.quick-add-row--metrics {
    min-width: 0;
}

.quick-add-row--metrics .quick-add-input {
    flex: 1;
    min-width: 0;
    cursor: pointer;
    padding-left: calc(1.25rem + 8px); /* align with metric names (icon + gap) */
}

.quick-add-row--metrics .quick-add-input:focus {
    cursor: text;
}

.quick-add-row--metrics .quick-add-goal {
    flex: 0 0 160px;
}

.quick-add-row--metrics .quick-add-actions {
    flex: 0 0 36px;
}

.quick-add-row--metrics:hover {
    background: var(--color-bg);
    cursor: pointer;
}

/* Data sources list: status column (like projects star) */
.list-col-status {
    flex: 0 0 36px;
}

.item-col-status {
    flex: 0 0 36px;
    display: flex;
    align-items: center;
}

/* Data sources list: source column (icon) */
.list-col-source {
    flex: 0 0 48px;
}

.item-col-source {
    flex: 0 0 48px;
    display: flex;
    align-items: center;
}

.data-source-list-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
}

.data-source-list-icon--csv {
    background: rgba(107, 114, 128, 0.15);
    color: #6B7280;
}

.data-source-list-icon--ga4 {
    background: rgba(234, 179, 8, 0.2);
    color: #CA8A04;
}

.data-source-list-icon--pagespeed {
    background: rgba(34, 197, 94, 0.15);
    color: #16A34A;
}

.data-source-list-icon--github {
    background: rgba(31, 41, 55, 0.15);
    color: #1F2937;
}

.data-source-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.data-source-status-dot--green {
    background: #22c55e;
}

.data-source-status-dot--yellow {
    background: #eab308;
}

.data-source-status-dot--red {
    background: #ef4444;
}

.data-source-status-dot--grey {
    background: var(--color-text-muted);
    opacity: 0.5;
}

.data-source-status-dot--pending {
    background: var(--color-text-muted);
    opacity: 0.6;
    animation: data-source-status-pulse 1.2s ease-in-out infinite;
}

@keyframes data-source-status-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

/* Data sources list and quick-add (Name + Actions only) */
.list-columns-header--data,
.items-list--data .item,
.quick-add-row--data {
    min-width: 0;
}

/* Data sources list: no hover on row, source icon, or name */
.items-list--data .item:hover,
.items-list--data .item .item-col-source:hover,
.items-list--data .item .item-name:hover {
    background: transparent;
}

.quick-add-row--data .quick-add-input {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.quick-add-row--data .quick-add-input:focus {
    cursor: text;
}

.quick-add-row--data .quick-add-actions {
    flex: 0 0 36px;
}

.quick-add-row--data:hover {
    background: var(--color-bg);
    cursor: pointer;
}

.add-btn--data:hover {
    border-color: var(--color-source);
    color: var(--color-source);
    background: rgba(42, 157, 143, 0.03);
}

.add-btn--data:hover .plus-icon {
    background: var(--color-source);
    color: white;
}

.quick-add-checkbox {
    flex: 0 0 24px;
    width: 24px;
    height: 20px;
    border: 2px dashed var(--color-border);
    border-radius: 4px;
    opacity: 0.5;
}

.quick-add-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 0.9rem;
    color: var(--color-text);
    padding: 4px 0;
    outline: none;
}

.quick-add-input::placeholder {
    color: var(--color-text-muted);
}

.quick-add-input:focus::placeholder {
    color: transparent;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--color-text);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.item.completed .item-name {
    color: var(--color-text-muted);
}

/* Goal Item Styling */
.item.goal-item {
    /* No special styling in spreadsheet view */
}

.item.goal-item.completed {
    /* Completed styling inherited from .item.completed */
}

/* Metric Item Styling */
.item.metric-item {
    /* No special styling in spreadsheet view */
}

/* Checkbox */
.item-checkbox {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.item-checkbox:hover {
    border-color: var(--color-success);
}

.item.completed .item-checkbox {
    background: var(--color-success);
    border-color: var(--color-success);
}

.item-checkbox::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition);
}

.item.completed .item-checkbox::after {
    opacity: 1;
    transform: scale(1);
}

/* Completion animation */
.item-completing {
    animation: item-completing 0.5s ease-out;
}

.item-completing-exit {
    animation: item-completing-exit 0.3s ease-out forwards;
}

@keyframes item-completing {
    0% { background: transparent; }
    25% { background: rgba(74, 124, 89, 0.25); }
    100% { background: transparent; }
}

@keyframes item-completing-exit {
    to {
        opacity: 0;
        transform: translateY(-12px);
    }
}

/* Item Content */
.item-content {
    display: none; /* Old content wrapper - no longer used in list view */
}

.item-description {
    display: none; /* Hidden in list view, shown in detail panel */
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.item-meta {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 4px;
}

.item-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.item-date::before {
    content: '✓';
    font-size: 0.7rem;
    color: var(--color-success);
}

/* Goal Tags on Tasks */
.item-goal-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--color-metric-bg);
    color: var(--color-metric);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 4px;
    margin-bottom: 4px;
}

.item-goal-tag::before {
    content: '';
}

/* Task Tags on Tasks */
.item-task-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(196, 93, 58, 0.1);
    color: var(--color-accent);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 4px;
    margin-bottom: 4px;
}

.item-task-tag::before {
    content: '';
}

/* Parent Goal Tags on Goals */
.item-parent-goal-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--color-metric-bg);
    color: var(--color-metric);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 4px;
    margin-bottom: 4px;
}

.item-parent-goal-tag::before {
    content: '↑';
    font-size: 0.7rem;
}

/* Metric Tag on Goals */
.item-metric-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--color-metric-bg);
    color: var(--color-metric);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 4px;
    margin-bottom: 4px;
}

/* Dimension Tag on Metrics (dimensions from Sources) */
.item-dimension-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(42, 157, 143, 0.08);
    color: var(--color-source);
    border: 1px dashed rgba(42, 157, 143, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 4px;
    margin-bottom: 4px;
}

.item-dimension-tag--ga4 {
    background: linear-gradient(135deg, rgba(234, 67, 53, 0.08), rgba(251, 188, 5, 0.08));
    color: #C04A3E;
    border: 1px solid rgba(234, 67, 53, 0.2);
    border-style: solid;
}

.item-dimension-tag--ga4::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #EA4335, #FBBC05);
    border-radius: 50%;
    margin-right: 2px;
}

/* Dimension tag (metric-specific) — dashed teal */
.item-dimension-tag {
    background: rgba(42, 157, 143, 0.06);
    color: var(--color-source);
    border: 1px dashed rgba(42, 157, 143, 0.45);
    border-radius: 20px;
}

.dropdown-item-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
    font-weight: 600;
}

.tag-picker-input-wrapper--with-dropdown .tag-picker-dropdown {
    z-index: 10;
}

/* Query Display on Goals */
.item-query {
    margin: 8px 0;
    padding: 10px 12px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--color-metric);
}

.item-query code {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

.query-mention {
    color: var(--color-metric);
    font-weight: 600;
}

/* Dynamic Dimensions Container */
.dynamic-dimensions-container {
    margin-bottom: 0;
}

.dynamic-dimensions-container:not(:empty) {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(42, 157, 143, 0.05);
    border: 1px solid rgba(42, 157, 143, 0.15);
    border-radius: var(--radius-md);
}

.dynamic-dimensions-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-source);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dynamic-dimensions-header-icon {
    font-size: 0.9rem;
}

.dynamic-dimension-field {
    margin-bottom: 12px;
}

.dynamic-dimension-field:last-child {
    margin-bottom: 0;
}

.dynamic-dimension-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

.dynamic-dimension-field label .dimension-source {
    font-weight: 400;
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

.dynamic-dimension-field input {
    width: 100%;
    padding: 10px 12px;
    background: white;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-text);
    transition: all var(--transition);
}

.dynamic-dimension-field input:focus {
    outline: none;
    border-color: var(--color-source);
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.1);
}

.dynamic-dimension-field input::placeholder {
    color: var(--color-text-muted);
}

/* Dimension Value Tags on Tasks (from Sources) */
.item-dimension-value {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(42, 157, 143, 0.1);
    color: var(--color-source);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 4px;
    margin-bottom: 4px;
}

.item-dimension-value-name {
    opacity: 0.7;
}

.item-dimension-value-sep {
    opacity: 0.5;
}

/* GA4 Data Section in Tasks */
.ga4-data-section {
    margin-top: 12px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(234, 67, 53, 0.05), rgba(251, 188, 5, 0.05));
    border: 1px solid rgba(234, 67, 53, 0.15);
    border-radius: var(--radius-md);
}

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

.ga4-data-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #C04A3E;
}

.btn-fetch-ga4 {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #EA4335;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-fetch-ga4:hover {
    background: #C5362D;
}

.btn-fetch-ga4:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ga4-data-loading {
    padding: 16px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.ga4-data-error {
    padding: 10px;
    background: rgba(234, 67, 53, 0.1);
    color: #C04A3E;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.ga4-data-results {
    margin-top: 8px;
}

.ga4-data-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ga4-metric-card {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    min-width: 80px;
}

.ga4-metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
}

.ga4-metric-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

.ga4-data-empty {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

/* GA4 Metrics Selector in Task Form */
.ga4-metrics-group.hidden {
    display: none;
}

.ga4-metrics-selector {
    position: relative;
}

.ga4-metrics-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0;
}

.ga4-metrics-tags:not(:empty) {
    margin-bottom: 10px;
}

.ga4-metrics-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 12px;
    background: linear-gradient(135deg, rgba(234, 67, 53, 0.12), rgba(251, 188, 5, 0.12));
    color: #C04A3E;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    animation: tagPopIn 0.2s ease;
    border: 1px solid rgba(234, 67, 53, 0.2);
}

.ga4-metrics-tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    transition: all var(--transition);
    padding: 0;
}

.ga4-metrics-tag-remove:hover {
    background: rgba(0, 0, 0, 0.2);
}

.btn-add-metric {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--color-bg);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-add-metric:hover {
    border-color: #EA4335;
    color: #EA4335;
    background: rgba(234, 67, 53, 0.05);
}

.ga4-metrics-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 4px;
    background: white;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 300px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ga4-metrics-dropdown.hidden {
    display: none;
}

.ga4-metrics-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-bg);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text);
}

.ga4-metrics-dropdown-close {
    padding: 4px 12px;
    background: #EA4335;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.ga4-metrics-dropdown-close:hover {
    background: #C5362D;
}

.ga4-metrics-dropdown-list {
    overflow-y: auto;
    max-height: 240px;
    padding: 8px;
}

.ga4-metrics-dropdown-category {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    padding: 8px 10px 4px;
    margin-top: 8px;
}

.ga4-metrics-dropdown-category:first-child {
    margin-top: 0;
}

.ga4-metrics-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.ga4-metrics-dropdown-item:hover {
    background: rgba(234, 67, 53, 0.08);
}

.ga4-metrics-dropdown-item.selected {
    background: rgba(234, 67, 53, 0.15);
}

.ga4-metrics-dropdown-item-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
    transition: all var(--transition);
}

.ga4-metrics-dropdown-item.selected .ga4-metrics-dropdown-item-checkbox {
    background: #EA4335;
    border-color: #EA4335;
}

.ga4-metrics-dropdown-item.selected .ga4-metrics-dropdown-item-checkbox::after {
    content: '✓';
}

.ga4-metrics-dropdown-item-info {
    flex: 1;
}

.ga4-metrics-dropdown-item-name {
    font-weight: 500;
    color: var(--color-text);
}

.ga4-metrics-dropdown-item-desc {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* GA4 Date Range Comparison */
.ga4-date-ranges-group.hidden {
    display: none;
}

.ga4-date-ranges {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.ga4-date-range-period {
    flex: 1;
    min-width: 300px;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: 12px;
}

.ga4-date-range-label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--color-text);
    margin-bottom: 8px;
}

.ga4-date-range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-input {
    flex: 1;
    min-width: 130px;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--color-text);
    background: white;
}

.date-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.date-separator {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* GA4 Comparison Results Display */
.ga4-comparison-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ga4-comparison-metric {
    display: flex;
    align-items: stretch;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border-light);
}

.ga4-comparison-label {
    flex: 0 0 120px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.02);
    border-right: 1px solid var(--color-border-light);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
}

.ga4-comparison-values {
    flex: 1;
    display: flex;
    align-items: center;
}

.ga4-comparison-period {
    flex: 1;
    padding: 12px;
    text-align: center;
}

.ga4-comparison-period-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.ga4-comparison-period-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
}

.ga4-comparison-change {
    flex: 0 0 100px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.02);
    border-left: 1px solid var(--color-border-light);
}

.ga4-comparison-change-value {
    font-size: 1rem;
    font-weight: 700;
}

.ga4-comparison-change-value.positive {
    color: #22C55E;
}

.ga4-comparison-change-value.negative {
    color: #EF4444;
}

.ga4-comparison-change-value.neutral {
    color: var(--color-text-muted);
}

.ga4-comparison-change-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
}

.ga4-data-dates {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    font-weight: normal;
    margin-left: 8px;
}

/* Item Actions */
.item-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity var(--transition);
}

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

.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--color-text-muted);
}

.action-btn:hover {
    background: var(--color-bg-warm);
    color: var(--color-text);
}

.action-btn.delete:hover {
    background: #FEE2E2;
    color: #DC2626;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--color-text-muted);
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-icon img {
    display: block;
    margin: 0 auto;
}

.empty-state p {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

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

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* GA4 Integration Section */
.ga4-section {
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease 0.05s both;
}

.ga4-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
}

.ga4-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ga4-logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #F9AB00 0%, #E37400 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.ga4-title {
    flex: 1;
}

.ga4-title h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 2px;
}

.ga4-title p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.ga4-actions {
    display: flex;
    gap: 8px;
}

.btn-ga4 {
    background: linear-gradient(135deg, #F9AB00 0%, #E37400 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-ga4:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 171, 0, 0.3);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* GA4 Configuration */
.ga4-config {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-light);
}

.ga4-config-info {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

.ga4-config-input {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.ga4-config-input input {
    flex: 1;
    padding: 10px 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-text);
}

.ga4-config-input input:focus {
    outline: none;
    border-color: #F9AB00;
    box-shadow: 0 0 0 3px rgba(249, 171, 0, 0.1);
}

.ga4-config-hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.ga4-config-hint a {
    color: #E37400;
    text-decoration: none;
}

.ga4-config-hint a:hover {
    text-decoration: underline;
}

.ga4-config-steps {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(234, 67, 53, 0.05);
    border-radius: 6px;
    font-size: 0.8rem;
}

.ga4-config-steps-title {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.ga4-config-steps ol {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--color-text-muted);
}

.ga4-config-steps li {
    margin-bottom: 0.25rem;
}

.ga4-config-steps a {
    color: #E37400;
}

.ga4-config-steps code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    word-break: break-all;
}

/* GA4 Properties */
.ga4-properties {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-light);
}

.ga4-properties-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 10px;
}

.ga4-properties-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.ga4-property-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

.ga4-property-item:hover {
    border-color: #F9AB00;
    background: rgba(249, 171, 0, 0.05);
}

.ga4-property-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
}

.ga4-property-item-account {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* GA4 Connected State */
.ga4-connected {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-light);
}

.ga4-property-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ga4-property-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ga4-property-name::before {
    content: '●';
    color: #4CAF50;
    font-size: 0.6rem;
}

.ga4-change-btn {
    background: none;
    border: none;
    font-size: 0.8rem;
    color: #E37400;
    cursor: pointer;
    font-family: var(--font-sans);
}

.ga4-change-btn:hover {
    text-decoration: underline;
}

.ga4-dimensions-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ga4-dimension-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(249, 171, 0, 0.1);
    color: #E37400;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.ga4-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.ga4-loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-border);
    border-top-color: #F9AB00;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ga4-error {
    padding: 10px 14px;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: var(--radius-md);
    color: #DC2626;
    font-size: 0.85rem;
    margin-top: 12px;
}

/* Dimension Actions Row */
.dimension-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.btn-import-ga4 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(249, 171, 0, 0.1);
    border: 1px solid rgba(249, 171, 0, 0.3);
    border-radius: var(--radius-sm);
    color: #E37400;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-import-ga4:hover {
    background: rgba(249, 171, 0, 0.2);
    border-color: rgba(249, 171, 0, 0.5);
}

.btn-import-ga4-icon {
    font-size: 0.9rem;
}

/* GA4 Dimensions Picker */
.ga4-dimensions-picker {
    margin-top: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.ga4-dimensions-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text);
}

.close-btn-sm {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    color: var(--color-text-muted);
    cursor: pointer;
}

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

.ga4-dimensions-picker-search {
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border-light);
}

.ga4-dimensions-picker-search input {
    width: 100%;
    padding: 8px 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font-sans);
}

.ga4-dimensions-picker-search input:focus {
    outline: none;
    border-color: #F9AB00;
}

.ga4-dimensions-picker-list {
    max-height: 200px;
    overflow-y: auto;
}

.ga4-dimensions-picker-category {
    padding: 8px 14px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ga4-dimensions-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background var(--transition);
}

.ga4-dimensions-picker-item:hover {
    background: var(--color-bg);
}

.ga4-dimensions-picker-item-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
}

.ga4-dimensions-picker-item.selected .ga4-dimensions-picker-item-checkbox {
    background: #F9AB00;
    border-color: #F9AB00;
}

.ga4-dimensions-picker-item.selected .ga4-dimensions-picker-item-checkbox::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.ga4-dimensions-picker-item-info {
    flex: 1;
    min-width: 0;
}

.ga4-dimensions-picker-item-name {
    font-size: 0.9rem;
    color: var(--color-text);
}

.ga4-dimensions-picker-item-api {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-family: 'SF Mono', monospace;
}

.ga4-dimensions-picker-item.added {
    opacity: 0.5;
    cursor: default;
}

.ga4-dimensions-picker-item.added .ga4-dimensions-picker-item-checkbox {
    background: var(--color-text-muted);
    border-color: var(--color-text-muted);
}

.ga4-dimensions-picker-item.added .ga4-dimensions-picker-item-checkbox::after {
    content: '✓';
    color: white;
    font-size: 10px;
}

/* Detail Panel - list stays full size; panel overlays right half */
.detail-panel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.app-main.detail-open .detail-panel-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.detail-panel-overlay.hidden {
    display: none;
}

.detail-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50%;
    min-width: 320px;
    z-index: 11;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(100%);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-panel--full-width {
    width: 100%;
    left: 0;
}

.detail-panel.visible {
    transform: translateX(0);
}

.detail-panel.hidden {
    transform: translateX(100%);
    pointer-events: none;
}

.detail-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Match sidebar brand height so header bottom aligns with line below Impactly */
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-bg);
}

.detail-panel-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.detail-panel-maximize {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.detail-panel-maximize:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.detail-panel-maximize-svg {
    display: block;
}

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

.detail-panel-header-complete-btn {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 8px 18px;
    background: var(--color-text);
    color: var(--color-surface);
    border: 1px solid var(--color-text);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.detail-panel-header-complete-btn:hover {
    background: var(--color-text-secondary);
    border-color: var(--color-text-secondary);
    color: var(--color-surface);
}

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

.detail-panel-close:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.detail-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.detail-panel-content-stack {
    position: relative;
    overflow: hidden;
    padding: 0;
}

.detail-panel-content-stack .detail-panel-content-back,
.detail-panel-content-stack .detail-panel-content-slide {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding: 24px;
    background: var(--color-surface);
}

.detail-panel-content-stack .detail-panel-content-back {
    z-index: 0;
}

.detail-panel-content-stack .detail-panel-content-slide {
    z-index: 1;
    transform: translateX(100%);
    transition: transform 0.2s ease;
}

.detail-panel-content-stack .detail-panel-content-slide--entering {
    transform: translateX(100%);
}

.detail-panel-content-stack .detail-panel-content-slide:not(.detail-panel-content-slide--entering):not(.detail-panel-content-slide--exiting) {
    transform: translateX(0);
}

.detail-panel-content-stack .detail-panel-content-slide.detail-panel-content-slide--exiting {
    transform: translateX(100%);
}

.detail-panel-section {
    margin-bottom: 24px;
}

.detail-panel-section:last-child {
    margin-bottom: 0;
}

.detail-panel-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

/* Task detail layout (mockup: toolbar, name, property rows, description, footer) */
.detail-panel-task-toolbar {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.detail-panel-task-complete-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--color-text);
}

.detail-panel-task-complete-label input {
    cursor: pointer;
}

.detail-panel-task-name-wrap {
    margin-bottom: 20px;
}

.detail-panel-task-name-wrap .detail-panel-name-input {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.detail-panel-properties,
.detail-panel-task-properties {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.detail-panel-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-panel-row .detail-panel-label {
    flex-shrink: 0;
    width: 100px;
    margin-bottom: 0;
}

.detail-panel-row .detail-panel-select,
.detail-panel-row .detail-panel-due-input,
.detail-panel-row .detail-panel-priority,
.detail-panel-row .detail-panel-due,
.detail-panel-row .detail-panel-assignee,
.detail-panel-row .item-col-assignee,
.detail-panel-row .detail-panel-source,
.detail-panel-row .item-col-source {
    flex: 1;
    min-width: 0;
    max-width: 280px;
    display: flex;
    align-items: center;
    padding: 6px 10px;
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

/* Make the inner assignee content fill the full field so the whole area is clickable */
.detail-panel-row .item-col-assignee .item-col-empty.item-assignee-add-btn,
.detail-panel-row .item-col-assignee .item-assignee-display,
.detail-panel-row .item-col-source .item-col-empty.item-source-add-btn,
.detail-panel-row .item-col-source .item-source-display {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.detail-panel-source,
.item-col-source {
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: background 0.15s ease;
}

.detail-panel-source:hover,
.item-col-source:hover {
    background: var(--color-bg-warm);
}

.item-col-source .item-col-empty.item-source-add-btn {
    color: var(--color-text-muted);
}

.item-col-source .item-col-empty.item-source-add-btn:hover {
    color: var(--color-text-secondary);
}

.item-source-icon-svg,
.item-source-add-icon {
    display: block;
    flex-shrink: 0;
}

.item-source-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Same for due date: inner content fills the full field */
.detail-panel-row .item-col-due .item-col-empty.item-due-add-btn,
.detail-panel-row .item-col-due .item-due-display {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

/* Date input in detail panel: match field dimensions, prevent layout shift and shrinking */
.detail-panel-row .detail-panel-due:has(.item-due-input) {
    flex-shrink: 0;
    overflow: hidden;
}

.detail-panel-row .detail-panel-due .item-due-input,
.detail-panel-row .item-col-due .item-due-input {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 100%;
    min-height: 0;
    padding: 0 2px;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    font-size: 0.85rem;
    line-height: 1.2;
    box-sizing: border-box;
}

/* Same for priority: selector and badge fill the full field */
.detail-panel-row .detail-panel-priority .priority-selector {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.detail-panel-row .detail-panel-priority .priority-badge {
    flex: 1;
    min-width: 0;
}

/* Full bleed: when selected, apply color to entire container; padding matches assignee/due for left alignment */
.detail-panel-row .detail-panel-priority:has(.priority-badge--low),
.detail-panel-row .detail-panel-priority:has(.priority-badge--medium),
.detail-panel-row .detail-panel-priority:has(.priority-badge--high),
.detail-panel-row .detail-panel-priority:has(.priority-badge--critical) {
    padding: 6px 10px;
    align-items: stretch;
}
.detail-panel-row .detail-panel-priority:has(.priority-badge--low) {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
}
.detail-panel-row .detail-panel-priority:has(.priority-badge--medium) {
    background: rgba(250, 204, 21, 0.28);
    border-color: rgba(250, 204, 21, 0.4);
}
.detail-panel-row .detail-panel-priority:has(.priority-badge--high) {
    background: rgba(234, 88, 12, 0.2);
    border-color: rgba(234, 88, 12, 0.35);
}
.detail-panel-row .detail-panel-priority:has(.priority-badge--critical) {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

.detail-panel-row .detail-panel-priority:has(.priority-badge--low) .priority-selector,
.detail-panel-row .detail-panel-priority:has(.priority-badge--medium) .priority-selector,
.detail-panel-row .detail-panel-priority:has(.priority-badge--high) .priority-selector,
.detail-panel-row .detail-panel-priority:has(.priority-badge--critical) .priority-selector {
    align-items: stretch;
}

.detail-panel-row .detail-panel-priority:has(.priority-badge--low) .priority-badge,
.detail-panel-row .detail-panel-priority:has(.priority-badge--medium) .priority-badge,
.detail-panel-row .detail-panel-priority:has(.priority-badge--high) .priority-badge,
.detail-panel-row .detail-panel-priority:has(.priority-badge--critical) .priority-badge {
    background: transparent;
    border-radius: 0;
    padding: 0 10px 0 4px;
    justify-content: flex-start;
}

.detail-panel-row .detail-panel-priority .priority-badge--unset {
    justify-content: flex-start;
    min-height: 0;
    padding: 4px;
    border-radius: var(--radius-sm);
}

.detail-panel-row .detail-panel-priority .priority-badge--unset .item-priority-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    color: var(--color-text-muted);
}

.detail-panel-row--goal .detail-panel-goal,
.detail-panel-row .detail-panel-goal {
    flex: 1;
    min-width: 0;
}

.detail-panel-row--goal-dimension .detail-panel-goal-dimension-field {
    flex: 1;
    min-width: 0;
}

/* List-style goal pill in detail panel (reuses .item-col-goal, .item-goal-tag-compact) */
.detail-panel-goal.item-col-goal {
    cursor: pointer;
}

.detail-panel-goal .item-goal-tag-compact {
    min-height: 26px;
    padding: 5px 10px;
    line-height: 1.2;
    box-sizing: border-box;
}

.detail-panel-goal-with-direction {
    display: flex;
    align-items: center;
    min-width: 0;
}

.detail-panel-goal-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.detail-panel-goal-row .detail-panel-goal {
    flex: 0 1 auto;
    min-width: 0;
}

.detail-panel-goal-direction-arrow {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--color-metric);
    color: #FFFFFF;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    transition: background 0.15s ease;
    box-sizing: border-box;
}

.detail-panel-goal-direction-arrow .detail-panel-goal-direction-arrow-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transform-origin: center center;
    transition: transform 0.2s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.detail-panel-goal-direction-arrow .detail-panel-goal-direction-arrow-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.detail-panel-goal-direction-arrow:disabled {
    cursor: default;
}

.detail-panel-goal-direction-arrow:hover {
    background: var(--color-metric-hover);
}

.detail-panel-goal-direction-toggle {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s, border-color 0.15s;
}

.detail-panel-goal-direction-toggle:hover {
    background: var(--color-bg-warm);
    border-color: var(--color-border);
}

.detail-panel-hint-inline {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Projects and Goals rows: shared layout for consistent label/button alignment */
.detail-panel-row--projects,
.detail-panel-row--goal,
.detail-panel-row--dimensions {
    align-items: baseline;
}

/* Shared picker layout: block so baseline = last line (Add button), aligning label with button */
.detail-panel-row--projects .detail-panel-projects-picker,
.detail-panel-row--goal .detail-panel-goals-picker,
.detail-panel-row--dimensions .detail-panel-dimensions-picker {
    flex: 1;
    min-width: 0;
}

.detail-panel-dimensions-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 0;
    margin-bottom: 6px;
}

.detail-panel-dimensions-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.detail-panel-dimension-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 26px;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    background: rgba(42, 157, 143, 0.1);
    color: var(--color-source);
    box-sizing: border-box;
}

.detail-panel-dimension-pill-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    padding: 0;
    margin-left: 2px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
}

.detail-panel-dimension-pill-remove:hover {
    background: rgba(0, 0, 0, 0.2);
}

.detail-panel-add-dimension-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.detail-panel-add-dimension-btn:hover {
    border-color: var(--color-border);
    color: var(--color-text);
}

.detail-panel-dimensions-add-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
    position: relative;
}

.detail-panel-dimensions-add-row.hidden {
    display: none;
}

.detail-panel-dimensions-add-row .detail-panel-datasource-dimensions-input {
    padding: 6px 10px;
    font-size: 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    min-height: 36px;
}

.detail-panel-section-goal {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.detail-panel-projects-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 0;
    margin-bottom: 6px;
}

.detail-panel-projects-display .item-col-empty {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Project pill: same height/spacing as priority and goal pills */
.detail-panel-project-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 26px;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    background: rgba(196, 93, 58, 0.1);
    color: var(--color-accent);
    box-sizing: border-box;
}

.detail-panel-project-pill-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    padding: 0;
    margin-left: 2px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
}

.detail-panel-project-pill-remove:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Dimension options (Universal dimension detail): pills + add input, like Projects */
.detail-panel-dimension-options-picker {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-panel-dimension-options-add {
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-panel-dimension-options-input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    font-size: 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.detail-panel-option-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 26px;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    background: var(--color-metric-bg);
    color: var(--color-metric);
    box-sizing: border-box;
}

.detail-panel-option-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    padding: 0;
    margin-left: 2px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
}

.detail-panel-option-remove:hover {
    background: rgba(0, 0, 0, 0.2);
}

.detail-panel-add-project-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.detail-panel-add-project-btn:hover {
    border-color: var(--color-border);
    color: var(--color-text);
}

.detail-panel-project-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--color-text);
}

.detail-panel-project-option:hover {
    background: var(--color-bg-warm);
}

/* Goals picker: block layout (matches projects-picker) for baseline alignment */
.detail-panel-goals-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 0;
    margin-bottom: 6px;
}
.detail-panel-goals-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: 100%;
}
/* Goal pill: same structure as project pill, metric color from sidebar */
.detail-panel-goal-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 26px;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    background: var(--color-metric-bg);
    color: var(--color-metric);
    box-sizing: border-box;
}
.detail-panel-goal-pill-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    padding: 0;
    margin-left: 2px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
}
.detail-panel-goal-pill-remove:hover {
    background: rgba(0, 0, 0, 0.2);
}
/* Add goal button - same as Add project */
.detail-panel-add-goal-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.detail-panel-add-goal-btn:hover {
    border-color: var(--color-border);
    color: var(--color-text);
}

.detail-panel-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-light);
}

.detail-panel-footer-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-panel-created {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.detail-panel-completed-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-panel-completed {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.detail-panel-edit-completed-btn {
    padding: 2px 6px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    line-height: 1;
}

.detail-panel-delta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.detail-panel-delta-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.detail-panel-delta-value {
    font-size: 0.9rem;
    font-weight: 500;
}

.detail-panel-delta--positive {
    color: var(--color-success);
}

.detail-panel-delta--negative {
    color: var(--color-accent);
}

.detail-panel-scope-weight-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.detail-panel-scope-weight-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.detail-panel-scope-weight-value {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.detail-panel-impact-score-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.detail-panel-impact-score-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.detail-panel-impact-score-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
}

.detail-panel-edit-completed-btn:hover {
    color: var(--color-text);
    background: var(--color-bg-warm);
}

.detail-panel-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 16px;
    line-height: 1.4;
}

.detail-panel-name-input {
    width: 100%;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    border: none;
    background: none;
    padding: 0;
    margin-bottom: 16px;
    outline: none;
    border-bottom: 2px solid transparent;
    transition: border-color var(--transition);
}

.detail-panel-name-input:focus {
    border-bottom-color: var(--color-primary);
}

.detail-panel-hint {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 4px 0 0 0;
}

.detail-panel-select {
    width: 100%;
    padding: 6px 10px;
    min-height: 40px;
    box-sizing: border-box;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--color-text);
    cursor: pointer;
    appearance: auto;
    -webkit-appearance: menulist;
}

.detail-panel-readonly-value {
    font-size: 0.95rem;
    color: var(--color-text);
    margin: 4px 0 0 0;
}

.detail-panel-readonly-value code {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    background: var(--color-bg-warm);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.detail-panel-schema-list {
    margin: 6px 0 0 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
    color: var(--color-text);
}

.detail-panel-schema-list li {
    margin-bottom: 4px;
}

/* Data source: CSV upload */
.detail-panel-csv-input.hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.detail-panel-csv-dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    padding: 20px;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-warm);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.detail-panel-csv-dropzone:hover,
.detail-panel-csv-dropzone.detail-panel-csv-dropzone--dragover {
    border-color: var(--color-accent);
    background: rgba(196, 93, 58, 0.06);
}

.detail-panel-csv-dropzone:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.detail-panel-csv-files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.detail-panel-csv-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--color-bg-warm);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.detail-panel-csv-file-name {
    flex: 1;
    min-width: 0;
    font-weight: 500;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-panel-csv-file-meta {
    flex-shrink: 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.detail-panel-csv-file-remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: background var(--transition), color var(--transition);
}

.detail-panel-csv-file-remove:hover {
    background: var(--color-border);
    color: var(--color-text);
}

/* GA4 Auto data source config */
.detail-panel-section-ga4-config .detail-panel-ga4-config-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.detail-panel-ga4-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
}

.detail-panel-ga4-auth-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}

.detail-panel-ga4-status {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.detail-panel-ga4-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
}

.detail-panel-ga4-status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.detail-panel-ga4-status-badge--connected {
    color: #22c55e;
}

.detail-panel-ga4-status-badge--connected::before {
    background: #22c55e;
}

.detail-panel-ga4-status-badge--disconnected {
    color: #eab308;
}

.detail-panel-ga4-status-badge--disconnected::before {
    background: #eab308;
}

.detail-panel-ga4-status-badge--not-set-up {
    color: var(--color-text-muted);
}

.detail-panel-ga4-status-badge--not-set-up::before {
    background: var(--color-text-muted);
}

.detail-panel-ga4-sync-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.detail-panel-ga4-last-sync {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.detail-panel-ga4-auto-sync-hint {
    margin-top: 4px;
}

.detail-panel-ga4-name-readonly {
    font-weight: 500;
}

.detail-panel-ga4-sync {
    margin-top: 0;
}

.detail-panel-ga4-sync-status {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* PageSpeed URL list */
.detail-panel-pagespeed-urls-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-panel-pagespeed-url-tags {
    min-height: 0;
}

.detail-panel-pagespeed-url-tag {
    background: var(--color-metric-bg);
    color: var(--color-metric);
}

.detail-panel-pagespeed-add-url-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.detail-panel-pagespeed-add-url-row .detail-panel-input {
    flex: 1;
    min-width: 0;
}

.detail-panel-ga4-sync-status.detail-panel-ga4-sync-error {
    color: #C45D3A;
}

.detail-panel-section-ga4-preview {
    margin-top: 16px;
}

.detail-panel-section-ga4-metrics {
    margin-top: 12px;
}

.detail-panel-ga4-metrics-picker .tag-picker-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.detail-panel-ga4-metric-tag--default {
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
}

.detail-panel-ga4-add-metric-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-panel-ga4-add-metric-row .tag-picker-input-wrapper {
    flex: 1;
    min-width: 160px;
}

.detail-panel-ga4-metric-dropdown .tag-picker-dropdown-item-code {
    font-size: 0.8em;
    opacity: 0.8;
    margin-left: 4px;
}

.detail-panel-section-ga4-dimensions {
    margin-top: 12px;
}

.detail-panel-ga4-dimensions-picker .tag-picker-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.detail-panel-ga4-dimension-tag--default {
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
}

.detail-panel-ga4-add-dimension-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-panel-ga4-add-dimension-row .tag-picker-input-wrapper {
    flex: 1;
    min-width: 160px;
}

.detail-panel-ga4-dimension-dropdown .tag-picker-dropdown-item-code {
    font-size: 0.8em;
    opacity: 0.8;
    margin-left: 4px;
}

.detail-panel-ga4-schema-content {
    margin-top: 12px;
}

.detail-panel-ga4-schema-table-wrap {
    margin-top: 12px;
}

.detail-panel-ga4-schema-table-wrap + .detail-panel-ga4-schema-table-wrap {
    margin-top: 20px;
}

.detail-panel-ga4-schema-table {
    font-size: 0.85rem;
}

.detail-panel-ga4-schema-table code {
    font-size: 0.8em;
    background: var(--color-surface-elevated);
    padding: 2px 6px;
    border-radius: 4px;
}

.detail-panel-ga4-preview-table {
    font-size: 0.85rem;
}

.detail-panel-ga4-preview-table th,
.detail-panel-ga4-preview-table td {
    padding: 6px 10px;
}

.detail-panel-section-csv-dimensions .detail-panel-csv-dimensions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.detail-panel-csv-metric-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.detail-panel-csv-metric-row .detail-panel-select {
    flex: 1;
    min-width: 120px;
}

.detail-panel-csv-metric-row .detail-panel-input {
    flex: 1;
    min-width: 100px;
}

.detail-panel-csv-metric-remove {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: var(--color-bg-warm);
    color: var(--color-text-muted);
    font-size: 1.25rem;
    line-height: 1;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.detail-panel-csv-metric-remove:hover {
    background: var(--color-border);
    color: var(--color-text);
}

.detail-panel-csv-dimension-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-panel-csv-dimension-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.detail-panel-csv-dimension-custom-mapping {
    margin-left: 0;
}

.detail-panel-csv-dimension-custom-mapping-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    background: none;
    border: none;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    cursor: pointer;
}

.detail-panel-csv-dimension-custom-mapping-toggle:hover {
    color: var(--color-text);
}

.detail-panel-csv-dimension-custom-mapping-chevron {
    font-size: 0.75rem;
}

.detail-panel-csv-dimension-custom-mapping-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    padding-left: 16px;
    border-left: 2px solid var(--color-border-light);
}

.detail-panel-csv-dimension-custom-mapping-fields.hidden {
    display: none;
}

.detail-panel-csv-dimension-option-mapping-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-panel-csv-dimension-option-name {
    min-width: 100px;
    font-size: 0.9rem;
}

.detail-panel-csv-dimension-option-mapping-picker {
    position: relative;
    flex: 1;
    min-width: 120px;
}

.detail-panel-csv-option-mapping-input {
    width: 100%;
}

.detail-panel-csv-option-mapping-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 2px;
    max-height: 160px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 100;
}

.detail-panel-csv-option-mapping-dropdown--portal {
    position: fixed;
    left: 0;
    top: 0;
    max-height: 160px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 10000;
}

.detail-panel-csv-option-mapping-dropdown-item {
    padding: 6px 10px;
    font-size: 0.9rem;
    cursor: pointer;
}

.detail-panel-csv-option-mapping-dropdown-item:hover {
    background: var(--color-bg-warm);
}

.detail-panel-csv-option-mapping-dropdown-empty {
    padding: 8px 10px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.detail-panel-csv-dimension-name-cell {
    flex: 1;
    min-width: 120px;
}

.detail-panel-csv-dimension-name-cell .detail-panel-input {
    width: 100%;
}

.detail-panel-csv-dimension-preset-name {
    font-weight: 500;
}

.detail-panel-csv-dimension-preset-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--color-text-muted);
    margin-left: 4px;
}

.detail-panel-csv-dimensions-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-panel-csv-dimension-row .detail-panel-select {
    flex: 1;
    min-width: 120px;
}

.detail-panel-csv-dimension-remove {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: var(--color-bg-warm);
    color: var(--color-text-muted);
    font-size: 1.25rem;
    line-height: 1;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.detail-panel-csv-dimension-remove:hover {
    background: var(--color-border);
    color: var(--color-text);
}

.detail-panel-schema-list code {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    background: var(--color-bg-warm);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.detail-panel-dimension-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.detail-panel-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--color-text);
    cursor: pointer;
}

.detail-panel-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.detail-panel-section-table {
    overflow-x: auto;
}

.detail-panel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.detail-panel-table th,
.detail-panel-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
}

.detail-panel-table th {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-panel-table td.detail-panel-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.detail-panel-empty-cell {
    color: var(--color-text-muted);
    font-style: italic;
    padding: 16px !important;
}

.item--builtin .item-name {
    font-weight: 600;
}

/* Rich Text Editor */
.rich-text-editor {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.rich-text-toolbar {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border-light);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.rich-text-editor:focus-within .rich-text-toolbar {
    display: flex;
}

.rich-text-btn {
    width: 32px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.rich-text-btn:hover {
    background: var(--color-surface);
    color: var(--color-text);
}

.rich-text-btn.active {
    background: rgba(59, 130, 246, 0.2);
    color: var(--color-primary);
}

.rich-text-btn-icon {
    padding: 0 4px;
}

.rich-text-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.rich-text-icon .rich-text-icon-svg,
.rich-text-icon svg {
    display: block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.rich-text-sep {
    width: 1px;
    height: 20px;
    background: var(--color-border);
    margin: 0 4px;
}

.rich-text-content {
    min-height: 160px;
    padding: 12px;
    padding-bottom: 44px;
    font-size: 0.9rem;
    color: var(--color-text);
    font-family: inherit;
    outline: none;
    line-height: 1.5;
}

.rich-text-content:focus {
    outline: none;
}

.rich-text-content:empty::before {
    content: attr(data-placeholder);
    color: var(--color-text-muted);
}

.rich-text-content p { margin: 0 0 0.5em 0; }
.rich-text-content p:last-child { margin-bottom: 0; }
.rich-text-content ul, .rich-text-content ol { margin: 0.5em 0; padding-left: 1.5em; }
.rich-text-content ol { list-style-type: decimal; }
.rich-text-content ol ol { list-style-type: lower-alpha; margin: 0.2em 0; }
.rich-text-content ol ol ol { list-style-type: lower-roman; }
.rich-text-content ul ul, .rich-text-content ul ol, .rich-text-content ol ul { margin: 0.2em 0; }
.rich-text-content li { margin: 0.15em 0; }
.rich-text-content a { color: var(--color-primary); text-decoration: underline; cursor: pointer; }
.rich-text-content a:hover { color: #1d4ed8; }

/* Task mention (checkbox + name) — inline chip, select-all on click */
.rich-text-content .task-mention,
.detail-panel-description .task-mention {
    display: inline;
    padding: 0 3px;
    margin: 0;
    vertical-align: baseline;
    font-size: inherit;
    line-height: inherit;
    font-weight: 500;
    background: rgba(59, 130, 246, 0.12);
    color: var(--color-primary);
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-user-select: all;
    user-select: all;
}
.rich-text-content .task-mention:hover,
.detail-panel-description .task-mention:hover {
    background: rgba(59, 130, 246, 0.25);
    text-decoration: underline;
}

/* Task mention dropdown */
.task-mention-dropdown {
    position: fixed;
    min-width: 200px;
    max-width: 300px;
    max-height: 240px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    z-index: 1000;
}
.task-mention-option {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--color-text);
}
.task-mention-option:hover,
.task-mention-option.selected {
    background: var(--color-bg);
}
.task-mention-option.selected {
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-primary);
}

.detail-panel-description-wrap .rich-text-editor {
    border-color: var(--color-border);
}

.detail-panel-description {
    width: 100%;
    min-height: 160px;
    padding: 12px;
    padding-bottom: 44px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--color-text);
    font-family: inherit;
    outline: none;
    line-height: 1.5;
}

.detail-panel-description:focus {
    outline: none;
}

.detail-panel-description p { margin: 0 0 0.5em 0; }
.detail-panel-description ul, .detail-panel-description ol { margin: 0.5em 0; padding-left: 1.5em; }
.detail-panel-description ol { list-style-type: decimal; }
.detail-panel-description ol ol { list-style-type: lower-alpha; margin: 0.2em 0; }
.detail-panel-description ol ol ol { list-style-type: lower-roman; }
.detail-panel-description ul ul, .detail-panel-description ul ol, .detail-panel-description ol ul { margin: 0.2em 0; }
.detail-panel-description a { color: var(--color-primary); text-decoration: underline; cursor: pointer; }
.detail-panel-description a:hover { color: #1d4ed8; }

/* Breadcrumb for subtasks (in content area, above task name) */
.detail-panel-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 0;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.85rem;
    cursor: pointer;
}

.detail-panel-breadcrumb-link {
    color: var(--color-primary);
    cursor: pointer;
    text-decoration: none;
}

.detail-panel-breadcrumb-link--highlight,
.detail-panel-breadcrumb-link--highlight:hover {
    text-decoration: underline;
}

.detail-panel-breadcrumb-sep {
    color: var(--color-text-muted);
    pointer-events: none;
}

/* Subtasks section (Asana-style) */
.detail-panel-subtasks {
    margin-top: 20px;
}

.detail-panel-subtasks .detail-panel-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.detail-panel-subtasks-separator {
    height: 1px;
    background: var(--color-border);
    margin-bottom: 0;
}

.detail-panel-subtasks-list {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.detail-panel-subtask-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background 0.15s ease;
}

.detail-panel-subtask-row:hover {
    background: var(--color-bg-hover, rgba(255, 255, 255, 0.05));
}

.detail-panel-subtask-grip {
    flex: 0 0 24px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    opacity: 0;
    transition: opacity 0.15s ease;
    color: var(--color-text-muted);
    align-self: stretch;
    margin-top: -10px;
    margin-bottom: -10px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.detail-panel-subtask-row:hover .detail-panel-subtask-grip {
    opacity: 0.5;
}

.detail-panel-subtask-grip:hover {
    opacity: 1 !important;
    color: var(--color-text);
}

.detail-panel-subtask-row.drag-ready .detail-panel-subtask-grip {
    cursor: grabbing;
    opacity: 1;
}

.detail-panel-subtask-row.dragging {
    opacity: 0.25;
}

.detail-panel-subtasks-list .drop-indicator {
    height: 2px;
    background: var(--color-primary, #4f46e5);
    border-radius: 1px;
    margin: -1px 0;
}

.detail-panel-subtask-row.completed .detail-panel-subtask-name {
    color: var(--color-text-muted);
}

.detail-panel-subtask-checkbox {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.detail-panel-subtask-checkbox:hover {
    border-color: var(--color-success);
}

.detail-panel-subtask-row.completed .detail-panel-subtask-checkbox {
    background: var(--color-success);
    border-color: var(--color-success);
}

.detail-panel-subtask-checkbox::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition);
}

.detail-panel-subtask-row.completed .detail-panel-subtask-checkbox::after {
    opacity: 1;
    transform: scale(1);
}

.detail-panel-subtask-name-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.detail-panel-subtask-name {
    font-size: 0.9rem;
    color: var(--color-text);
    cursor: text;
}

.detail-panel-subtask-name-input {
    font-size: 0.9rem;
    padding: 2px 4px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.detail-panel-subtask-chevron {
    flex-shrink: 0;
    font-size: 1rem;
    color: var(--color-text-muted);
    opacity: 0.6;
}

.detail-panel-subtask-row:hover .detail-panel-subtask-chevron {
    opacity: 1;
}

.detail-panel-subtask-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-panel-add-subtask {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.detail-panel-add-subtask:hover {
    border-color: var(--color-border);
    color: var(--color-text);
}

.detail-panel-delete {
    margin-left: auto;
    color: #EF4444;
    background: var(--color-surface);
    border: 1px solid #EF4444;
    border-radius: var(--radius-md);
}

.detail-panel-delete:hover {
    background: #EF4444;
    color: white;
}

.detail-panel-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-panel-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-panel-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--color-text);
}

.detail-panel-status-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.detail-panel-completed-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.detail-panel-completion-date-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.detail-panel-completion-date-wrap .detail-panel-label-inline {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.detail-panel-completion-date-input {
    max-width: 140px;
}

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

.detail-panel-priority {
    display: flex;
    align-items: center;
}

/* Reuses list view priority pill + dropdown (same .priority-badge and .priority-dropdown styles) */
.detail-panel-priority .priority-selector {
    position: relative;
}

.detail-panel-priority .priority-badge {
    min-height: 26px;
    padding: 5px 10px;
    font-size: 0.75rem;
    line-height: 1.2;
    border-radius: 12px;
    box-sizing: border-box;
}

.detail-panel-priority .priority-dropdown {
    z-index: 50;
}

.detail-panel-due-input {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--color-text);
    background: white;
}

.item-dimension-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--color-primary);
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 600px) {
    .app-container {
        padding: 32px 16px;
    }
    
    .logo {
        font-size: 2.25rem;
    }
    
    .main-nav {
        padding: 4px;
    }
    
    .nav-tab {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .list-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-tabs {
        width: 100%;
    }
    
    .filter-tab {
        flex: 1;
        text-align: center;
    }
    
    .item {
        padding: 16px;
    }
    
    .item-actions {
        opacity: 1;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* Native delete confirmation dialog */
.confirm-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.confirm-dialog-overlay.confirm-dialog-overlay--visible {
    opacity: 1;
}

.confirm-dialog-box {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    padding: 28px 32px;
    max-width: 420px;
    width: 100%;
}

.confirm-dialog-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--color-text);
    margin: 0 0 12px 0;
}

.confirm-dialog-message {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text-secondary);
    margin: 0 0 24px 0;
}

.confirm-dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirm-dialog-cancel {
    flex-shrink: 0;
}

.confirm-dialog-confirm {
    color: #EF4444;
    background: none;
    border: 1px solid #EF4444;
}

.confirm-dialog-confirm:hover {
    background: #EF4444;
    color: white;
}

/* Link dialog (rich text Cmd+K) */
.link-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.link-dialog-overlay.link-dialog-overlay--visible {
    opacity: 1;
}

.link-dialog-box {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    padding: 28px 32px;
    max-width: 420px;
    width: 100%;
}

.link-dialog-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--color-text);
    margin: 0 0 20px 0;
}

.link-dialog-form .form-group {
    margin-bottom: 16px;
}

.link-dialog-form .form-group:last-of-type {
    margin-bottom: 24px;
}

.link-dialog-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.link-dialog-form input {
    width: 100%;
    padding: 14px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--color-text);
}

.link-dialog-form input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(205, 110, 88, 0.2);
}

.link-dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Add data source picker modal (Google API Library style) */
.add-data-source-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.add-data-source-overlay.add-data-source-overlay--visible {
    opacity: 1;
}

.add-data-source-overlay.hidden {
    display: none;
}

.add-data-source-modal {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    padding: 32px 40px 40px;
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.add-data-source-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-text);
    margin: 0 0 4px 0;
}

.add-data-source-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin: 0 0 24px 0;
}

.add-data-source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.add-data-source-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
    text-align: left;
}

.add-data-source-card:hover {
    border-color: var(--color-source);
    box-shadow: 0 0 0 2px rgba(42, 157, 143, 0.15);
}

.add-data-source-card:focus-visible {
    outline: none;
    border-color: var(--color-source);
    box-shadow: 0 0 0 2px rgba(42, 157, 143, 0.25);
}

.add-data-source-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 1.25rem;
}

.add-data-source-card-icon--csv {
    background: rgba(107, 114, 128, 0.15);
    color: #6B7280;
}

.add-data-source-card-icon--ga4 {
    background: rgba(234, 179, 8, 0.2);
    color: #CA8A04;
}

.add-data-source-card-icon--pagespeed {
    background: rgba(34, 197, 94, 0.15);
    color: #16A34A;
}

.add-data-source-card-icon--github {
    background: rgba(31, 41, 55, 0.15);
    color: #1F2937;
}

.add-data-source-card-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 2px;
}

.add-data-source-card-provider {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.add-data-source-card-desc {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.add-data-source-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition), background var(--transition);
}

.add-data-source-close:hover {
    color: var(--color-text);
    background: var(--color-bg-warm);
}

.hidden {
    display: none !important;
}

/* Auth screen */
.auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--color-bg);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 360px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 32px;
}

.auth-logo {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
}

.auth-tagline {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.auth-form input {
    display: block;
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.btn-block {
    width: 100%;
    margin-top: 8px;
}

.auth-error {
    color: #C45D3A;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.auth-error.hidden {
    display: none;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.auth-link {
    background: none;
    border: none;
    color: var(--color-accent);
    cursor: pointer;
    font-size: inherit;
    text-decoration: underline;
}

.auth-link:hover {
    color: var(--color-accent-hover);
}

/* Settings modal (centered, like source selector) */
.settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.settings-overlay.settings-overlay--visible {
    opacity: 1;
}

.settings-overlay.hidden {
    display: none;
}

.settings-modal {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    padding: 32px 40px 40px;
    max-width: 400px;
    width: 100%;
}

.settings-modal-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-text);
    margin: 0 0 20px 0;
}

.settings-modal-content {
    padding: 0;
}

/* Dark mode toggle */
.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0 20px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--color-border-light);
}

.settings-toggle-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text);
}

.settings-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.settings-toggle-switch {
    flex-shrink: 0;
    width: 44px;
    height: 24px;
    background: var(--color-border);
    border-radius: 12px;
    transition: background var(--transition);
}

.settings-toggle-switch::after {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    margin: 2px;
    background: var(--color-surface);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition);
}

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

.settings-toggle-input:checked + .settings-toggle-switch::after {
    transform: translateX(20px);
}

.settings-toggle-input:focus-visible + .settings-toggle-switch {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.settings-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-text-secondary);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color var(--transition), background var(--transition);
}

.settings-modal-close:hover {
    color: var(--color-text);
    background: var(--color-bg-warm);
}

.settings-panel-user {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 16px;
}

.settings-panel-name {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.settings-panel-email {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.settings-panel-sign-out {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 500;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.settings-panel-sign-out:hover {
    color: var(--color-text);
    border-color: var(--color-text-muted);
    background: var(--color-bg-warm);
}

