:root {
    --bg: #f4f7f6;
    --surface: #ffffff;
    --surface-strong: #e8f0ed;
    --text: #1f2528;
    --muted: #667074;
    --border: #d5dedb;
    --primary: #0f766e;
    --primary-strong: #115e59;
    --accent: #b45309;
    --danger: #b91c1c;
    --success: #16803a;
    --shadow: 0 12px 30px rgba(24, 31, 34, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 68px;
    padding: 0 clamp(18px, 4vw, 48px);
    border-bottom: 1px solid var(--border);
    background: rgba(244, 247, 246, 0.94);
    backdrop-filter: blur(12px);
}

.brand,
.topnav {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand {
    font-weight: 800;
}

.brand-mark {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 8px;
    background: var(--primary);
    color: white;
}

.topnav a {
    color: var(--muted);
    font-weight: 650;
}

.topnav a:hover,
.topnav a:focus-visible {
    color: var(--text);
}

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 64px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.section-heading h1 {
    max-width: 860px;
    margin: 0;
    font-size: clamp(2rem, 4vw, 4.2rem);
    line-height: 1.02;
}

.section-heading-actions {
    align-items: center;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-grid,
.content-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.metric,
.panel,
.login-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric {
    min-height: 112px;
    padding: 20px;
}

.metric-label,
small {
    color: var(--muted);
}

.metric strong {
    display: block;
    margin-top: 12px;
    font-size: 2.4rem;
    line-height: 1;
}

.panel {
    min-width: 0;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 18px;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    margin: 0;
    font-size: 1rem;
}

.list,
.provider-grid,
.action-list,
.finding-list {
    display: grid;
}

.list-row,
.provider-row,
.action-row,
.finding-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.list-row:last-child,
.provider-row:last-child,
.action-row:last-child,
.finding-row:last-child {
    border-bottom: 0;
}

.list-row:hover {
    background: var(--surface-strong);
}

.list-row span:first-child,
.provider-row span:first-child,
.action-row span:last-child,
.finding-row span:last-child {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.pill,
.severity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-dot {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border-radius: 50%;
    background: var(--danger);
}

.status-dot.is-ready {
    background: var(--success);
}

.score {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 8px;
    background: #103f3b;
    color: #fff;
    font-weight: 850;
}

.action-row-large {
    align-items: flex-start;
}

.severity-critical,
.severity-high {
    background: #fee2e2;
    color: #991b1b;
}

.severity-medium {
    background: #fef3c7;
    color: #92400e;
}

.severity-low {
    background: #dcfce7;
    color: #166534;
}

.runbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
}

.button-primary {
    background: var(--primary);
    color: white;
}

.button-primary:hover,
.button-primary:focus-visible {
    background: var(--primary-strong);
}

.button-secondary {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

.button-secondary:hover,
.button-secondary:focus-visible {
    background: var(--surface-strong);
}

.table-wrap {
    overflow-x: auto;
}

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

th,
td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 850;
}

.empty {
    margin: 0;
    padding: 20px 18px;
    color: var(--muted);
}

.login-shell {
    display: grid;
    min-height: calc(100vh - 170px);
    place-items: center;
}

.login-panel {
    width: min(420px, 100%);
    padding: 28px;
}

.login-panel h1 {
    margin: 0 0 24px;
    font-size: 2rem;
}

.form-stack {
    display: grid;
    gap: 10px;
}

.form-stack label {
    font-weight: 800;
}

.form-stack input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
}

.form-stack input:focus,
.button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.3);
    outline-offset: 2px;
}

.alert {
    margin-bottom: 16px;
    border-radius: 8px;
    padding: 12px 14px;
    font-weight: 700;
}

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

@media (max-width: 860px) {
    .topbar,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .metric-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .list-row,
    .provider-row,
    .action-row,
    .finding-row {
        align-items: flex-start;
        flex-direction: column;
    }

    th,
    td {
        white-space: normal;
    }
}
