@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500&display=swap');

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

:root {
    --gold: #b8973a;
    --gold-light: #d4b96a;
    --gold-dim: #6b5520;
    --ink: #0d0d0d;
    --ink-2: #1a1a1a;
    --ink-3: #2e2e2e;
    --muted: #6b6b6b;
    --muted-2: #9a9a9a;
    --surface: #f8f6f1;
    --surface-2: #f0ede6;
    --surface-3: #e8e4db;
    --white: #ffffff;
    --rule: #e0dbd0;
    --critical: #8b1a1a;
    --critical-bg: #fdf0f0;
    --critical-bd: #e8c0c0;
    --high: #7a4010;
    --high-bg: #fdf6ef;
    --high-bd: #e8d0b8;
    --medium: #5a4800;
    --medium-bg: #fdfaed;
    --medium-bd: #e8dfa0;
    --low: #1a4a1a;
    --low-bg: #f0f8f0;
    --low-bd: #b8d8b8;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

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

a:hover {
    color: var(--gold-light);
}

/* ── NAV ─────────────────────────────────────────── */
.nav {
    background: var(--ink-2);
    border-bottom: 1px solid var(--gold-dim);
    padding: 0 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--gold);
    letter-spacing: .2em;
    text-transform: uppercase;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    color: var(--muted-2);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.nav-links a:hover {
    color: var(--gold-light);
}

.nav-links a.active {
    color: var(--gold);
}

.nav-sep {
    width: 1px;
    height: 14px;
    background: var(--gold-dim);
    opacity: .5;
}

/* ── BREADCRUMB ──────────────────────────────────── */
.breadcrumb {
    padding: 14px 48px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

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

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

.breadcrumb-sep {
    color: var(--muted-2);
    font-size: 10px;
}

.breadcrumb-current {
    color: var(--ink-3);
}

/* ── PAGE WRAPPER ────────────────────────────────── */
.page {
    padding: 0 48px 72px;
}

/* ── PAGE HEADER ─────────────────────────────────── */
.page-header {
    padding: 28px 0 24px;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 32px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.page-eyebrow {
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 6px;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 34px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: .02em;
    line-height: 1;
}

.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 12px;
}

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

.meta-item span {
    color: var(--ink-3);
    font-weight: 500;
}

/* ── STATUS PILLS ────────────────────────────────── */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    border: 1px solid;
}

.pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.pill-completed {
    background: var(--low-bg);
    color: var(--low);
    border-color: var(--low-bd);
}

.pill-running {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.pill-failed {
    background: var(--critical-bg);
    color: var(--critical);
    border-color: var(--critical-bd);
}

/* ── SEVERITY BADGES ─────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    border: 1px solid;
}

.badge-critical {
    background: var(--critical-bg);
    color: var(--critical);
    border-color: var(--critical-bd);
}

.badge-high {
    background: var(--high-bg);
    color: var(--high);
    border-color: var(--high-bd);
}

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

.badge-low {
    background: var(--low-bg);
    color: var(--low);
    border-color: var(--low-bd);
}

/* ── SUMMARY CARDS ───────────────────────────────── */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
    margin-bottom: 36px;
}

.summary-card {
    background: var(--white);
    padding: 24px 28px;
    position: relative;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
}

.summary-card.critical::before {
    background: var(--critical);
}

.summary-card.high::before {
    background: #c05800;
}

.summary-card.medium::before {
    background: #b89000;
}

.summary-card.low::before {
    background: #2a7a2a;
}

.summary-label {
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
}

.summary-count {
    font-family: 'Playfair Display', serif;
    font-size: 52px;
    font-weight: 300;
    line-height: 1;
    margin-bottom: 4px;
}

.summary-card.critical .summary-count {
    color: var(--critical);
}

.summary-card.high .summary-count {
    color: #c05800;
}

.summary-card.medium .summary-count {
    color: #b89000;
}

.summary-card.low .summary-count {
    color: #2a7a2a;
}

.summary-sub {
    font-size: 11px;
    color: var(--muted-2);
}

/* ── CARDS ───────────────────────────────────────── */
.card {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: 2px;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--rule);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: .04em;
}

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

