@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #08090c;
    --panel: #101217;
    --panel-light: #151820;
    --border: #242833;

    --text: #f2f3f5;
    --muted: #8b909c;

    --accent: #b7f34a;
    --accent-dark: #8dbd27;

    --danger: #ff5c67;
    --warning: #ffb84d;
    --safe: #62d99b;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Manrope", sans-serif;
    min-height: 100vh;
}


/* =========================
   SIDEBAR
========================= */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;

    width: 250px;
    height: 100vh;

    background: #0b0d11;
    border-right: 1px solid var(--border);

    padding: 28px 20px;

    display: flex;
    flex-direction: column;

    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 0 8px;
}

.brand-mark {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    background: var(--accent);
    color: #090a0b;

    border-radius: 10px;

    font-weight: 800;
    font-size: 13px;
}

.brand h1 {
    font-size: 16px;
    letter-spacing: -0.5px;
}

.brand span {
    color: var(--muted);
    font-size: 10px;
}


/* =========================
   NAVIGATION
========================= */

.navigation {
    margin-top: 55px;

    display: flex;
    flex-direction: column;
    gap: 7px;
}

.nav-item {
    text-decoration: none;
    color: var(--muted);

    padding: 12px 14px;

    border-radius: 9px;

    font-size: 13px;
    font-weight: 600;

    display: flex;
    align-items: center;
    gap: 12px;

    transition: 0.2s ease;
}

.nav-item:hover {
    color: var(--text);
    background: var(--panel);
}

.nav-item.active {
    color: var(--text);
    background: var(--panel-light);
}

.nav-item span {
    font-family: "DM Mono", monospace;
    color: var(--accent);
}


/* =========================
   SIDEBAR FOOTER
========================= */

.sidebar-footer {
    margin-top: auto;

    padding: 15px;

    border: 1px solid var(--border);
    border-radius: 10px;

    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-footer strong {
    display: block;
    font-size: 11px;
}

.sidebar-footer small {
    color: var(--muted);
    font-size: 9px;
}


/* STATUS DOT */

.status-dot {
    width: 7px;
    height: 7px;

    background: var(--safe);

    border-radius: 50%;

    box-shadow: 0 0 10px rgba(98, 217, 155, 0.6);
}


/* =========================
   MAIN
========================= */

.main-content {
    margin-left: 250px;

    padding: 45px 55px;

    max-width: 1550px;
}


/* =========================
   TOPBAR
========================= */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    margin-bottom: 45px;
}

.eyebrow,
.section-kicker {
    font-family: "DM Mono", monospace;

    font-size: 10px;
    letter-spacing: 1.5px;

    color: var(--accent);
}

.topbar h2 {
    margin-top: 10px;

    max-width: 700px;

    font-size: clamp(34px, 4vw, 58px);

    line-height: 1.02;

    letter-spacing: -3px;
}

.topbar h2 span {
    color: var(--muted);
}

.subtitle {
    margin-top: 17px;

    max-width: 610px;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.7;
}

.header-status {
    color: var(--muted);

    font-family: "DM Mono", monospace;

    font-size: 10px;

    display: flex;
    align-items: center;
    gap: 8px;
}


/* =========================
   METRICS
========================= */

.metrics {
    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 12px;

    margin-bottom: 35px;
}

.metric-card {
    background: var(--panel);

    border: 1px solid var(--border);

    border-radius: 12px;

    padding: 22px;

    min-height: 145px;

    display: flex;
    flex-direction: column;

    transition: 0.2s ease;
}

.metric-card:hover {
    border-color: #343946;
    transform: translateY(-2px);
}

.metric-card.primary {
    background:
        linear-gradient(
            135deg,
            rgba(183, 243, 74, 0.12),
            rgba(183, 243, 74, 0.02)
        );

    border-color: rgba(183, 243, 74, 0.25);
}

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

    font-family: "DM Mono", monospace;

    font-size: 9px;
    letter-spacing: 1px;
}

.metric-card strong {
    margin-top: auto;

    font-size: 38px;

    letter-spacing: -2px;
}

.metric-description {
    color: var(--muted);

    font-size: 10px;

    margin-top: 4px;
}


/* =========================
   PANELS
========================= */

.intelligence-panel,
.app-section {
    background: var(--panel);

    border: 1px solid var(--border);

    border-radius: 14px;

    padding: 27px;

    margin-bottom: 25px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 25px;
}

.section-heading h3 {
    margin-top: 5px;

    font-size: 20px;

    letter-spacing: -0.8px;
}

.analysis-tag {
    font-family: "DM Mono", monospace;

    font-size: 9px;

    color: var(--muted);

    border: 1px solid var(--border);

    padding: 7px 9px;

    border-radius: 6px;
}


/* =========================
   RISK DISTRIBUTION
========================= */

.risk-distribution {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 10px;
}

.risk-block {
    padding: 18px;

    border-radius: 9px;

    background: var(--panel-light);

    border: 1px solid var(--border);
}

.risk-block span {
    color: var(--muted);

    font-family: "DM Mono", monospace;

    font-size: 9px;
}

