:root {
    --color-bg: #0a0f0d;
    --color-sidebar: #0d1210;
    --color-card: #131a16;
    --color-card-hover: #1a2420;
    --color-border: #1e2a24;
    --color-text: #e8efe8;
    --color-muted: #8a9b91;
    --color-accent: #3dd68c;
    --color-accent-dim: #1a5c3a;
    --color-critical: #ef4444;
    --color-critical-bg: rgba(239, 68, 68, 0.15);
    --color-high: #f97316;
    --color-high-bg: rgba(249, 115, 22, 0.15);
    --color-medium: #fbbf24;
    --color-medium-bg: rgba(234, 179, 8, 0.15);
    --color-low: #8b95a5;
    --color-low-bg: rgba(107, 114, 128, 0.15);
    --color-info: #3b82f6;
    --color-terminal-bg: #0a0f0d;
    --color-code-bg: #0d1210;
    --color-tip: #22d3ee;
    --color-tip-bg: rgba(34, 211, 238, 0.12);
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    margin: 0;
    min-height: 100vh;
}

.sidebar {
    width: 200px;
    background: var(--color-sidebar);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
}

.sidebar-logo {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--color-accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-nav {
    padding: 12px 0;
}

.sidebar-spacer {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--color-muted);
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--color-card);
    color: var(--color-text);
}

.nav-item.active {
    background: var(--color-card);
    color: var(--color-accent);
    border-left-color: var(--color-accent);
}

.nav-item-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item-label {
    font-size: 14px;
    font-weight: 500;
}

.nav-item-status {
    font-size: 10px;
    text-transform: uppercase;
    margin-left: auto;
}

.nav-item-status.running {
    color: var(--color-accent);
}

.sidebar-footer {
    padding: 12px 0;
    border-top: 1px solid var(--color-border);
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-muted);
    padding: 16px 16px 8px;
    letter-spacing: 0.5px;
}

.persona-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--color-muted);
    border-left: 3px solid transparent;
    transition: all 0.15s;
    cursor: pointer;
}

.persona-item:hover {
    background: var(--color-card);
    color: var(--color-text);
}

.persona-item.active {
    background: var(--color-card);
    color: var(--color-text);
    border-left-color: var(--color-accent);
}

.persona-item.is-running .connection-indicator.connected {
    animation: pulse 2s infinite;
}

.persona-icon {
    width: 20px;
    height: 20px;
    opacity: 0.6;
    filter: brightness(0) saturate(100%) invert(70%) sepia(5%) saturate(500%) hue-rotate(90deg);
}

.persona-item:hover .persona-icon,
.persona-item.active .persona-icon {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(75%) sepia(50%) saturate(500%) hue-rotate(90deg) brightness(1.2);
}

.persona-label {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.persona-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.persona-status {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--color-card-hover);
    color: var(--color-muted);
}

.persona-status.running {
    background: var(--color-accent-dim);
    color: var(--color-accent);
}

.persona-status.completed {
    background: var(--color-accent-dim);
    color: var(--color-accent);
}

.persona-status.cancelled {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
}

.persona-status.empty {
    display: none;
}

.persona-count {
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--color-medium);
    color: var(--color-bg);
}

.persona-item.has-findings .persona-count {
    background: var(--color-high);
    color: white;
}

.connection-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.connection-indicator.connected {
    background: var(--color-accent);
    box-shadow: 0 0 6px var(--color-accent);
}

.connection-indicator.disconnected {
    background: var(--color-muted);
    opacity: 0.5;
}

.nav-item-icon {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    filter: brightness(0) saturate(100%) invert(70%) sepia(5%) saturate(500%) hue-rotate(90deg);
}

.nav-item:hover .nav-item-icon {
    opacity: 1;
}

.main-content {
    margin-left: 200px;
    margin-right: 280px;
    min-height: 100vh;
}

