/* Sidebar */
.sidebar {
    background: var(--bg-surface);
    padding: 20px;
    border-radius: 6px;
    border: 1px solid var(--border-default);
    font-size: 14px;
    line-height: 1.6;
}

.sidebar h3 {
    color: var(--accent-primary);
    font-size: 16px;
    margin: 0 0 16px 0;
    font-weight: 600;
}

.sidebar .tip {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-muted);
}

.sidebar .tip:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar .tip-title {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.sidebar .tip-content {
    color: var(--text-muted);
    font-size: 14px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.sidebar code {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--accent-primary);
    font-size: 12px;
    word-break: break-all;
    overflow-wrap: break-word;
    display: inline-block;
    max-width: 100%;
}

.sidebar kbd {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    font-size: 12px;
}

.system-overview-link {
    display: block;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.system-overview-link:hover {
    background: var(--bg-surface);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

/* Sidebar section */
.sidebar-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-muted);
}

.sidebar-section h3 {
    color: var(--accent-primary);
    margin-bottom: 12px;
}

/* Button block styles */
.btn-block {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.btn-block + .btn-block {
    margin-top: 10px;
}

.btn-block.btn-success {
    background: var(--success);
    color: white;
}

.btn-block.btn-accent {
    background: var(--accent-primary);
    color: white;
}
/* Search Box */
.search-box {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    margin-bottom: 20px;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    font-family: 'IBM Plex Sans', sans-serif;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.search-box:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
}

.search-box::placeholder {
    color: var(--text-subtle);
}

/* Filters */
.filters {
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.filters label {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filters input[type="checkbox"] {
    accent-color: var(--accent-primary);
}

.filters select,
.filters input[type="date"] {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 6px 10px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.filters select:focus,
.filters input[type="date"]:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Toolbar */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 12px;
    margin-bottom: 24px;
}

.toolbar > button {
    font-size: 13px;
    padding: 6px 12px;
    white-space: nowrap;
}

.toolbar-btn {
    background: var(--accent-primary);
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    opacity: 0.9;
}

.toolbar-btn-muted {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-muted);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn-muted:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.toolbar-btn-danger {
    background: var(--danger);
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn-danger:hover {
    opacity: 0.9;
}

.toolbar-btn-info {
    background: #2196F3;
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn-info:hover {
    opacity: 0.9;
}

.toolbar-btn-warning {
    background: var(--warning);
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn-warning:hover {
    opacity: 0.9;
}

.toolbar-btn-success {
    background: var(--success);
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn-success:hover {
    opacity: 0.9;
}

.toolbar-btn-accent {
    background: #7c3aed;
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn-accent:hover {
    opacity: 0.9;
}

/* Conversation tabs */
.conversation-tabs {
    display: flex;
    gap: 8px;
    margin: 20px 0 16px 0;
    border-bottom: 1px solid var(--border-default);
    padding-bottom: 0;
}

.tab-button {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-button.active {
    border-bottom-color: var(--accent-primary);
    color: var(--accent-primary);
}

.tab-button:hover:not(.active) {
    color: var(--text-primary);
}

/* Result highlight */
.result-highlight {
    border: 2px solid var(--success) !important;
}

/* Results Header */
.results-header {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 500;
}

/* Dataset banner (snapshot mode) */
.dataset-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: color-mix(in srgb, var(--warning) 18%, var(--bg-surface));
    border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border-default));
    border-radius: 10px;
}

.dataset-banner-title {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
}

/* Result Cards */
.result {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-left: 3px solid transparent;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.result.windows {
    border-left-color: var(--accent-primary);
}

.result.wsl {
    border-left-color: var(--warning);
}

.result:hover {
    background: var(--bg-elevated);
    border-color: var(--border-muted);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.result-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.result-meta {
    color: var(--text-muted);
    font-size: 14px;
    margin: 8px 0;
}

.result-meta .conv-id {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 13px;
}

.result-snippet {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
    margin-top: 12px;
}

.result-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.resume-btn {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    background: var(--accent-primary);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.resume-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

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

.resume-btn.success {
    background: var(--success);
}

.resume-btn.error {
    background: var(--danger);
}

.tool-badge {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 3px;
    background: var(--code-bg);
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tool-badge.claude {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent-primary);
}

.tool-badge.vibe {
    background: rgba(255, 149, 0, 0.15);
    color: var(--warning);
}

.tool-badge.opencode {
    background: rgba(46, 204, 113, 0.15);
    color: var(--success);
}

.tool-badge.codex {
    background: rgba(87, 96, 106, 0.12);
    color: var(--text-muted);
}

.tool-badge.gemini {
    background: rgba(5, 80, 174, 0.12);
    color: var(--accent-secondary);
}

.tool-badge.continue {
    background: rgba(26, 127, 55, 0.12);
    color: var(--success);
}

.tool-badge.cursor {
    background: rgba(9, 105, 218, 0.12);
    color: var(--accent-primary);
}

.tool-badge.aider {
    background: rgba(168, 85, 247, 0.12);
    color: var(--accent-secondary);
}

.header {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message {
    background: var(--bg-elevated);
    border-left: 3px solid var(--accent-primary);
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 8px;
}

.message.user {
    border-left-color: var(--accent-primary);
}

.message.assistant {
    border-left-color: var(--success);
}

.message .role {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

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

.message-header .role {
    margin-bottom: 0;
}

.message-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.message-copy {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.message-copy:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--bg-surface);
}

.message-copy.copied {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

.message .content {
    white-space: pre-wrap;
    color: var(--text-primary);
}

.back-button {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: var(--accent-primary);
    text-decoration: none;
    margin-bottom: 8px;
}

.back-button:hover {
    text-decoration: underline;
}

/* Loading State */
.loading {
    text-align: center;
    color: var(--text-muted);
    font-size: 16px;
    padding: 40px 20px;
}

.warmup-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-default, #555);
    border-top-color: var(--accent-primary, #2196F3);
    border-radius: 50%;
    animation: chat-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* Notification Messages */
.notification {
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid;
}

.notification-success {
    background: color-mix(in srgb, var(--success) 15%, var(--bg-surface));
    border-left-color: var(--success);
    color: color-mix(in srgb, var(--success) 80%, var(--text-primary));
}

.notification-info {
    background: color-mix(in srgb, var(--accent-primary) 15%, var(--bg-surface));
    border-left-color: var(--accent-primary);
    color: color-mix(in srgb, var(--accent-primary) 80%, var(--text-primary));
}

.notification-warning {
    background: color-mix(in srgb, var(--warning) 15%, var(--bg-surface));
    border-left-color: var(--warning);
    color: color-mix(in srgb, var(--warning) 80%, var(--text-primary));
}

.notification-error {
    background: color-mix(in srgb, var(--danger) 15%, var(--bg-surface));
    border-left-color: var(--danger);
    color: color-mix(in srgb, var(--danger) 80%, var(--text-primary));
}

.notification strong {
    font-size: 16px;
}

.notification .notification-details {
    margin-top: 10px;
    color: inherit;
    opacity: 0.9;
}

.notification .notification-hint {
    margin-top: 10px;
    font-size: 13px;
    opacity: 0.8;
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 4px;
    z-index: 100;
}

.theme-toggle button {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle button:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.theme-toggle button.active {
    background: var(--accent-primary);
    color: white;
}

/* Highlights */
.mark-exact {
    background: rgba(255, 215, 0, 0.35);
    color: var(--text-primary);
    padding: 0 2px;
    border-radius: 3px;
}

.mark-semantic {
    background: rgba(56, 139, 253, 0.25);
    color: var(--text-primary);
    padding: 0 2px;
    border-radius: 3px;
}

/* Snippet formatting */
.snippet-text {
    margin-bottom: 8px;
}

.snippet-code-block {
    border: 1px solid var(--border-default);
    border-radius: 8px;
    margin-top: 10px;
    overflow: hidden;
    background: var(--bg-elevated);
}

.snippet-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
    font-size: 12px;
    color: var(--text-muted);
}

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

.snippet-code-actions button {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.snippet-code-actions button:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.snippet-code {
    margin: 0;
    padding: 12px 14px;
    background: var(--bg-primary);
    overflow-x: auto;
    max-height: none;
}

.snippet-code.collapsed {
    max-height: 240px;
    overflow: hidden;
}

.snippet-code code {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-primary);
}

/* Diff preview */
.diff-btn {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.diff-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.result-diff {
    display: none;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: var(--bg-elevated);
}

.result-diff.open {
    display: block;
}

.diff-summary {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 12px;
}

.diff-count {
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-surface);
}

.diff-count.added {
    color: var(--success);
}

.diff-count.removed {
    color: var(--danger);
}

.diff-count.unchanged {
    color: var(--text-muted);
}

.diff-section {
    margin-bottom: 12px;
}

.diff-title {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.diff-block {
    margin: 0;
    padding: 10px;
    border-radius: 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.diff-added {
    border-left: 3px solid var(--success);
}

.diff-removed {
    border-left: 3px solid var(--danger);
}

.diff-unchanged {
    border-left: 3px solid var(--border-muted);
}

.diff-error {
    color: var(--danger);
    font-size: 13px;
}

/* Project summary */
.project-summary {
    margin: 12px 0 16px 0;
    padding: 12px 14px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: var(--bg-surface);
}

.project-summary-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.project-summary-details {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
}

.project-suggestion {
    margin: 10px 0 16px 0;
    padding: 10px 12px;
    border: 1px dashed var(--border-default);
    border-radius: 8px;
    background: var(--bg-surface);
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-suggestion strong {
    color: var(--text-primary);
}

.project-suggestion button {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.project-suggestion button:hover {
    background: var(--accent-primary);
    color: white;
}

/* Saved queries */
.saved-queries-panel {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-muted);
}

.saved-queries-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.saved-queries-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--accent-primary);
}

.saved-queries-header button {
    background: var(--accent-secondary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    cursor: pointer;
}

.saved-queries-form {
    display: none;
    margin-bottom: 12px;
    gap: 8px;
}

.saved-queries-form input {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 12px;
    font-family: 'IBM Plex Sans', sans-serif;
}

.saved-queries-actions {
    display: flex;
    gap: 6px;
}

.saved-queries-actions button {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.saved-queries-actions button.secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.saved-query-item {
    padding: 10px 12px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-elevated);
}

.saved-query-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.saved-query-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.saved-query-actions {
    display: flex;
    gap: 6px;
}

.saved-query-actions button {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.saved-query-actions button:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.saved-queries-status {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* Dashboards */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.dashboard-header h2 {
    margin: 0;
    font-size: 26px;
    color: var(--text-primary);
}

.dashboard-header p {
    margin: 4px 0 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

button.link {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.dashboard-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

.dashboard-panel h3 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-size: 18px;
}

.dashboard-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.dashboard-form input {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text-primary);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13px;
}

.dashboard-queries {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.dashboard-query-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text-primary);
}

.dashboard-query-option small {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

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

.dashboard-form-actions button {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    cursor: pointer;
}

.dashboard-status {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.dashboard-list {
    display: grid;
    gap: 12px;
}

.dashboard-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background: var(--bg-elevated);
}

.dashboard-card-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.dashboard-card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

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

.dashboard-card-actions button {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.dashboard-card-actions button.danger {
    border-color: var(--danger);
    color: var(--danger);
}

.dashboard-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.dashboard-view-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.dashboard-view-header p {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

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

.dashboard-builder {
    display: grid;
    gap: 14px;
}

.dashboard-builder-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.dashboard-builder-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.dashboard-builder-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.dashboard-builder-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.dashboard-builder-form input {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text-primary);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13px;
}

.dashboard-builder-widgets {
    display: grid;
    gap: 10px;
}

.dashboard-builder-widget {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 12px;
    display: grid;
    gap: 10px;
}

.dashboard-builder-widget-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr 0.6fr 0.9fr;
    gap: 10px;
}

.dashboard-builder-widget-grid input,
.dashboard-builder-widget-grid select {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text-primary);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13px;
}

.dashboard-builder-widget-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.dashboard-builder-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.dashboard-view-actions .secondary {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.dashboard-widget {
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 14px;
    background: var(--bg-elevated);
}

.dashboard-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.dashboard-widget-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.dashboard-widget-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.dashboard-widget-tag {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-widget-body {
    display: grid;
    gap: 10px;
}

.dashboard-result-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: var(--bg-surface);
}

.dashboard-result-main {
    flex: 1;
    min-width: 0;
}

.dashboard-result-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.dashboard-result-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.dashboard-result-snippet {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.dashboard-result-open {
    align-self: center;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--accent-primary);
    text-decoration: none;
    white-space: nowrap;
}

.dashboard-empty,
.dashboard-loading {
    font-size: 13px;
    color: var(--text-muted);
}

/* Chat Panel */
.chat-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 18px 20px;
    margin: 20px 0 24px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

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

.chat-header h2 {
    margin: 0 0 4px 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    color: var(--text-primary);
}

.chat-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.chat-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    font-size: 13px;
}

.chat-advanced {
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 6px 10px;
    color: var(--text-muted);
}

.chat-advanced summary {
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.chat-advanced[open] {
    background: var(--bg-elevated);
}

.chat-advanced-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 10px 12px;
}

.chat-advanced-wide {
    grid-column: 1 / -1;
}

.chat-system-prompt {
    width: 100%;
    min-height: 80px;
    resize: vertical;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 8px 10px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13px;
}

.chat-controls label {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chat-controls select,
.chat-controls input {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 6px 10px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13px;
}

.chat-textarea {
    width: 100%;
    min-height: 90px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s ease;
}

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

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

.chat-actions button {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-actions button:first-of-type {
    background: var(--accent-primary);
    color: white;
}

.chat-actions button:first-of-type:hover {
    background: var(--accent-secondary);
}

.chat-actions button.secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.chat-actions button.secondary:hover {
    border-color: var(--accent-primary);
}

.chat-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-status {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.chat-status-row {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 20px;
}

.chat-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-default);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: chat-spin 0.8s linear infinite;
    display: none;
}

.chat-spinner.active {
    display: inline-block;
}

@keyframes chat-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.chat-answer {
    margin-top: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 12px 14px;
    white-space: pre-wrap;
    font-size: 14px;
    color: var(--text-primary);
    min-height: 60px;
}

.chat-sources {
    margin-top: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-primary);
}

.chat-sources-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-source-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 0;
    border-top: 1px solid var(--border-muted);
}

.chat-source-item:first-of-type {
    border-top: none;
    padding-top: 0;
}

.chat-source-main {
    flex: 1;
    min-width: 0;
}

.chat-source-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-source-meta {
    color: var(--text-muted);
    font-size: 12px;
}

.chat-source-open {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 500;
    flex: 0 0 auto;
}

.chat-source-open:hover {
    border-color: var(--accent-primary);
    background: var(--bg-surface);
}

/* Splash Screen */
.splash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.splash-overlay.splash-visible {
    opacity: 1;
}

.splash-content {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    padding: 32px 40px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.splash-header {
    text-align: center;
    margin-bottom: 24px;
}

.splash-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.splash-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.splash-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.splash-highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.splash-highlight-item:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.splash-highlight-icon {
    font-size: 24px;
    line-height: 1;
    flex: 0 0 auto;
}

.splash-highlight-text {
    flex: 1;
    min-width: 0;
}

.splash-highlight-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.splash-highlight-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.splash-progress-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.splash-progress-item {
    display: grid;
    grid-template-columns: 24px 120px 20px 1fr 80px;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-muted);
}

.splash-progress-item:last-child {
    border-bottom: none;
}

.splash-progress-icon {
    font-size: 16px;
    text-align: center;
}

.splash-progress-ready .splash-progress-icon {
    color: var(--success);
}

.splash-progress-error .splash-progress-icon {
    color: var(--danger);
}

.splash-progress-loading .splash-progress-icon,
.splash-progress-idle .splash-progress-icon {
    color: var(--text-muted);
}

.splash-progress-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.splash-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-default);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: splash-spin 0.8s linear infinite;
}

@keyframes splash-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.splash-progress-bar {
    height: 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: 3px;
    overflow: hidden;
}

.splash-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.splash-progress-ready .splash-progress-fill {
    background: linear-gradient(90deg, var(--success) 0%, #2ea043 100%);
}

.splash-progress-error .splash-progress-fill {
    background: linear-gradient(90deg, var(--danger) 0%, #da3633 100%);
}

.splash-progress-status {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

.splash-progress-ready .splash-progress-status {
    color: var(--success);
    font-weight: 600;
}

.splash-progress-error .splash-progress-status {
    color: var(--danger);
    font-weight: 600;
}

.splash-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.splash-btn {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

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

.splash-btn-primary:hover:not(:disabled) {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
}

.splash-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.splash-btn-secondary:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    z-index: 10000;
    text-decoration: none;
    font-weight: 600;
}

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

/* Enhanced focus styles */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Responsive design */
@media (max-width: 768px) {
    .splash-content {
        padding: 24px;
    }

    .splash-header h1 {
        font-size: 32px;
    }

    .splash-highlights {
        grid-template-columns: 1fr;
    }

    .splash-progress-item {
        grid-template-columns: 24px 1fr 20px;
        gap: 8px;
    }

    .splash-progress-bar,
    .splash-progress-status {
        grid-column: 1 / -1;
    }

    .splash-actions {
        flex-direction: column;
    }
}

/* ============================================================
   Phase 3A: Chat Panel Collapse
   ============================================================ */
.chat-panel.collapsed .chat-body {
    display: none;
}

.chat-panel.collapsed .chat-header {
    margin-bottom: 0;
}

.chat-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-right: 8px;
    flex-shrink: 0;
}

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

/* ============================================================
   Phase 3B: Sidebar Section Collapse
   ============================================================ */
.sidebar-section-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-section-toggle::after {
    content: '▼';
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.section-collapsed .sidebar-section-toggle::after {
    transform: rotate(-90deg);
}

.section-collapsed .sidebar-section-content {
    display: none;
}

/* ============================================================
   Phase 4A: Sidebar Drawer Toggles
   ============================================================ */
.sidebar-drawer-toggle {
    display: none;
    position: fixed;
    z-index: 999;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 8px 14px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-drawer-toggle:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.sidebar-drawer-toggle-left {
    bottom: 20px;
    left: 20px;
}

.sidebar-drawer-toggle-right {
    bottom: 20px;
    right: 20px;
}

@media (max-width: 1400px) {
    .sidebar-drawer-toggle {
        display: block;
    }
}

/* Sidebar Backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* ============================================================
   Phase 4B: Mobile Optimizations
   ============================================================ */
@media (max-width: 768px) {
    .search-box {
        font-size: 18px;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filters label {
        width: 100%;
    }

    .filters select {
        width: 100%;
    }

    .toolbar {
        gap: 6px;
    }

    .toolbar > button {
        font-size: 12px;
        padding: 6px 10px;
    }
}
