:root {
    color-scheme: light;
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-2: #eef2f5;
    --text: #1f2933;
    --muted: #657384;
    --line: #d9e0e7;
    --accent: #0f766e;
    --danger: #b42318;
    --warning: #a15c07;
    --ok: #2f6f3e;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

.topbar {
    align-items: center;
    background: #16202a;
    color: #fff;
    display: flex;
    justify-content: space-between;
    padding: 18px 28px;
}

.topbar h1 {
    font-size: 22px;
    margin: 0;
}

.topbar p,
.topbar-meta {
    color: #c5d0dc;
    margin: 2px 0 0;
}

.topbar-meta {
    align-items: center;
    display: flex;
    gap: 14px;
}

.topbar-meta a {
    color: #ffffff;
    text-decoration: none;
}

.topbar-meta a:hover {
    text-decoration: underline;
}

main {
    margin: 0 auto;
    max-width: 1480px;
    padding: 22px;
}

.alert {
    background: #fff4f2;
    border: 1px solid #ffc9c1;
    color: var(--danger);
    margin-bottom: 18px;
    padding: 12px 14px;
}

.alert span {
    display: block;
    margin-top: 4px;
}

.metrics {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.metric,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

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

.metric span,
.metric small,
.panel-header span,
dt {
    color: var(--muted);
}

.metric strong {
    display: block;
    font-size: 20px;
    margin: 8px 0 6px;
    overflow-wrap: anywhere;
}

.metric.danger strong {
    color: var(--danger);
}

.panel {
    margin-bottom: 18px;
    overflow: hidden;
}

.panel-header {
    align-items: center;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 12px 14px;
}

.panel-header h2 {
    font-size: 16px;
    margin: 0;
}

.split {
    display: grid;
    gap: 18px;
    grid-template-columns: 0.8fr 1.2fr;
}

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

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #fafbfc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.path {
    max-width: 420px;
    overflow-wrap: anywhere;
}

.domain-table th,
.domain-table td {
    vertical-align: middle;
}

.domain-table .selected-row td {
    background: #eef8f6;
}

.muted-row {
    opacity: 0.62;
}

.actions {
    white-space: nowrap;
}

.finding-actions {
    min-width: 260px;
}

.button,
button {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--text);
    cursor: pointer;
    display: inline-block;
    font: inherit;
    line-height: 1;
    margin-right: 6px;
    padding: 7px 10px;
    text-decoration: none;
}

button:disabled {
    color: var(--muted);
    cursor: not-allowed;
}

.danger-outline {
    border-color: #f1b3ad;
    color: var(--danger);
}

.warning-outline {
    border-color: #e9c88f;
    color: var(--warning);
}

.button {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.count-danger {
    color: var(--danger);
    font-weight: 700;
}

.detail-panel .panel-header a {
    color: var(--accent);
    text-decoration: none;
}

.detail-panel {
    scroll-margin-top: 18px;
}

.detail-summary {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 14px;
}

.detail-summary div {
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
}

.detail-summary span {
    color: var(--muted);
    display: block;
    margin-bottom: 6px;
}

.detail-summary strong {
    font-size: 18px;
    overflow-wrap: anywhere;
}

.detail-block {
    border-top: 1px solid var(--line);
}

.subhead {
    background: #fafbfc;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-weight: 700;
    padding: 10px 12px;
}

.badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    padding: 2px 8px;
}

.sev-critical,
.sev-high {
    background: #ffe5e0;
    color: var(--danger);
}

.sev-medium {
    background: #fff1d6;
    color: var(--warning);
}

.sev-low,
.sev-info {
    background: #e4f3e8;
    color: var(--ok);
}

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

.login-page {
    background: #16202a;
}

.login-shell {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    max-width: 380px;
    padding: 26px;
    width: 100%;
}

.login-box h1 {
    font-size: 24px;
    margin: 0 0 4px;
}

.login-box p {
    color: var(--muted);
    margin: 0 0 22px;
}

.login-box label {
    color: var(--muted);
    display: block;
    font-weight: 700;
    margin-bottom: 14px;
}

.login-box input {
    border: 1px solid var(--line);
    border-radius: 5px;
    display: block;
    font: inherit;
    margin-top: 6px;
    padding: 10px 11px;
    width: 100%;
}

.login-box button {
    background: var(--accent);
    border: 0;
    border-radius: 5px;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 11px 14px;
    width: 100%;
}

.login-error {
    background: #fff4f2;
    border: 1px solid #ffc9c1;
    color: var(--danger);
    margin-bottom: 14px;
    padding: 10px;
}

.modal-backdrop {
    align-items: center;
    background: rgba(22, 32, 42, 0.55);
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    padding: 22px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 50;
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
    max-width: 560px;
    padding: 20px;
    width: 100%;
}

.modal-card h2 {
    font-size: 18px;
    margin: 0 0 8px;
}

.modal-card p {
    color: var(--muted);
    margin: 0 0 14px;
}

.modal-card code {
    background: #f6f8fa;
    border: 1px solid var(--line);
    display: block;
    margin-bottom: 14px;
    overflow-wrap: anywhere;
    padding: 10px;
}

.modal-card label {
    color: var(--muted);
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.modal-card select {
    border: 1px solid var(--line);
    border-radius: 5px;
    font: inherit;
    padding: 9px 10px;
    width: 100%;
}

.modal-message {
    background: #f6f8fa;
    border: 1px solid var(--line);
    color: var(--muted);
    margin-top: 12px;
    padding: 10px;
}

.modal-message.success {
    background: #eef8f2;
    border-color: #b9dfc8;
    color: var(--ok);
}

.modal-message.error {
    background: #fff4f2;
    border-color: #ffc9c1;
    color: var(--danger);
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 18px;
}

@media (max-width: 1100px) {
    .metrics,
    .detail-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 680px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        padding: 16px;
    }

    main {
        padding: 14px;
    }

    .metrics,
    .detail-summary {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 13px;
    }
}