/* ── FINDINGS ────────────────────────────────────── */
.finding {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: 2px;
    margin-bottom: 10px;
    overflow: hidden;
}

.finding-header {
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    transition: background .15s;
    user-select: none;
}

.finding-header:hover {
    background: var(--surface);
}

.finding-dot {
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-top: 5px;
}

.dot-critical {
    background: var(--critical);
}

.dot-high {
    background: #c05800;
}

.dot-medium {
    background: #b89000;
}

.dot-low {
    background: #2a7a2a;
}

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

.finding-rule {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 4px;
}

.finding-resource {
    font-size: 11px;
    font-family: 'Courier New', monospace;
    color: var(--muted);
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 2px;
    display: inline-block;
}

.finding-toggle {
    flex-shrink: 0;
    font-size: 10px;
    color: var(--muted-2);
    margin-top: 4px;
    transition: transform .2s;
}

.finding-toggle.open {
    transform: rotate(180deg);
}

.finding-body {
    padding: 0 20px 18px 41px;
    border-top: 1px solid var(--rule);
}

.finding-body.collapsed {
    display: none;
}

.finding-message {
    font-size: 13px;
    color: var(--ink-3);
    line-height: 1.65;
    margin: 14px 0 12px;
}

.finding-detail-label {
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 7px;
    margin-top: 14px;
}

.impact-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.impact-chip {
    font-size: 11px;
    font-family: 'Courier New', monospace;
    background: var(--surface-2);
    border: 1px solid var(--rule);
    padding: 3px 8px;
    border-radius: 2px;
    color: var(--ink-3);
}

.gold-rule {
    width: 32px;
    height: 1px;
    background: var(--gold);
    opacity: .4;
    margin: 14px 0;
}

/* ── SIDEBAR ─────────────────────────────────────── */
.sidebar-card {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: 2px;
    padding: 20px;
    margin-bottom: 14px;
}

.sidebar-label {
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 14px;
}

.sidebar-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 7px 0;
    border-bottom: 1px solid var(--surface-2);
    font-size: 12px;
}

.sidebar-row:last-child {
    border-bottom: none;
}

.sidebar-key {
    color: var(--muted);
    flex-shrink: 0;
}

.sidebar-val {
    color: var(--ink-3);
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

.sidebar-val.mono {
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

/* ── BLAST BARS ──────────────────────────────────── */
.blast-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.blast-lbl {
    font-size: 10px;
    color: var(--muted);
    width: 52px;
    text-align: right;
    flex-shrink: 0;
}

.blast-track {
    flex: 1;
    height: 3px;
    background: var(--surface-3);
    border-radius: 2px;
    overflow: hidden;
}

.blast-fill {
    height: 100%;
    border-radius: 2px;
}

.blast-val {
    font-size: 10px;
    color: var(--ink);
    width: 16px;
    text-align: right;
}

/* ── TWO-COLUMN LAYOUT ───────────────────────────── */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 290px;
    gap: 32px;
    align-items: start;
}

/* ── SECTION HEADERS ─────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 400;
    letter-spacing: .04em;
    color: var(--ink);
}

.section-sub {
    font-size: 12px;
    color: var(--muted);
}

/* ── TABLE ───────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 500;
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--rule);
    background: var(--surface);
}

.data-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--ink-3);
    border-bottom: 1px solid var(--surface-2);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--surface);
}

.data-table .td-mono {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--muted);
}

.data-table .td-action a {
    font-size: 12px;
    color: var(--gold);
}

/* ── FORMS ───────────────────────────────────────── */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: 2px;
    outline: none;
    transition: border-color .15s;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--gold-dim);
}

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

