/* 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;
}

.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;
}

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

.dashboard-header-bar {
    margin-bottom: 1.5rem;
}

.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: block;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    transition: box-shadow 0.2s, border-color 0.2s;
    text-decoration: none;
    color: inherit;
}

.project-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
    text-decoration: none;
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.project-card h3 {
    font-size: 1.2rem;
    color: var(--secondary);
}

.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-top: 1rem;
    border-top: 1px solid var(--border);
}

.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;
}

/* ===========================================
   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;
}

/* ===========================================
   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;
    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;
}

/* 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-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
   =========================================== */

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

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1rem 0;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 1rem;
    }

    .sidebar-link {
        padding: 0.5rem 1rem;
        white-space: nowrap;
    }

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

    .sidebar-divider,
    .sidebar-section-title {
        display: none;
    }

    .dashboard-main {
        padding: 1rem;
    }

    .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;
    }
}
