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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1e293b;
    line-height: 1.6;
    background: #ffffff;
}

.container { max-width: 1000px; margin: 0 auto; padding: 0 1.5rem; }

/* Nav */
.nav {
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 0;
}
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
    letter-spacing: -0.5px;
}
.nav-links a {
    margin-left: 2rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
}
.nav-links a:hover { color: #1e293b; }

/* Hero */
.hero {
    padding: 4rem 0 3rem;
    text-align: center;
}
.hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.75rem;
}
.subtitle {
    color: #64748b;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}
.stats-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}
.stat { text-align: center; }
.stat-value { display: block; font-size: 1.8rem; font-weight: 700; color: #2563eb; }
.stat-label { display: block; font-size: 0.8rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; }

/* Pipeline */
.pipeline {
    padding: 3rem 0;
    background: #f8fafc;
}
.pipeline h2 { text-align: center; margin-bottom: 1.5rem; }
.pipeline-flow {
    text-align: center;
    padding: 1.5rem;
    background: #1e293b;
    border-radius: 8px;
}
.pipeline-flow code { color: #e2e8f0; font-size: 0.95rem; }

/* Sections */
section { padding: 3rem 0; }
section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.3px;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

/* Cards */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.card h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.card-tag {
    display: inline-block;
    font-size: 0.75rem;
    color: #2563eb;
    background: #dbeafe;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
}
.card p { color: #64748b; font-size: 0.9rem; margin-bottom: 0.5rem; }
.card a { color: #2563eb; font-size: 0.85rem; text-decoration: none; }
.card a:hover { text-decoration: underline; }

/* Scan */
.scan-preview { background: #f8fafc; }
.scan-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 1.5rem 0;
}
.scan-note { text-align: center; color: #64748b; font-size: 0.9rem; }
.scan-note a { color: #2563eb; }

/* Content */
.content { padding: 2rem 0; }
.content h1 { margin-bottom: 1.5rem; }

/* Footer */
.footer {
    border-top: 1px solid #e2e8f0;
    padding: 2rem 0;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Dashboard */
.dashboard-header { margin-bottom: 2rem; }
.subtitle-left { color: #64748b; font-size: 1rem; margin-top: 0.4rem; }

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

.project-card { display: flex; flex-direction: column; gap: 0.75rem; }
.project-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}
.project-card-top h3 { font-size: 1.1rem; margin-bottom: 0.2rem; }
.project-card-top p { color: #64748b; font-size: 0.875rem; }
.project-meta { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.scan-date { font-size: 0.8rem; color: #94a3b8; }
.project-links { display: flex; gap: 1rem; }
.project-links a { font-size: 0.85rem; color: #2563eb; text-decoration: none; }
.project-links a:hover { text-decoration: underline; }

/* Health badge */
.health-badge {
    min-width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}
.health-high { background: #dcfce7; color: #15803d; }
.health-mid  { background: #fef9c3; color: #a16207; }
.health-low  { background: #fee2e2; color: #b91c1c; }

/* Project page */
.project-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 1.5rem;
}
.back-link { font-size: 0.85rem; color: #64748b; text-decoration: none; display: block; margin-bottom: 0.5rem; }
.back-link:hover { color: #1e293b; }
.project-page-title h1 { margin-bottom: 0.25rem; }
.project-page-meta { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; flex-wrap: wrap; }
.repo-link { font-size: 0.85rem; color: #2563eb; text-decoration: none; }
.repo-link:hover { text-decoration: underline; }

.health-score-block { text-align: center; flex-shrink: 0; }
.health-score {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 0.35rem;
}
.health-label { font-size: 0.75rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; }

.last-scan-info { font-size: 0.875rem; color: #64748b; margin-bottom: 2rem; }

/* Violations table */
.violations-section { margin-top: 1.5rem; }
.violations-section h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.violations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.violations-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}
.violations-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}
.group-name { font-weight: 600; text-transform: capitalize; }
.count-pass { color: #15803d; }
.count-fail { color: #b91c1c; font-weight: 600; }
.count-warn { color: #a16207; }
.row-fail { background: #fff8f8; }
.row-ok { background: #ffffff; }

.status-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.status-pass { background: #dcfce7; color: #15803d; }
.status-fail { background: #fee2e2; color: #b91c1c; }

/* =========================================================
   Charts Dashboard
   ========================================================= */

.charts-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.charts-section h2 {
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
}

.charts-note {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

.charts-note code {
    background: #f1f5f9;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.78rem;
    color: #334155;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

/* Full-width chart row */
.chart-card--full {
    grid-column: 1 / -1;
}

.chart-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 10px;
    overflow: hidden;
}

.chart-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem 0.5rem;
    border-bottom: 1px solid #1e293b;
}

.chart-card__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #cbd5e1;
    letter-spacing: -0.2px;
}

.chart-card__badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
}

.chart-badge--green  { background: #14532d; color: #4ade80; }
.chart-badge--blue   { background: #1e3a5f; color: #60a5fa; }
.chart-badge--cyan   { background: #083344; color: #22d3ee; }
.chart-badge--orange { background: #431407; color: #fb923c; }
.chart-badge--purple { background: #2e1065; color: #c084fc; }

.chart-area {
    padding: 0.5rem 0.25rem 0.25rem;
}

/* ApexCharts custom tooltip */
.apx-tooltip {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 0.6rem 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 12px;
    color: #cbd5e1;
    min-width: 130px;
}

.apx-tooltip__score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.2;
    margin-bottom: 0.2rem;
}

.apx-tooltip__row {
    margin-bottom: 0.15rem;
}

.apx-tooltip__commit {
    margin-top: 0.35rem;
    font-size: 0.7rem;
    color: #475569;
    font-family: monospace;
}

/* Mobile */
@media (max-width: 640px) {
    .hero h1 { font-size: 1.6rem; }
    .stats-row { gap: 1.5rem; flex-wrap: wrap; }
    .stat-value { font-size: 1.4rem; }
    .nav-links a { margin-left: 1rem; font-size: 0.8rem; }
    .grid { grid-template-columns: 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
    .chart-card--full { grid-column: 1; }
}
