:root {
    --ink: #18202f;
    --muted: #657089;
    --line: #dfe4ec;
    --panel: #ffffff;
    --canvas: #f4f6f8;
    --soft: #eef3f7;
    --accent: #0f766e;
    --accent-strong: #115e59;
    --blue: #2563eb;
    --rose: #be123c;
    --amber: #b45309;
    --green: #15803d;
    --shadow: 0 18px 50px rgba(26, 33, 46, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

.shell {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px clamp(18px, 3vw, 40px);
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: white;
    background: var(--accent);
    font-weight: 800;
}

.brand-title {
    font-size: 15px;
    font-weight: 800;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 12px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page {
    padding: clamp(20px, 3vw, 40px);
}

.page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 20px;
    margin-bottom: 24px;
}

.eyebrow {
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    margin-top: 4px;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
}

h2 {
    font-size: 20px;
}

h3 {
    font-size: 15px;
}

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

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.metric {
    min-height: 98px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.metric-value {
    margin-top: 10px;
    font-size: 30px;
    font-weight: 850;
}

.filters {
    display: grid;
    grid-template-columns: 2fr repeat(5, minmax(120px, 1fr)) auto;
    gap: 10px;
    align-items: end;
    padding: 16px;
    margin-bottom: 24px;
    background: #eaf0f3;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.field {
    display: grid;
    gap: 6px;
}

.field label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 11px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #cbd4df;
    border-radius: 7px;
}

.textarea {
    min-height: 98px;
    resize: vertical;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #fff;
    background: var(--accent);
    font-weight: 780;
    cursor: pointer;
    white-space: nowrap;
}

.button.secondary {
    color: var(--ink);
    background: #fff;
    border-color: #cbd4df;
}

.button.danger {
    background: var(--rose);
}

.button.warning {
    background: var(--amber);
}

.button.blue {
    background: var(--blue);
}

.button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.status-banner,
.error-banner {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 700;
}

.status-banner {
    color: #0f5132;
    background: #dff4e8;
    border: 1px solid #b6e3ca;
}

.error-banner {
    color: #842029;
    background: #f8d7da;
    border: 1px solid #f1aeb5;
}

.board {
    display: grid;
    grid-template-columns: repeat(10, minmax(220px, 1fr));
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 28px;
}

.board-column {
    min-height: 220px;
    padding: 10px;
    background: #e6edf2;
    border: 1px solid #ccd7e1;
    border-radius: 8px;
}

.board-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.article-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.article-card.compact {
    margin-bottom: 10px;
    box-shadow: none;
}

.article-card img,
.media-tile img {
    display: block;
    width: 100%;
    height: 210px;
    object-fit: cover;
    background: #d8dee7;
}

.article-card.compact img {
    height: 120px;
}

.article-body {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.article-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.article-title {
    font-weight: 850;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    color: #334155;
    background: #edf2f7;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.badge.score {
    color: #fff;
    background: var(--blue);
}

.badge.low {
    color: #075827;
    background: #cdebd7;
}

.badge.medium {
    color: #7c4a03;
    background: #f7dfb5;
}

.badge.high,
.badge.critical,
.badge.blocked {
    color: #8f1232;
    background: #f5c8d1;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 20px;
}

.section {
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

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

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.media-tile {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.media-caption {
    padding: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.kv {
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.kv-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.kv-value {
    margin-top: 6px;
    font-weight: 850;
}

.score-bars {
    display: grid;
    gap: 10px;
}

.bar-row {
    display: grid;
    grid-template-columns: 170px minmax(80px, 1fr) 44px;
    gap: 10px;
    align-items: center;
    font-size: 13px;
}

.bar-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #dce4ec;
}

.bar-fill {
    height: 100%;
    background: var(--accent);
}

.evidence-list,
.timeline {
    display: grid;
    gap: 10px;
}

.evidence-item,
.timeline-item {
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.form-grid .wide {
    grid-column: 1 / -1;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.data-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

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

.data-table th {
    color: var(--muted);
    background: #f8fafc;
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

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

.login-wrap {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background: #eef2f5;
}

.login-panel {
    width: min(460px, 100%);
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

@media (max-width: 980px) {
    .filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 640px) {
    .page {
        padding: 18px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .filters,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .bar-row {
        grid-template-columns: 1fr;
    }
}