.form-hint {
    font-size: 11px;
    color: var(--muted-2);
    margin-top: 4px;
}

/* ── BUTTONS ─────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: opacity .15s;
}

.btn:hover {
    opacity: .85;
}

.btn-primary {
    background: var(--gold);
    color: var(--ink-2);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--rule);
}

.btn-ghost:hover {
    color: var(--ink);
    border-color: var(--muted);
    opacity: 1;
}

/* ── EMPTY STATE ─────────────────────────────────── */
.empty {
    text-align: center;
    padding: 56px 24px;
    color: var(--muted);
}

.empty-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: .4;
}

.empty-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: var(--ink-3);
    margin-bottom: 6px;
}

.empty-sub {
    font-size: 13px;
}

/* ── ENVIRONMENT GRID ────────────────────────────── */
.env-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.env-card {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: 2px;
    padding: 20px 24px;
    text-decoration: none;
    display: block;
    transition: border-color .15s, box-shadow .15s;
}

.env-card:hover {
    border-color: var(--gold-dim);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}

.env-card-name {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 400;
    color: var(--ink);
    margin-bottom: 10px;
}

.env-card-meta {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.8;
}

.env-card-meta span {
    color: var(--ink-3);
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

/* ── PROJECT GRID ────────────────────────────────── */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: 2px;
    padding: 24px;
    text-decoration: none;
    display: block;
    transition: border-color .15s;
    position: relative;
}

.project-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform .2s;
}

.project-card:hover {
    border-color: var(--gold-dim);
}

.project-card:hover::after {
    transform: scaleX(1);
}

.project-card-name {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 400;
    color: var(--ink);
    margin-bottom: 8px;
}

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

/* ── LOGIN ───────────────────────────────────────── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink-2);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 48px 40px;
    background: var(--surface);
    border: 1px solid var(--gold-dim);
}

.login-logo {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 400;
    color: var(--gold);
    letter-spacing: .2em;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 6px;
}

.login-tagline {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: .08em;
    text-align: center;
    margin-bottom: 36px;
}

.login-divider {
    width: 32px;
    height: 1px;
    background: var(--gold);
    margin: 0 auto 32px;
    opacity: .5;
}

.login-error {
    background: var(--critical-bg);
    border: 1px solid var(--critical-bd);
    color: var(--critical);
    font-size: 12px;
    padding: 10px 14px;
    border-radius: 2px;
    margin-bottom: 16px;
}

/* ── UPLOAD ZONE ─────────────────────────────────── */
.upload-zone {
    border: 1px dashed var(--rule);
    border-radius: 2px;
    padding: 32px;
    text-align: center;
    background: var(--surface);
    transition: border-color .15s;
}

.upload-zone:hover {
    border-color: var(--gold-dim);
}

.upload-zone input[type=file] {
    display: none;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.upload-icon {
    font-size: 24px;
    opacity: .4;
}

.upload-text {
    font-size: 13px;
    color: var(--muted);
}

.upload-sub {
    font-size: 11px;
    color: var(--muted-2);
}

.upload-filename {
    font-size: 12px;
    color: var(--gold);
    margin-top: 8px;
    font-family: 'Courier New', monospace;
}

/* ── RISK BAR ────────────────────────────────────── */
.risk-bar-wrap {
    display: flex;
    gap: 2px;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.risk-seg {
    height: 100%;
    transition: flex .3s;
}

.risk-seg.c {
    background: var(--critical);
}

.risk-seg.h {
    background: #c05800;
}

.risk-seg.m {
    background: #b89000;
}

.risk-seg.l {
    background: #2a7a2a;
}

.risk-seg.none {
    background: var(--surface-3);
    flex: 1;
}

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

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

    .nav {
        padding: 0 20px;
    }

    .page {
        padding: 0 20px 48px;
    }

    .breadcrumb {
        padding: 12px 20px;
    }
}