.main-header {
    background: var(--color-sidebar);
    border-bottom: 1px solid var(--color-border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
}

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

.project-info h1 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.project-info .audit-id {
    font-size: 12px;
    color: var(--color-muted);
}

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

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

.stat-label {
    font-size: 10px;
    color: var(--color-muted);
    text-transform: uppercase;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-accent);
    font-size: 12px;
    font-weight: 600;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--color-accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.completed-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-accent);
    font-size: 12px;
    font-weight: 600;
    background: var(--color-accent-dim);
    padding: 4px 10px;
    border-radius: 4px;
}

.completed-icon {
    font-size: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-input {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--color-text);
    font-size: 13px;
    width: 200px;
}

.search-input::placeholder {
    color: var(--color-muted);
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: 6px;
}

.btn-stop {
    background: var(--color-critical);
    color: white;
}

.btn-stop:hover:not(:disabled) {
    background: #dc2626;
}

.btn-stop.disabled,
.btn-stop:disabled {
    background: var(--color-border);
    color: var(--color-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-export {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.btn-export:hover:not(:disabled) {
    background: var(--color-accent-dim);
}

.btn-export.disabled,
.btn-export:disabled {
    color: var(--color-muted);
    border-color: var(--color-border);
    cursor: not-allowed;
    opacity: 0.6;
}

.main-body {
    padding: 24px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

.audit-pipeline {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
}

.pipeline-title {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--color-muted);
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.pipeline-steps {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pipeline-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 6px;
    transition: background 0.15s;
}

.pipeline-step:hover {
    background: var(--color-card-hover);
}

.pipeline-step.active {
    background: var(--color-card-hover);
}

.step-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.step-indicator.completed {
    background: var(--color-accent-dim);
    color: var(--color-accent);
}

.step-indicator.active {
    background: var(--color-accent);
    color: var(--color-bg);
}

.step-indicator.pending {
    background: var(--color-border);
    color: var(--color-muted);
}

.step-indicator.cancelled {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
}

.step-content {
    flex: 1;
    min-width: 0;
}

.step-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.step-status {
    font-size: 12px;
    color: var(--color-muted);
}

.step-status.running {
    color: var(--color-accent);
}

.content-area {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.top-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.panel {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
}

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

.panel-title {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.confidence-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.confidence-badge.high {
    background: var(--color-accent-dim);
    color: var(--color-accent);
}

.confidence-badge.medium {
    background: var(--color-medium-bg);
    color: var(--color-medium);
}

.confidence-badge.low {
    background: var(--color-low-bg);
    color: var(--color-muted);
}

.confidence-badge.complete {
    background: var(--color-accent-dim);
    color: var(--color-accent);
}

.confidence-bar {
    height: 6px;
    background: var(--color-border);
    border-radius: 3px;
    margin-bottom: 16px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent-dim), var(--color-accent));
    border-radius: 3px;
    transition: width 0.3s;
}

.terminal {
    background: var(--color-terminal-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 12px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 12px;
    line-height: 1.6;
    max-height: 140px;
    overflow-y: auto;
}

.terminal-line {
    color: var(--color-muted);
}

.terminal-line.highlight {
    color: var(--color-accent);
}

.terminal-prefix {
    color: var(--color-accent);
}

/* Activity Feed */
.activity-feed {
    background: var(--color-terminal-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 12px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 12px;
    line-height: 1.8;
    max-height: 160px;
    overflow-y: auto;
}

.activity-entry {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.activity-prefix::before {
    content: '$';
    color: var(--color-accent);
}

.activity-entry.finding .activity-prefix::before {
    content: '!';
}

.activity-entry.complete .activity-prefix::before {
    content: '+';
}

.activity-entry.step .activity-prefix::before {
    content: '>';
}

.activity-prefix.critical::before,
.activity-prefix.high::before {
    color: var(--color-critical);
}

.activity-prefix.medium::before {
    color: var(--color-medium);
}

.activity-prefix.low::before {
    color: var(--color-low);
}

.activity-prefix.complete::before {
    color: var(--color-accent);
}

.activity-message {
    color: var(--color-muted);
    flex: 1;
}

.activity-entry.finding .activity-message {
    color: var(--color-text);
}

.activity-status {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-accent);
    animation: pulse 2s infinite;
}

.activity-empty {
    color: var(--color-muted);
    text-align: center;
    padding: 20px;
}

.severity-chart {
    display: flex;
    align-items: center;
    gap: 24px;
}

.donut-container {
    position: relative;
    width: 120px;
    height: 120px;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-total {
    font-size: 28px;
    font-weight: 700;
}

.donut-label {
    font-size: 10px;
    color: var(--color-muted);
    text-transform: uppercase;
}

.severity-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

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

.legend-dot.critical { background: var(--color-critical); }
.legend-dot.high { background: var(--color-high); }
.legend-dot.medium { background: var(--color-medium); }
.legend-dot.low { background: var(--color-low); }

.legend-count {
    margin-left: auto;
    font-weight: 600;
}

.findings-panel {
    flex: 1;
}

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

.findings-title {
    font-size: 14px;
    font-weight: 600;
}

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

.findings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.finding-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
    padding-left: 20px;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 4px solid var(--color-low);
    position: relative;
}

.finding-card.critical {
    border-left-color: var(--color-critical);
}

.finding-card.high {
    border-left-color: var(--color-high);
}

.finding-card.medium {
    border-left-color: var(--color-medium);
}

.finding-card.low {
    border-left-color: var(--color-low);
}

.finding-card:hover {
    background: var(--color-card-hover);
}

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

.finding-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.severity-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-badge.critical {
    background: var(--color-critical);
    color: white;
}

.severity-badge.high {
    background: var(--color-high);
    color: white;
}

.severity-badge.medium {
    background: var(--color-medium);
    color: var(--color-bg);
}

.severity-badge.low {
    background: var(--color-low);
    color: white;
}

.tip-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--color-tip-bg);
    color: var(--color-tip);
    border: 1px solid rgba(34, 211, 238, 0.25);
}

.finding-file {
    font-size: 13px;
    color: var(--color-text);
    font-family: 'SF Mono', Monaco, monospace;
}

.finding-time {
    font-size: 12px;
    color: var(--color-muted);
}

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

.finding-code-block {
    background: var(--color-terminal-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 12px 16px;
    overflow-x: auto;
}

.finding-code-content {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    color: var(--color-critical);
    white-space: pre;
    display: block;
}

.file-explorer {
    width: 280px;
    background: var(--color-sidebar);
    border-left: 1px solid var(--color-border);
    height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    display: flex;
    flex-direction: column;
}

.explorer-header {
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
    font-weight: 600;
}

.explorer-tree {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-muted);
}

.tree-item:hover {
    background: var(--color-card);
    color: var(--color-text);
}

.tree-item.selected {
    background: var(--color-card);
    color: var(--color-accent);
}

.tree-indent {
    width: 16px;
}

.tree-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--color-low);
    color: white;
}

.tree-badge.critical { background: var(--color-critical); }
.tree-badge.high { background: var(--color-high); }
.tree-badge.medium { background: var(--color-medium); color: var(--color-bg); }
.tree-badge.low { background: var(--color-low); }

.explorer-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--color-border);
    font-size: 12px;
    color: var(--color-muted);
}

