/* SourceScan.ai - Main Stylesheet */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #0f172a;
    --accent: #06b6d4;
    --text: #1e293b;
    --text-light: #64748b;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --border: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--secondary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.logo span {
    color: var(--accent);
}

.nav-btn {
    background: var(--primary);
    color: #fff;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, #1e3a5f 100%);
    color: #fff;
    padding: 5rem 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero p {
    font-size: 1.25rem;
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.cta-btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 1rem 2.5rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.cta-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    text-decoration: none;
}

/* Section Shared Styles */
.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 700px;
    margin: -1.5rem auto 3rem;
}

/* How It Works Section */
.how-it-works {
    padding: 5rem 2rem;
    background: #fff;
}

.how-it-works h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--secondary);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.step {
    text-align: center;
    padding: 1.5rem;
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step h3 {
    font-size: 1.2rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.step p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Features Section */
.features {
    padding: 5rem 2rem;
    background: var(--bg-alt);
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
}

.feature-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: #fff;
    font-size: 1.5rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--secondary);
}

.feature-card p {
    color: var(--text-light);
}

/* Benefits Section */
.benefits {
    padding: 5rem 2rem;
    background: #fff;
}

.benefits h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--secondary);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.benefit {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-alt);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.benefit-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.benefit-content h3 {
    font-size: 1.1rem;
    color: var(--secondary);
    margin-bottom: 0.25rem;
}

.benefit-content p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Tech Section */
.tech-section {
    padding: 5rem 2rem;
    background: linear-gradient(135deg, var(--secondary) 0%, #1e3a5f 100%);
    color: #fff;
}

.tech-content {
    max-width: 900px;
    margin: 0 auto;
}

.tech-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.tech-section > .tech-content > p {
    color: #cbd5e1;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.tech-list {
    list-style: none;
    padding: 0;
}

.tech-list li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #e2e8f0;
}

.tech-list li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

.tech-list li strong {
    color: #fff;
}

/* CTA Section */
.cta-section {
    padding: 5rem 2rem;
    text-align: center;
    background: var(--bg-alt);
}

.cta-section h2 {
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.cta-section p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Partners Section */
.partners {
    padding: 4rem 2rem;
    text-align: center;
    background: #fff;
}

.partners h2 {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-weight: 500;
}

.partner-list {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.partner {
    text-align: center;
}

.partner a {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary);
}

.partner span {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Footer */
.footer {
    background: var(--secondary);
    color: #94a3b8;
    padding: 2rem;
    text-align: center;
}

.footer p {
    font-size: 0.875rem;
}

.footer a {
    color: #cbd5e1;
}

.footer a:hover {
    color: #fff;
}

.footer-links {
    margin-top: 0.5rem;
}

.footer-links a {
    margin: 0 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .header {
        padding: 1rem;
    }

    .features,
    .how-it-works,
    .benefits,
    .tech-section,
    .cta-section {
        padding: 3rem 1rem;
    }

    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .tech-section h2,
    .benefits h2,
    .how-it-works h2,
    .cta-section h2 {
        font-size: 1.5rem;
    }
}

/* ===========================================
   LOGIN PAGE STYLES
   =========================================== */

.login-container {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-alt);
}

.login-box {
    background: #fff;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 420px;
}

.login-box h1 {
    font-size: 1.75rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
}

.form-group input,
.form-select,
.form-textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.remember-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.forgot-link {
    font-size: 0.9rem;
}

.btn-login {
    background: var(--primary);
    color: #fff;
    padding: 0.875rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover {
    background: var(--primary-dark);
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.nav-link {
    color: #cbd5e1;
    font-weight: 500;
}

.nav-link:hover {
    color: #fff;
}

/* ===========================================
   DASHBOARD LAYOUT
   =========================================== */

.dashboard-body {
    background: var(--bg-alt);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--secondary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-new-project-btn {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    transition: background 0.15s;
}

.header-new-project-btn:hover {
    background: var(--primary-dark);
}

.user-info {
    color: #94a3b8;
    font-size: 0.9rem;
}

.user-info strong {
    color: #fff;
}

.dashboard-container {
    display: flex;
    min-height: calc(100vh - 56px);
}

.dashboard-sidebar {
    width: 240px;
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    flex-shrink: 0;
}

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

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text);
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.sidebar-link:hover {
    background: var(--bg-alt);
    text-decoration: none;
}

.sidebar-link.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

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

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 1rem 0;
}

.sidebar-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-light);
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Company Switcher */
.company-switcher {
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

.company-switcher-form {
    display: flex;
}

.company-switcher-select {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    background: var(--bg-alt);
    color: var(--text);
    cursor: pointer;
}

.company-switcher-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.company-label {
    padding: 0.5rem 1.5rem;
    margin-bottom: 0.25rem;
}

.company-label-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

/* Impersonation Banner */
.impersonation-banner {
    background: #fef3c7;
    border-bottom: 2px solid #f59e0b;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.impersonation-info {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    line-height: 1.3;
}

.impersonation-label {
    color: #92400e;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
}

.impersonation-as {
    color: #92400e;
    font-size: 0.7rem;
}

.impersonation-end {
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.impersonation-end:hover {
    background: #b91c1c;
    text-decoration: none;
}

/* Sidebar Footer / User Info */
.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.5rem;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user-avatar.avatar-super {
    background: #f59e0b;
}

.sidebar-user-avatar.avatar-admin {
    background: #8b5cf6;
}

.sidebar-user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: var(--text-light);
}

.super-admin-badge {
    color: #d97706;
    font-weight: 600;
}

.company-admin-badge {
    color: #7c3aed;
    font-weight: 600;
}

.sidebar-logout-link {
    font-size: 0.85rem;
    color: var(--text-light) !important;
}

.sidebar-logout-link:hover {
    color: #dc2626 !important;
}

/* Super Admin sidebar section */
.sidebar-super-admin-title {
    color: #d97706;
}

.sidebar-link-admin {
    color: #d97706 !important;
}

.sidebar-link-admin:hover {
    background: #fffbeb;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
}

.dashboard-main {
    flex: 1;
    padding: 1.5rem 2rem;
    overflow-x: auto;
}

.dashboard-header-bar {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.dashboard-header-bar h1 {
    font-size: 1.75rem;
    color: var(--secondary);
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--text-light);
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--text-light);
}

.breadcrumb a:hover {
    color: var(--primary);
}

/* Project Header */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.project-header h1 {
    font-size: 1.75rem;
    color: var(--secondary);
    margin-bottom: 0.25rem;
}

.project-description-lg {
    color: var(--text-light);
}

.project-header-actions {
    flex-shrink: 0;
}

/* ===========================================
   PROJECT CARDS
   =========================================== */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
}