.risk-block strong {
    display: block;

    margin-top: 8px;

    font-size: 28px;
}


/* =========================
   FILTERS
========================= */

.filters {
    display: flex;

    align-items: center;

    gap: 7px;
}

#searchInput {
    width: 200px;

    background: #0b0d11;

    border: 1px solid var(--border);

    border-radius: 7px;

    padding: 9px 12px;

    color: var(--text);

    outline: none;

    font-family: "Manrope", sans-serif;

    font-size: 11px;
}

#searchInput:focus {
    border-color: var(--accent-dark);
}

.filter {
    background: transparent;

    color: var(--muted);

    border: 1px solid var(--border);

    padding: 9px 11px;

    border-radius: 7px;

    font-size: 10px;

    cursor: pointer;

    transition: 0.2s;
}

.filter:hover {
    color: var(--text);
}

.filter.active {
    background: var(--accent);

    color: #08090c;

    border-color: var(--accent);
}


/* =========================
   APP GRID
========================= */

.app-grid {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 12px;
}

.app-card {
    background: #0c0f14;

    border: 1px solid var(--border);

    border-radius: 11px;

    padding: 20px;

    cursor: pointer;

    transition: 0.2s ease;
}

.app-card:hover {
    transform: translateY(-3px);

    border-color: #3b414e;
}

.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    gap: 15px;
}

.app-name {
    font-size: 14px;

    font-weight: 700;

    line-height: 1.3;
}

.app-developer {
    color: var(--muted);

    font-size: 9px;

    margin-top: 4px;
}

.risk-score {
    font-family: "DM Mono", monospace;

    font-size: 22px;

    font-weight: 500;
}

.risk-label {
    display: inline-block;

    margin-top: 20px;

    padding: 5px 8px;

    border-radius: 5px;

    font-family: "DM Mono", monospace;

    font-size: 8px;

    letter-spacing: 0.7px;
}

.risk-high {
    color: var(--danger);

    background: rgba(255, 92, 103, 0.08);

    border: 1px solid rgba(255, 92, 103, 0.18);
}

.risk-caution {
    color: var(--warning);

    background: rgba(255, 184, 77, 0.08);

    border: 1px solid rgba(255, 184, 77, 0.18);
}

.risk-low {
    color: var(--safe);

    background: rgba(98, 217, 155, 0.08);

    border: 1px solid rgba(98, 217, 155, 0.18);
}

.card-reason {
    margin-top: 15px;

    color: var(--muted);

    font-size: 10px;

    line-height: 1.5;
}


/* =========================
   DRAWER
========================= */

.detail-overlay {
    position: fixed;

    inset: 0;

    background: rgba(0, 0, 0, 0.65);

    backdrop-filter: blur(5px);

    display: none;

    justify-content: flex-end;

    z-index: 50;
}

.detail-overlay.open {
    display: flex;
}

.detail-drawer {
    width: min(650px, 92vw);

    height: 100vh;

    background: #0d1015;

    border-left: 1px solid var(--border);

    padding: 35px;

    overflow-y: auto;

    position: relative;

    animation: slideIn 0.25s ease;
}

@keyframes slideIn {

    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }

}

.close-button {
    position: absolute;

    top: 20px;
    right: 25px;

    width: 32px;
    height: 32px;

    border-radius: 50%;

    background: var(--panel);

    color: var(--muted);

    border: 1px solid var(--border);

    font-size: 20px;

    cursor: pointer;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1100px) {

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

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

}


@media (max-width: 800px) {

    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;

        padding: 25px 18px;
    }

    .topbar {
        flex-direction: column;

        gap: 20px;
    }

    .topbar h2 {
        letter-spacing: -2px;
    }

    .metrics,
    .risk-distribution,
    .app-grid {
        grid-template-columns: 1fr;
    }

    .section-heading {
        align-items: flex-start;

        flex-direction: column;

        gap: 15px;
    }

    .filters {
        width: 100%;

        flex-wrap: wrap;
    }

    #searchInput {
        width: 100%;
    }

}
html {
    scroll-behavior: smooth;
}

#overview,
#app-intelligence,
#evidence {
    scroll-margin-top: 30px;
}

/* =========================
   EVIDENCE SECTION
========================= */

.evidence-section {
    margin-top: 70px;
    padding-bottom: 80px;
}

.evidence-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 25px;
}

.evidence-card {
    background: #101217;
    border: 1px solid #242833;
    border-radius: 10px;
    padding: 20px;
    min-height: 150px;
}

.evidence-card .section-kicker {
    display: block;
    margin-bottom: 15px;
}

.evidence-item {
    padding: 8px 0;
    border-bottom: 1px solid #20242c;
    color: #c7cad0;
    font-size: 11px;
    line-height: 1.5;
}

.evidence-item:last-child {
    border-bottom: none;
}

.evidence-muted {
    color: #8b909c;
    font-size: 11px;
    line-height: 1.6;
}

.evidence-source {
    margin-top: 8px;
}

.evidence-source a {
    color: #b7f34a;
    text-decoration: none;
    font-size: 10px;
}