.explorer-footer strong {
    color: var(--color-text);
    display: block;
    margin-bottom: 4px;
}

.explorer-stats {
    padding: 8px 16px;
    font-size: 11px;
    color: var(--color-muted);
    border-bottom: 1px solid var(--color-border);
}

.empty-explorer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--color-muted);
    text-align: center;
    gap: 12px;
    font-size: 13px;
}

.empty-explorer-icon {
    width: 32px;
    height: 32px;
    opacity: 0.4;
    filter: brightness(0) saturate(100%) invert(70%) sepia(5%) saturate(500%) hue-rotate(90deg);
}

.tree-item-icon {
    width: 16px;
    height: 16px;
    opacity: 0.6;
    filter: brightness(0) saturate(100%) invert(70%) sepia(5%) saturate(500%) hue-rotate(90deg);
}

.tree-item:hover .tree-item-icon,
.tree-item.selected .tree-item-icon {
    opacity: 1;
}

.tree-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-node {
    width: 100%;
}

.tree-children {
    width: 100%;
}

.tree-item.depth-1 {
    padding-left: 24px;
}

.tree-item.depth-2 {
    padding-left: 40px;
}

.tree-item.depth-3 {
    padding-left: 56px;
}

.tree-item.has-findings {
    color: var(--color-text);
}