.project-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    text-decoration: none;
}

.project-card-header {
    padding: 1.25rem 1.5rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-header-icon {
    font-size: 2.2rem;
    line-height: 1;
    flex-shrink: 0;
}

.card-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.project-card h3 {
    font-size: 1.1rem;
    color: #fff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-header-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

/* Severity-colored card headers */
.card-header-critical {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.card-header-high {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

.card-header-medium {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.card-header-low {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.card-header-clean {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.card-header-unscanned {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

/* 4-column severity stats */
.project-stats-4col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.project-stats-4col .stat {
    text-align: center;
    padding: 0.6rem 0.25rem;
}

.project-stats-4col .stat-critical .stat-value {
    color: #dc2626;
}

.project-stats-4col .stat-high .stat-value {
    color: #ea580c;
}

.project-stats-4col .stat-medium .stat-value {
    color: #d97706;
}

.project-stats-4col .stat-low .stat-value {
    color: #16a34a;
}

.project-card-header .badge {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.project-card-body {
    padding: 1.25rem 1.5rem;
    flex: 1;
}

.project-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.meta-item {
    color: var(--text-light);
}

.meta-item strong {
    color: var(--text);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.25rem;
}

.status-dot.status-good { background: #22c55e; }
.status-dot.status-warning { background: #f59e0b; }
.status-dot.status-danger { background: #ef4444; }
.status-dot.status-neutral { background: #94a3b8; }

.project-stats {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background: #eff6ff;
    justify-content: center;
    border-top: 1px solid #dbeafe;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
}

/* ===========================================
   BADGES
   =========================================== */

.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-critical { background: #fef2f2; color: #dc2626; }
.badge-high { background: #fff7ed; color: #ea580c; }
.badge-medium { background: #fefce8; color: #ca8a04; }
.badge-low { background: #eff6ff; color: #2563eb; }
.badge-neutral { background: var(--bg-alt); color: var(--text-light); }

.badge-queued { background: #f3f4f6; color: #6b7280; }
.badge-running { background: #dbeafe; color: #2563eb; }
.badge-complete { background: #dcfce7; color: #16a34a; }
.badge-failed { background: #fef2f2; color: #dc2626; }

.badge-mini {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
}

.text-critical { color: #dc2626; }
.text-success { color: #16a34a; }

/* ===========================================
   TABS
   =========================================== */

.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.25rem;
    color: var(--text-light);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

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

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

.tab-content {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
}

/* ===========================================
   STATS ROW
   =========================================== */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-alt);
    padding: 1.25rem;
    border-radius: 8px;
    text-align: center;
}

.stat-card-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary);
}

.stat-card-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ===========================================
   CONTENT SECTIONS
   =========================================== */

.content-section {
    margin-bottom: 2rem;
}

.content-section h2 {
    font-size: 1.25rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    margin-bottom: 0;
}

.link-more {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Severity Breakdown */
.severity-bar {
    display: flex;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.severity-segment {
    transition: width 0.3s;
}

.severity-segment.critical { background: #dc2626; }
.severity-segment.high { background: #ea580c; }
.severity-segment.medium { background: #eab308; }
.severity-segment.low { background: #2563eb; }

.severity-legend {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-dot.critical { background: #dc2626; }
.legend-dot.high { background: #ea580c; }
.legend-dot.medium { background: #eab308; }
.legend-dot.low { background: #2563eb; }

/* Details List */
.details-list {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 0.75rem 1rem;
}

.details-list dt {
    font-weight: 500;
    color: var(--text-light);
}

.details-list dd {
    color: var(--text);
}

/* ===========================================
   DATA TABLES
   =========================================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--bg-alt);
}

.data-table tbody tr:hover {
    background: var(--bg-alt);
}

.row-clickable {
    cursor: pointer;
}

.data-table code {
    background: var(--bg-alt);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* ===========================================
   BUTTONS
   =========================================== */

.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

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

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

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

.btn-secondary:hover {
    background: var(--border);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 4px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
}

.btn-small:hover {
    background: var(--border);
}

.btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.btn-danger:hover {
    background: #fecaca;
}

.btn-warning {
    background: #fffbeb;
    color: #d97706;
    border-color: #fde68a;
}

.btn-warning:hover {
    background: #fde68a;
}

/* ===========================================
   FILTER BAR
   =========================================== */

.filter-bar {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: 8px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-light);
}

.filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.875rem;
    background: #fff;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.filter-btn.filter-critical:hover,
.filter-btn.filter-critical.active { background: #dc2626; color: #fff; border-color: #dc2626; }
.filter-btn.filter-high:hover,
.filter-btn.filter-high.active { background: #ea580c; color: #fff; border-color: #ea580c; }
.filter-btn.filter-medium:hover,
.filter-btn.filter-medium.active { background: #ca8a04; color: #fff; border-color: #ca8a04; }
.filter-btn.filter-low:hover,
.filter-btn.filter-low.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* ===========================================
   PAGINATION
   =========================================== */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-light);
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-page {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    font-size: 0.875rem;
    cursor: pointer;
}

.btn-page:hover:not(:disabled) {
    border-color: var(--primary);
}

.btn-page.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

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

/* ===========================================
   SCAN COVERAGE
   =========================================== */

.coverage-overview {
    padding: 0.5rem 0;
}

.coverage-progress-wrapper {
    margin-bottom: 1rem;
}

.coverage-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.coverage-pct {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.coverage-progress-bar {
    height: 12px;
    background: var(--bg-light);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
}

.coverage-bar-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.coverage-findings {
    background: #f59e0b;
}

.coverage-clean {
    background: #22c55e;
}

.coverage-skipped {
    background: #6b7280;
}

.coverage-stats-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.coverage-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-light);
}

.coverage-stat strong {
    color: var(--text-primary);
}

.coverage-stat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.coverage-clean-dot {
    background: #22c55e;
}

.coverage-findings-dot {
    background: #f59e0b;
}

.coverage-skipped-dot {
    background: #6b7280;
}

.coverage-error-dot {
    background: #ef4444;
}

.coverage-remaining {
    margin-left: auto;
    color: var(--text-light);
}

.coverage-categories {
    margin-top: 0.75rem;
}

.coverage-categories h4 {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.4rem;
}

.coverage-category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.coverage-category-chip {
    background: var(--bg-light);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ===========================================
   SCANNED FILES TABLE
   =========================================== */

.coverage-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.scanned-files-info {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.scanned-files-table .file-path-small {
    font-size: 0.82rem;
    word-break: break-all;
}

.ext-badge {
    background: var(--bg-light);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-family: monospace;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-muted {
    background: var(--bg-light);
    color: var(--text-light);
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-unscanned {
    background: #e0e7ff;
    color: #3730a3;
}

.scanned-file-row.status-has_findings {
    border-left: 3px solid #f59e0b;
}

.scanned-file-row.status-unscanned {
    opacity: 0.7;
}

/* ===========================================
   FINDINGS STATUS GROUPS
   =========================================== */

.status-summary-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.status-summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 2px solid;
    background: var(--bg-card);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s, transform 0.15s;
}

.status-summary-chip:hover {
    background: var(--bg-light);
    transform: translateY(-1px);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-chip-count {
    background: rgba(255,255,255,0.15);
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-summary-total {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-light);
}

.findings-status-group {
    margin-bottom: 2rem;
}

.status-group-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

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

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

.status-group-count {
    background: var(--bg-light);
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}

.status-group-desc {
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 400;
    font-style: italic;
}

.status-select.status-needs-programmer-review {
    border-color: #dc2626;
    color: #dc2626;
}

/* ===========================================
   SORTABLE TABLE HEADERS
   =========================================== */

.sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.15s;
}

.sortable-th:hover {
    color: var(--primary);
}

.sortable-th.sorted {
    color: var(--primary);
}

.sort-arrow {
    font-size: 0.7rem;
    opacity: 0.7;
}

.sortable-th:hover .sort-arrow:empty::after {
    content: ' \25B2\25BC';
    font-size: 0.6rem;
    opacity: 0.4;
}

/* ===========================================
   FINDINGS TABLE SPECIFICS
   =========================================== */

.finding-row td {
    vertical-align: top;
}

.finding-description {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.line-number {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.risk-score {
    font-weight: 700;
    font-size: 0.9rem;
}

.risk-score.risk-critical { color: #dc2626; }
.risk-score.risk-high { color: #ea580c; }
.risk-score.risk-medium { color: #ca8a04; }
.risk-score.risk-low { color: #2563eb; }

.status-select {
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    cursor: pointer;
}

.status-select.status-open { background: #fef3c7; border-color: #fcd34d; }
.status-select.status-triaged { background: #dbeafe; border-color: #93c5fd; }
.status-select.status-resolved { background: #dcfce7; border-color: #86efac; }
.status-select.status-false-positive { background: #f3f4f6; border-color: #d1d5db; }

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.status-open { background: #fef3c7; color: #92400e; }
.status-badge.status-triaged { background: #dbeafe; color: #1e40af; }
.status-badge.status-resolved { background: #dcfce7; color: #166534; }

.findings-summary {
    display: flex;
    gap: 0.25rem;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(37, 99, 235, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.25rem;
}

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

/* ===========================================
   MODAL
   =========================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--secondary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
}

.modal-large {
    max-width: 800px;
}

/* Finding Detail Styles */
.finding-detail {
    line-height: 1.7;
}

.detail-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.detail-section p {
    color: var(--text);
    white-space: pre-wrap;
}

.detail-section ul {
    margin-left: 1.5rem;
    color: var(--text);
}

.detail-section ul li {
    margin-bottom: 0.25rem;
}

.file-path {
    display: inline-block;
    background: var(--bg-alt);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--primary-dark);
    margin-right: 1rem;
}

.line-info {
    color: var(--text-light);
    font-size: 0.9rem;
}

.detail-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-light);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-badge.status-open {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.status-triaged {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.status-resolved {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.status-false-positive {
    background: #f3f4f6;
    color: #6b7280;
}

.risk-score {
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.risk-critical {
    background: #fef2f2;
    color: #dc2626;
}

.risk-high {
    background: #fff7ed;
    color: #ea580c;
}

.risk-medium {
    background: #fefce8;
    color: #ca8a04;
}

.risk-low {
    background: #f0fdf4;
    color: #16a34a;
}

/* Code Snippet Styles */
.code-snippet {
    background: #1e293b;
    border-radius: 8px;
    overflow: hidden;
}

.code-snippet pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.code-snippet code {
    display: block;
    color: #e2e8f0;
    background: transparent;
    white-space: pre;
}

.code-snippet code.highlighted-line {
    background: rgba(239, 68, 68, 0.25);
    margin: 0 -1rem;
    padding: 0 1rem;
    border-left: 3px solid #ef4444;
}

.code-snippet .line-num {
    display: inline-block;
    width: 4ch;
    margin-right: 1.5rem;
    color: #64748b;
    text-align: right;
    user-select: none;
}

.code-snippet code.highlighted-line .line-num {
    color: #fca5a5;
}

/* Clickable line links in affected files */
.line-link {
    color: #6366f1;
    text-decoration: none;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.85em;
    padding: 1px 4px;
    border-radius: 3px;
    transition: background 0.15s;
}
.line-link:hover {
    background: #eef2ff;
    text-decoration: underline;
}
.line-link-active {
    background: #c7d2fe;
    font-weight: 600;
}
.code-preview-row td {
    background: #1e293b;
}

/* Workflow Status Styles */
.workflow-cell {
    text-align: center;
    font-size: 1.2rem;
}

.workflow-icon {
    display: inline-block;
}

.has-analysis-indicator {
    font-size: 0.9rem;
    margin-left: 0.25rem;
}

.workflow-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-alt);
    color: var(--text);
}

.workflow-pending_analysis { color: #f59e0b; }
.workflow-analyzed { color: #3b82f6; }
.workflow-pending_verification { color: #8b5cf6; }
.workflow-verified { color: #10b981; }
.workflow-remediation_in_progress { color: #f97316; }
.workflow-remediated { color: #22c55e; }

/* Analysis Section Styles */
.analysis-section {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1.5rem;
}

.analysis-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-light);
}

.analysis-content {
    background: #1e293b;
    border-radius: 6px;
    overflow: auto;
    max-height: 400px;
}

.analysis-content pre {
    margin: 0;
    padding: 1rem;
    color: #e2e8f0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Multiple Analysis Notes */
.analysis-note {
    border: 1px solid #e0f2fe;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.analysis-note:last-child {
    margin-bottom: 0;
}

.analysis-note-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f0f9ff;
    cursor: pointer;
    user-select: none;
}

.analysis-note-header:hover {
    background: #e0f2fe;
}

.analysis-note-toggle {
    color: var(--text-light);
    font-size: 0.75rem;
    width: 1rem;
}

.analysis-note-date {
    margin-left: auto;
    color: var(--text-light);
}

.analysis-note-download {
    text-decoration: none;
    font-size: 0.78rem;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    border: 1px solid #bae6fd;
    background: #ffffff;
    color: #0369a1;
    white-space: nowrap;
}

.analysis-note-download:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
}

.analysis-note-view {
    border-color: #c7d2fe;
    color: #4338ca;
}

.analysis-note-view:hover {
    background: #eef2ff;
    border-color: #a5b4fc;
}

.analysis-note-body {
    border-top: 1px solid #e0f2fe;
}

.analysis-note-body .analysis-meta {
    padding: 0.5rem 1rem;
    background: #fafafa;
    border-bottom: 1px solid #e0f2fe;
}

.analysis-note-body .analysis-content {
    border-radius: 0;
}

/* Verification Section Styles */
.verification-section {
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.verified-confirmed {
    color: #dc2626;
    font-weight: 600;
}

.verified-other {
    color: var(--text);
}

/* ===========================================
   AI Q&A PAGE
   =========================================== */

.ai-question-form {
    background: var(--bg-alt);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.form-textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.qa-history {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.qa-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.qa-question {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-alt);
}

.qa-answer {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
}

.qa-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--secondary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.qa-icon.qa-icon-ai {
    background: var(--primary);
}

.qa-content {
    flex: 1;
}

.qa-text {
    margin-bottom: 0.75rem;
}

.qa-meta {
    font-size: 0.8rem;
    color: var(--text-light);
}

.qa-list {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.qa-list li {
    margin-bottom: 0.5rem;
}

.code-block {
    background: var(--secondary);
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    margin: 0.75rem 0;
}

.code-block.code-bad {
    border-left: 4px solid #dc2626;
}

.code-block.code-good {
    border-left: 4px solid #22c55e;
}

.suggested-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.suggested-btn {
    padding: 0.625rem 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* ===========================================
   PROJECT LIST STYLES
   =========================================== */

.projects-section {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-list-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.project-list-item:hover {
    border-color: var(--primary);
}

.project-list-info {
    flex: 1;
    min-width: 0;
}

.project-list-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary);
    display: block;
    margin-bottom: 0.25rem;
}

.project-list-name:hover {
    color: var(--primary);
}

.project-list-desc {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.project-list-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.project-list-stats {
    display: flex;
    gap: 1rem;
}

.mini-stat {
    text-align: center;
    min-width: 50px;
}

.mini-stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
}

.mini-stat-label {
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: uppercase;
}

.text-high {
    color: #ea580c;
}

.project-list-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Available Projects */
.available-projects-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.available-project-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.available-project-info {
    display: flex;
    flex-direction: column;
}

.available-project-name {
    font-weight: 500;
    color: var(--secondary);
}

.available-project-desc {
    font-size: 0.85rem;
    color: var(--text-light);
}

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

/* Sidebar Button */
.sidebar-btn {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
}

/* Modal Enhancements */
.modal-project-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.modal-project-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-alt);
    border-radius: 6px;
    cursor: pointer;
}

.modal-project-option:hover {
    background: var(--border);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ===========================================
   RESPONSIVE DASHBOARD
   =========================================== */

/* Burger menu button - hidden on desktop */
.burger-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 199;
}

@media (max-width: 992px) {
    .dashboard-sidebar {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .burger-btn {
        display: block;
    }

    .dashboard-container {
        flex-direction: row;
    }

    .dashboard-sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        width: 250px;
        height: 100vh;
        z-index: 200;
        border-right: 1px solid var(--border);
        border-bottom: none;
        padding: 1.5rem 0;
        background: #fff;
        transition: left 0.25s ease;
        overflow-y: auto;
    }

    .dashboard-sidebar.open {
        left: 0;
    }

    .sidebar-overlay.open {
        display: block;
    }

    .sidebar-nav {
        flex-direction: column;
    }

    .sidebar-link {
        padding: 0.75rem 1.5rem;
        white-space: normal;
    }

    .sidebar-link.active {
        border-right: 3px solid var(--primary);
        border-bottom: none;
    }

    .dashboard-main {
        padding: 1rem;
        width: 100%;
    }

    .project-header {
        flex-direction: column;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

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

    .filter-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-buttons {
        flex-wrap: wrap;
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }

    .pagination {
        flex-direction: column;
        gap: 1rem;
    }

    .project-list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-list-stats {
        width: 100%;
        justify-content: space-between;
        padding: 1rem 0;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        margin: 0.5rem 0;
    }

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

    .project-list-actions .btn {
        flex: 1;
        text-align: center;
    }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-alt);
    border-radius: 8px;
    border: 2px dashed var(--border);
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Notices */
.notice {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.notice-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.notice-warning {
    background: #fefce8;
    border: 1px solid #fde047;
    color: #854d0e;
}

.notice-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

/* Add Project Form */
.add-project-form {
    background: var(--bg-alt);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.add-project-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.add-project-form .form-group {
    margin-bottom: 1rem;
}

.add-project-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.add-project-form input,
.add-project-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.add-project-form input:focus,
.add-project-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Status Form in Tables */
.status-form {
    display: inline;
}

/* Text Colors */
.text-high {
    color: #dc2626;
}

/* Badge Success */
.badge-success {
    background: #dcfce7;
    color: #166534;
}

/* Form Select in AI page */
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    background: white;
}

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

.form-select:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
}

/* Responsive Add Project Form */
@media (max-width: 768px) {
    .add-project-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   INVENTORY & FOCUS AREAS STYLES
   ============================================ */

/* Project Path Display */
.project-path {
    margin-top: 0.5rem;
}

.project-path code {
    background: var(--bg-alt);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Inventory Categories */
.inventory-categories {
    margin-top: 1.5rem;
}

.inventory-categories h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.category-item {
    background: var(--bg-alt);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.category-name {
    display: block;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.category-count {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
}

.category-lines {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Directory Tree */
.directory-tree-section {
    margin-top: 1.5rem;
}

.directory-tree-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.directory-tree {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

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

.tree-list .tree-list {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.tree-item {
    padding: 0.25rem 0;
}

.tree-folder {
    font-weight: 500;
    color: var(--text);
}

.tree-folder::before {
    content: "\1F4C1 ";
    margin-right: 0.25rem;
}

.tree-count {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-left: 0.5rem;
}

/* Focus Areas */
.focus-area-form {
    background: var(--bg-alt);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.focus-area-inputs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.focus-area-inputs input,
.focus-area-inputs select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
}

.focus-area-inputs input[name="focus_name"] {
    flex: 1;
    min-width: 150px;
}

.focus-area-inputs input[name="focus_path"] {
    flex: 1.5;
    min-width: 200px;
}

.focus-area-inputs select {
    min-width: 120px;
}

.focus-areas-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.focus-area-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    gap: 1rem;
}

.focus-area-item.priority-critical {
    border-left: 4px solid #dc2626;
}

.focus-area-item.priority-high {
    border-left: 4px solid #f97316;
}

.focus-area-info {
    flex: 1;
}

.focus-area-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.focus-area-name {
    font-weight: 600;
    color: var(--text);
}

.focus-area-status {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 500;
}

.focus-area-status.status-pending {
    background: #f1f5f9;
    color: #64748b;
}

.focus-area-status.status-in-progress {
    background: #fef3c7;
    color: #92400e;
}

.focus-area-status.status-analyzed {
    background: #dcfce7;
    color: #166534;
}

.focus-area-priority {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    background: #fef2f2;
    color: #dc2626;
    text-transform: uppercase;
    font-weight: 600;
}

.focus-area-path {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.focus-area-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.focus-area-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Progress Badge */
.progress-badge {
    background: var(--primary);
    color: white;
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

/* Empty State Small */
.empty-state-small {
    padding: 1.5rem;
    text-align: center;
    background: var(--bg-alt);
    border-radius: 8px;
    border: 1px dashed var(--border);
}

.empty-state-small p {
    color: var(--text-light);
    margin: 0;
}

/* Button Secondary */
.btn-secondary {
    background: var(--bg-alt);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

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

/* Responsive Focus Areas */
@media (max-width: 768px) {
    .focus-area-inputs {
        flex-direction: column;
    }

    .focus-area-inputs input,
    .focus-area-inputs select {
        width: 100%;
    }

    .focus-area-item {
        flex-direction: column;
    }

    .focus-area-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ============================================
   Validation Questions Styles
   ============================================ */

/* Pending Validation Section */
.pending-validation-section {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.pending-validation-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #92400e;
    margin-bottom: 0.25rem;
}

.pending-validation-icon {
    font-size: 1rem;
}

.pending-validation-subtitle {
    color: #a16207;
    font-size: 0.78rem;
    margin-bottom: 0.5rem;
}

/* Validation Question Rows */
.validation-question-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #fef3c7;
    font-size: 0.82rem;
}

.validation-question-card:last-child {
    border-bottom: none;
}

.vq-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.vq-question {
    color: #1f2937;
    font-size: 0.82rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.vq-finding-count {
    background: #fef3c7;
    color: #92400e;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.vq-context {
    display: none;
}

.vq-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.vq-actions .btn-small {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
}

.btn-answer {
    background: #f59e0b;
    color: #fff;
    border: none;
}

.btn-answer:hover {
    background: #d97706;
}

/* Finding Row with Pending Validation */
.finding-row.pending-validation {
    background: linear-gradient(90deg, #fef3c7 0%, #fff 20%);
    border-left: 3px solid #f59e0b;
}

.finding-row.pending-validation:hover {
    background: linear-gradient(90deg, #fde68a 0%, #f9fafb 20%);
}

/* Pending Validation Indicator */
.pending-validation-indicator {
    font-size: 0.9rem;
    margin-left: 0.25rem;
}

/* Answer Modal */
.answer-question-text {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 6px;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: #1f2937;
}

/* Validation Question Detail */
.vq-detail {
    padding: 1rem;
}

.vq-detail-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.vq-date {
    color: #6b7280;
    font-size: 0.875rem;
}

.vq-detail-question h3 {
    color: #374151;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.vq-detail-question p {
    font-size: 1.1rem;
    color: #1f2937;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 6px;
}

.vq-detail-context {
    margin-top: 1.5rem;
}

.vq-detail-context h4 {
    color: #374151;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.vq-detail-context pre {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.vq-detail-answer {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #d1fae5;
    border-radius: 6px;
}

.vq-detail-answer h4 {
    color: #065f46;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.vq-detail-answer p {
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.vq-detail-answer small {
    color: #6b7280;
}

/* Linked Findings List */
.vq-linked-findings {
    margin-top: 1.5rem;
}

.vq-linked-findings h4 {
    color: #374151;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.vq-linked-findings ul {
    list-style: none;
    padding: 0;
}

.vq-linked-findings li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.vq-linked-findings li code {
    font-size: 0.75rem;
    color: #6b7280;
    flex-grow: 1;
}

.vq-detail-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Badge Warning */
.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Detail Actions Section */
.detail-actions {
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
    margin-top: 1rem;
}

.detail-actions .btn {
    width: 100%;
}

/* Form improvements */
#create-vq-form .form-group,
#answer-form .form-group {
    margin-bottom: 1rem;
}

#create-vq-form label,
#answer-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

#create-vq-form input,
#create-vq-form textarea,
#answer-form input,
#answer-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
}

#create-vq-form input:focus,
#create-vq-form textarea:focus,
#answer-form input:focus,
#answer-form textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ============================================
   High Alert Indicator Styles
   ============================================ */

/* High Alert Row */
.finding-row.high-alert {
    background: linear-gradient(90deg, #fef2f2 0%, #fff 30%) !important;
    border-left: 4px solid #dc2626 !important;
    position: relative;
}

.finding-row.high-alert:hover {
    background: linear-gradient(90deg, #fee2e2 0%, #f9fafb 30%) !important;
}

/* Workflow cell with high alert */
.workflow-cell.has-high-alert {
    position: relative;
    padding-left: 3rem;
}

/* The yield sign indicator */
.high-alert-indicator {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yield-sign {
    font-size: 2rem;
    color: #dc2626;
    text-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
    animation: pulse-alert 2s ease-in-out infinite;
    line-height: 1;
}

@keyframes pulse-alert {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* High alert badge in detail modal */
.high-alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
    }
}

.high-alert-badge .yield-icon {
    font-size: 1rem;
}

/* Button styles for high alert toggle */
.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
}

/* Detail actions with multiple buttons */
.detail-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.detail-actions .btn {
    flex: 1;
    min-width: 200px;
}

/* ============================================
   Severity Override Styles
   ============================================ */

.detail-severity-override {
    background: #f9fafb;
    border-radius: 6px;
    padding: 1rem;
}

.detail-severity-override h4 {
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.override-badge {
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-weight: 500;
}

.severity-override-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.override-select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 100px;
}

.override-risk {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

.override-reason {
    flex: 1;
    min-width: 150px;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
}

.override-select:focus,
.override-risk:focus,
.override-reason:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Severity colors for override select */
.override-select option[value="critical"] { color: #991b1b; }
.override-select option[value="high"] { color: #c2410c; }
.override-select option[value="medium"] { color: #a16207; }
.override-select option[value="low"] { color: #166534; }

/* ============================================================================
   ANALYSIS CHAT COMPONENT
   ============================================================================ */

.analysis-chat {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.analysis-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: #fff;
    flex-shrink: 0;
}

.analysis-chat-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.chat-icon {
    font-size: 1.3rem;
}

.analysis-chat-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mode-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.25rem;
    cursor: pointer;
}

.mode-toggle span {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    transition: all 0.2s;
}

.mode-toggle span.active {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.mode-toggle:hover span {
    color: #fff;
}

.btn-restart {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-restart:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.chat-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.chat-close:hover {
    color: #fff;
}

.analysis-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* API Chat Mode */
.chat-mode-api {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8fafc;
    min-height: 0;
}

.chat-welcome {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.chat-welcome h3 {
    color: #1e40af;
    margin-bottom: 0.75rem;
}

.chat-welcome ul {
    list-style: none;
    text-align: left;
    max-width: 400px;
    margin: 1rem auto;
}

.chat-welcome li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.chat-welcome li::before {
    content: "~";
    position: absolute;
    left: 0;
    color: #3b82f6;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease;
}

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

.chat-message-user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.chat-message-assistant .message-avatar {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

.chat-message-user .message-avatar {
    background: #64748b;
}

.message-content {
    max-width: 80%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chat-message-user .message-content {
    background: #1e40af;
    color: #fff;
    border-color: #1e40af;
}

.message-text {
    font-size: 0.95rem;
    line-height: 1.6;
}

.message-text code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85em;
}

.chat-message-user .message-text code {
    background: rgba(255, 255, 255, 0.2);
}

.message-text pre.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0.75rem 0;
    font-size: 0.85rem;
}

.message-text pre.code-block code {
    background: none;
    padding: 0;
    color: inherit;
}

.message-meta {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.chat-message-user .message-meta {
    color: rgba(255, 255, 255, 0.6);
}

/* Typing indicator */
.typing-indicator .typing-status {
    font-size: 0.9rem;
    color: #6366f1;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.typing-indicator .typing-dots {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0;
}

.typing-indicator .typing-note {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite both;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Chat input */
.chat-input-area {
    padding: 1rem 1.5rem;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.chat-input-wrapper textarea {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    max-height: 150px;
}

.chat-input-wrapper textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.chat-send {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 8px;
    background: #1e40af;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-send:hover {
    background: #1e3a8a;
}

.chat-send:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.send-icon {
    font-size: 1.2rem;
}

.chat-hints {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.hint-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.hint-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

/* Error messages */
.chat-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem;
    color: #991b1b;
}

.chat-error h3 {
    color: #dc2626;
    margin-bottom: 0.75rem;
}

.chat-error pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 4px;
    margin: 0.75rem 0;
    font-size: 0.85rem;
    overflow-x: auto;
}

.chat-error-message {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin-bottom: 1rem;
    color: #991b1b;
    font-size: 0.9rem;
}

.error-icon {
    color: #dc2626;
}

/* CLI Terminal Mode */
.chat-mode-cli {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
}

.terminal-container {
    flex: 1;
    min-height: 500px;
}

.terminal-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    text-align: center;
    gap: 1rem;
}

.terminal-placeholder p:first-child {
    font-size: 1.5rem;
}

.btn-terminal-connect {
    padding: 0.75rem 1.5rem;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-terminal-connect:hover {
    background: #2563eb;
}

.terminal-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #111;
    color: #9ca3af;
    font-size: 0.8rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6b7280;
}

.status-indicator.connecting {
    background: #f59e0b;
    animation: pulse 1s infinite;
}

.status-indicator.connected {
    background: #22c55e;
}

.status-indicator.disconnected {
    background: #6b7280;
}

.status-indicator.error {
    background: #ef4444;
}

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

/* Analysis chat footer */
.analysis-chat-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
    min-height: 50px;
}

.session-info {
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .session-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .analysis-chat-footer {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .btn-complete {
        width: 100%;
    }
}

.session-id-display {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    background: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: all;
}

.session-id-display:hover {
    background: #cbd5e1;
}

.session-id-display.copied {
    background: #bbf7d0;
    color: #166534;
}

.btn-complete {
    padding: 0.5rem 1rem;
    background: #22c55e;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-complete:hover {
    background: #16a34a;
}

.footer-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-save-note {
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-save-note:hover {
    background: #2563eb;
}

.btn-save-note:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Analysis Chat Modal - overrides base .modal styles */
.analysis-modal.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1001;
    padding: 1.5rem;
    box-sizing: border-box;
    display: block;
}

@media (max-width: 768px) {
    .analysis-modal.modal {
        padding: 0.5rem;
    }
}

.analysis-modal .analysis-modal-content.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

#analysis-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Analysis Sessions List in Finding Modal */
.analysis-sessions-section h3 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: #1e40af;
}

.sessions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.no-sessions,
.loading-sessions {
    color: #64748b;
    font-size: 0.9rem;
    padding: 0.5rem 0;
}

.session-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    width: calc(50% - 0.375rem);
    min-width: 200px;
    cursor: pointer;
    transition: all 0.2s;
}

.session-card:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.session-card.status-active {
    border-left: 3px solid #22c55e;
}

.session-card.status-completed {
    border-left: 3px solid #3b82f6;
}

.session-card.status-abandoned {
    border-left: 3px solid #94a3b8;
    opacity: 0.7;
}

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.session-status-icon {
    font-size: 0.9rem;
}

.session-date {
    font-size: 0.75rem;
    color: #64748b;
}

.session-card-body {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.session-stat {
    font-size: 0.8rem;
}

.stat-label {
    color: #64748b;
}

.stat-value {
    font-weight: 600;
    color: #1e293b;
    margin-left: 0.25rem;
}

.session-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: #94a3b8;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.5rem;
    margin-top: 0.25rem;
}

.session-id {
    font-family: monospace;
}

.session-status {
    text-transform: capitalize;
}

@media (max-width: 600px) {
    .session-card {
        width: 100%;
    }
}

/* Start Analysis Button */
.btn-start-analysis {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-start-analysis:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-start-analysis .ai-icon {
    font-size: 1.1rem;
}

/* ============================================
   Validation Question Section in Modal
   ============================================ */

.validation-question-section {
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.validation-question-section.pending {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
}

.validation-question-section.answered {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-left: 4px solid #22c55e;
}

.validation-question-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: #374151;
}

.vq-question-display {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
}

.vq-question-display strong {
    color: #374151;
}

.vq-context-display {
    margin-bottom: 1rem;
}

.vq-context-display pre {
    background: rgba(255, 255, 255, 0.7);
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 150px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.vq-answer-display {
    background: #dcfce7;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.vq-answer-display strong {
    color: #166534;
}

.vq-answer-meta {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.vq-pending-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(251, 191, 36, 0.2);
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.vq-pending-notice em {
    color: #92400e;
}

.vq-meta {
    color: #6b7280;
}

/* Validation status indicator in workflow column */
.validation-answered-indicator {
    font-size: 0.9rem;
    margin-left: 0.25rem;
}

/* Finding row with answered validation */
.finding-row.has-answered-validation {
    background: linear-gradient(90deg, #f0fdf4 0%, #fff 20%);
    border-left: 3px solid #22c55e;
}

/* ============================================
   Modal Header Actions (PDF Download Button)
   ============================================ */

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-header-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.modal-header-actions .pdf-icon {
    font-size: 1rem;
}

#download-pdf-btn {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    transition: all 0.2s;
}

#download-pdf-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

#download-pdf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   Inline Edit Buttons and Forms
   ============================================ */

.btn-edit-inline {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 6px;
    margin-left: 8px;
    border-radius: 4px;
    transition: all 0.2s;
    vertical-align: middle;
}

.btn-edit-inline:hover {
    background: #e5e7eb;
    color: #2563eb;
}

.detail-section h4 {
    display: flex;
    align-items: center;
}

.edit-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.edit-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.edit-actions .btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* ====== Line Annotations ====== */

.line-annotations {
    display: inline;
    margin: 0 4px 0 2px;
    white-space: nowrap;
}

.ann-icon {
    cursor: pointer;
    font-size: 0.8em;
    margin: 0 1px;
    transition: opacity 0.15s, transform 0.15s;
    user-select: none;
}

.ann-icon.ann-ghost {
    opacity: 0.25;
    filter: grayscale(100%);
}

code:hover .ann-icon.ann-ghost {
    opacity: 0.5;
    filter: grayscale(60%);
}

code:hover .ann-icon.ann-ghost:hover {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.2);
}

.ann-icon.ann-active {
    opacity: 1;
    filter: none;
}

.ann-icon.ann-active:hover {
    transform: scale(1.25);
}

.annotation-panel {
    display: block;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    margin: 4px 0 4px 40px;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
    color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.annotation-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #334155;
    font-size: 0.85rem;
}

.annotation-panel-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

.annotation-panel-close:hover {
    color: #f87171;
}

.annotation-panel-body {
    padding: 10px 12px;
}

.annotation-textarea {
    width: 100%;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 4px;
    color: #e2e8f0;
    padding: 8px;
    font-size: 0.85rem;
    resize: vertical;
    font-family: inherit;
}

.annotation-textarea:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

.annotation-panel-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.annotation-panel-content {
    white-space: pre-wrap;
    color: #cbd5e1;
    font-size: 0.85rem;
    padding: 4px 0;
}

/* Annotation indicators in findings list */
.ann-indicator {
    font-size: 0.8rem;
    margin-left: 2px;
    cursor: default;
}

.ann-indicator-note {
    color: #60a5fa;
}

.ann-indicator-validation {
    color: #34d399;
}

.ann-indicator-vulnerability {
    color: #f87171;
}

/* ============================================
   Copy-ID Tag (click to copy, hover to reveal)
   ============================================ */

.copy-id-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.85em;
    padding: 2px 6px;
    margin-left: 8px;
    border-radius: 4px;
    transition: all 0.15s;
    vertical-align: middle;
    line-height: 1;
}

.copy-id-tag:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4f46e5;
}

.copy-id-tag:active {
    transform: scale(0.94);
}

.copy-id-tag.copied {
    background: #dcfce7;
    border-color: #86efac;
    color: #16a34a;
}

.copy-id-tag .copy-id-icon {
    font-size: 1em;
    pointer-events: none;
}