.explorer-footer-path {
    font-size: 11px;
    color: var(--color-muted);
    margin-top: 4px;
    word-break: break-all;
}

.explorer-footer-findings {
    color: var(--color-medium);
    font-weight: 500;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
}

.modal {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.finding-modal {
    border-left: 4px solid var(--color-low);
}

.finding-modal.critical {
    border-left-color: var(--color-critical);
}

.finding-modal.high {
    border-left-color: var(--color-high);
}

.finding-modal.medium {
    border-left-color: var(--color-medium);
}

.finding-modal.low {
    border-left-color: var(--color-low);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.modal-title-section {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.modal-title-section .severity-badge {
    margin-top: 2px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.modal-subtitle {
    font-size: 12px;
    color: var(--color-muted);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-id {
    font-family: 'SF Mono', Monaco, monospace;
}

.modal-separator {
    color: var(--color-border);
}

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

.modal-actions .btn-icon {
    color: var(--color-muted);
}

.modal-actions .btn-icon:hover {
    color: var(--color-text);
}

.modal-body {
    padding: 24px;
}

.detail-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.detail-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px 20px;
}

.detail-card-label {
    font-size: 10px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.detail-card-value {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cwe-info {
    font-size: 12px;
    color: var(--color-muted);
    cursor: help;
}

.section-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 16px;
}

.section-card.remediation {
    background: rgba(61, 214, 140, 0.05);
    border-color: rgba(61, 214, 140, 0.2);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.section-header .btn-copy {
    margin-left: auto;
}

.section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-icon.warning {
    color: var(--color-critical);
}

.section-icon.success {
    color: var(--color-accent);
}

.section-title-text {
    font-size: 16px;
    font-weight: 600;
}

.section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title .icon {
    color: var(--color-critical);
}

.section-title .icon.success {
    color: var(--color-accent);
}

.vulnerability-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-muted);
    margin-bottom: 16px;
}

.vulnerability-desc code {
    background: var(--color-card);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    color: var(--color-text);
}

.code-block {
    background: var(--color-code-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.code-filename {
    font-size: 12px;
    color: var(--color-muted);
    font-family: 'SF Mono', Monaco, monospace;
}

.code-label {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
}

.code-label.vulnerable {
    background: var(--color-critical-bg);
    color: var(--color-critical);
}

.code-label.secure {
    background: var(--color-accent-dim);
    color: var(--color-accent);
}

.code-block.secure {
    border-color: rgba(61, 214, 140, 0.3);
}

.code-content {
    padding: 16px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
}

.code-line {
    display: flex;
    gap: 16px;
    padding: 2px 0;
}

.code-line.highlighted {
    background: var(--color-critical-bg);
    margin: 0 -16px;
    padding: 2px 16px;
    border-left: 3px solid var(--color-critical);
}

.code-line.highlighted .line-number {
    color: var(--color-critical);
    font-weight: 600;
}

.code-line.highlighted .line-code {
    color: var(--color-critical);
}

.code-line.highlighted-secure {
    background: var(--color-accent-dim);
    margin: 0 -16px;
    padding: 2px 16px;
    border-left: 3px solid var(--color-accent);
}

.code-line.highlighted-secure .line-number {
    color: var(--color-accent);
    font-weight: 600;
}

.code-line.highlighted-secure .line-code {
    color: var(--color-accent);
}

.line-number {
    color: var(--color-muted);
    user-select: none;
    min-width: 24px;
}

.line-code {
    flex: 1;
    color: var(--color-text);
}

.btn-copy {
    background: var(--color-accent-dim);
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
}

.btn-copy svg {
    flex-shrink: 0;
}

.btn-copy:hover {
    background: var(--color-accent);
    color: var(--color-bg);
}

.btn-copy:hover svg {
    stroke: var(--color-bg);
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--color-muted);
}

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

.empty-state-text {
    font-size: 14px;
}

.empty-audit-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
}

.empty-audit-icon {
    width: 80px;
    height: 80px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.empty-audit-icon img {
    width: 40px;
    height: 40px;
    opacity: 0.6;
    filter: brightness(0) saturate(100%) invert(75%) sepia(50%) saturate(500%) hue-rotate(90deg) brightness(1.2);
}

.empty-audit-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--color-text);
}

.empty-audit-desc {
    font-size: 14px;
    color: var(--color-muted);
    margin: 0 0 32px 0;
}

.empty-audit-instruction {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.instruction-label {
    font-size: 12px;
    color: var(--color-muted);
    white-space: nowrap;
}

.instruction-code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    color: var(--color-accent);
    background: var(--color-bg);
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

.btn-copy-cmd {
    background: var(--color-card-hover);
    border: 1px solid var(--color-border);
    color: var(--color-muted);
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-copy-cmd:hover {
    background: var(--color-accent-dim);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: var(--color-bg);
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: var(--color-muted);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast.success {
    background: var(--color-accent);
    color: var(--color-bg);
}

.toast.error {
    background: var(--color-critical);
    color: white;
}

.toast.warning {
    background: var(--color-medium);
    color: var(--color-bg);
}

.toast.info {
    background: var(--color-card);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.toast-enter {
    animation: toast-in 0.2s ease-out;
}

.toast-leave {
    animation: toast-out 0.2s ease-in;
}

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

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

/* Filter Dropdown */
.filter-dropdown-container {
    position: relative;
}

.filter-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    min-width: 160px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.filter-option:first-child {
    border-radius: 8px 8px 0 0;
}

.filter-option:last-child {
    border-radius: 0 0 8px 8px;
}

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

.filter-option.active {
    background: var(--color-accent-dim);
    color: var(--color-accent);
}

.btn.active {
    background: var(--color-accent-dim);
    color: var(--color-accent);
    border-color: var(--color-accent);
}

/* Export Dropdown */
.export-dropdown-container {
    position: relative;
}

.export-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    min-width: 150px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.export-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.export-option:first-child {
    border-radius: 8px 8px 0 0;
}

.export-option:last-child {
    border-radius: 0 0 8px 8px;
}

.export-option:hover:not(.disabled) {
    background: var(--color-bg);
}

.export-option.disabled {
    color: var(--color-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.export-option-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.export-option:hover:not(.disabled) .export-option-icon {
    opacity: 1;
}

.coming-soon-badge {
    margin-left: auto;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--color-border);
    color: var(--color-muted);
}

/* Settings Modal */
.settings-modal {
    max-width: 480px;
}

.settings-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.settings-description {
    font-size: 12px;
    color: var(--color-muted);
    margin-bottom: 12px;
}

.settings-select {
    width: 100%;
    padding: 8px 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    font-size: 13px;
}

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

.settings-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}

.settings-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-accent);
}

[x-cloak] {
    display: none !important;
}

/* Reports View */
.reports-view {
    padding: 24px;
    min-height: calc(100vh - 60px);
}

.reports-list-view {
    max-width: 900px;
    margin: 0 auto;
}

.reports-header {
    margin-bottom: 24px;
}

.reports-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.filter-group {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 6px 14px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-btn:hover {
    background: var(--color-card-hover);
    color: var(--color-text);
}

.filter-btn.active {
    background: var(--color-accent-dim);
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.reports-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.report-item:hover {
    background: var(--color-card-hover);
    border-color: var(--color-accent);
}

.report-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.report-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}

.report-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--color-muted);
}

.report-size {
    color: var(--color-muted);
}

.report-date {
    font-size: 13px;
    color: var(--color-muted);
    white-space: nowrap;
}

.audit-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.audit-badge.security {
    background: var(--color-critical-bg);
    color: var(--color-critical);
}

.audit-badge.accessibility,
.audit-badge.a11y {
    background: var(--color-medium-bg);
    color: var(--color-medium);
}

.audit-badge.devops {
    background: rgba(61, 214, 140, 0.15);
    color: var(--color-accent);
}

.audit-badge.principal {
    background: var(--color-tip-bg);
    color: var(--color-tip);
}

.audit-badge.unknown {
    background: var(--color-low-bg);
    color: var(--color-muted);
}

.reports-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--color-muted);
    gap: 16px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.reports-empty {
    padding: 80px 20px;
}

/* Report Detail View */
.report-detail-view {
    display: flex;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.report-sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
    height: fit-content;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 20px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.back-btn:hover {
    background: var(--color-card-hover);
    color: var(--color-text);
}

.section-nav {
    display: flex;
    flex-direction: column;
}

.section-nav a {
    display: block;
    padding: 8px 14px;
    color: var(--color-muted);
    text-decoration: none;
    font-size: 13px;
    border-left: 2px solid var(--color-border);
    transition: all 0.15s;
    cursor: pointer;
}

.section-nav a:hover {
    color: var(--color-text);
    background: var(--color-card);
}

.section-nav a.active {
    color: var(--color-accent);
    border-left-color: var(--color-accent);
    background: var(--color-card);
}

.section-nav a.level-2 {
    padding-left: 28px;
    font-size: 12px;
}

.report-content-wrapper {
    flex: 1;
    min-width: 0;
}

.report-content {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 32px 40px;
}

.report-content h1,
.report-content h2,
.report-content h3 {
    color: var(--color-text);
    margin-top: 32px;
    margin-bottom: 16px;
    scroll-margin-top: 24px;
}

.report-content h1:first-child {
    margin-top: 0;
}

.report-content h1 {
    font-size: 28px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.report-content h2 {
    font-size: 22px;
}

.report-content h3 {
    font-size: 18px;
}

.report-content p {
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: 16px;
}

.report-content li {
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: 8px;
}

.report-content ul,
.report-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.report-content code {
    background: var(--color-bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    color: var(--color-accent);
}

.report-content pre {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px 20px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.report-content pre code {
    background: transparent;
    padding: 0;
    color: var(--color-text);
    font-size: 13px;
    line-height: 1.5;
}

.report-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.report-content th,
.report-content td {
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    text-align: left;
}

.report-content th {
    background: var(--color-bg);
    font-weight: 600;
    color: var(--color-text);
}

.report-content td {
    color: var(--color-text);
}

.report-content blockquote {
    border-left: 4px solid var(--color-accent);
    margin: 16px 0;
    padding: 12px 20px;
    background: var(--color-bg);
    border-radius: 0 8px 8px 0;
}

.report-content blockquote p {
    margin: 0;
    color: var(--color-muted);
}

.report-content a {
    color: var(--color-accent);
    text-decoration: none;
}

.report-content a:hover {
    text-decoration: underline;
}

.report-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 32px 0;
}

.report-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--color-muted);
    gap: 16px;
}

/* Reports view layout - remove file explorer margin */
.reports-view {
    margin-right: -280px;
}
