/* ============================================================
   Vantage — 2008-2009 Web Application Aesthetic
   Heavy influence from the classic Django admin (pre-2021).
   See docs/DESIGN_GUIDELINES.md
   ============================================================ */

:root {
    /* Surfaces */
    --bg:           #F5F5F5;   /* body */
    --paper:        #FFFFFF;   /* main content area */
    --surface:      #FFFFFF;   /* panel */
    --surface-alt:  #F8F8F8;   /* zebra rows / sidebar */
    --surface-2:    #F0F0F0;   /* hover / depressed */

    /* Text */
    --text:         #222222;
    --muted:        #555555;
    --muted-2:      #888888;

    /* Borders */
    --border:       #CCCCCC;
    --border-dim:   #DDDDDD;
    --border-dark:  #999999;

    /* Django-admin slate-blue family */
    --header:       #417690;   /* signature header */
    --header-light: #4A8198;   /* gradient top */
    --header-dark:  #264B5D;   /* edges */
    --header-deep:  #205067;   /* active */

    /* Accent / interactive */
    --accent:       #417690;
    --accent-2:     #447E9B;   /* link */
    --accent-3:     #609AB6;   /* hover row */
    --accent-pale:  #79AEC8;
    --tint:         #E8F1F5;   /* hover row tint */
    --tint-2:       #D8E6F4;   /* focus halo */

    --link:         #447E9B;
    --link-hover:   #205067;

    /* Status (Django admin family) */
    --ok:           #70BF2B;
    --ok-bg:        #EDF7E0;
    --warn:         #EFB80B;
    --warn-bg:      #FCF4D9;
    --danger:       #BA2121;
    --danger-bg:    #FBE7E7;
    --info:         #447E9B;
    --info-bg:      #E8F1F5;

    /* Typography */
    --font-stack:   "Lucida Grande", "DejaVu Sans", "Bitstream Vera Sans",
                    Verdana, Arial, sans-serif;
    --font-mono:    "Consolas", "SFMono-Regular", "Lucida Console",
                    "DejaVu Sans Mono", monospace;
}

/* ----------------------------------------
   Reset + base
   ---------------------------------------- */

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

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-stack);
    font-size: 12px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 8px;
    font-family: var(--font-stack);
    font-weight: 700;
    color: var(--header-dark);
    line-height: 1.25;
}
h1 { font-size: 20px; font-weight: 600; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; }
h4 { font-size: 13px; }

p { margin: 0 0 10px; }

a {
    color: var(--link);
    text-decoration: none;
}
a:hover { color: var(--link-hover); text-decoration: underline; }
a:active { color: var(--danger); }

hr {
    border: 0;
    border-top: 1px solid var(--border-dim);
    margin: 12px 0;
}

code, pre, .tech {
    font-family: var(--font-mono);
    font-size: 12px;
}

/* ----------------------------------------
   Application shell (3-zone layout)
   ---------------------------------------- */

.app-shell {
    display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-rows: 56px 1fr 26px;
    grid-template-areas:
        "header  header"
        "sidebar main"
        "footer  footer";
    height: 100vh;
    width: 100%;
}

.app-header {
    grid-area: header;
    background: linear-gradient(to bottom,
        var(--header-light) 0%,
        var(--header) 100%);
    color: #FFFFFF;
    border-bottom: 1px solid var(--header-dark);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #FFFFFF;
    text-decoration: none;
}
.app-brand:hover { text-decoration: none; color: #FFFFFF; }

.app-logo {
    display: block;
    height: 36px;
    width: auto;
    background: #FFFFFF;
    border: 1px solid var(--header-dark);
    border-radius: 3px;
    padding: 2px;
}

.app-brand-name {
    font-family: var(--font-stack);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.app-brand-tagline {
    font-size: 11px;
    font-weight: 500;
    color: #C9D9E4;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    padding-left: 10px;
    margin-left: 4px;
}

.app-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #DDE6EF;
}
.app-header-meta a {
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.6);
}
.app-header-meta a:hover {
    color: #FFFFFF;
    border-bottom-style: solid;
}

/* ----------------------------------------
   Sidebar
   ---------------------------------------- */

.app-sidebar {
    grid-area: sidebar;
    background: var(--surface-alt);
    border-right: 1px solid var(--border);
    padding: 0;
    overflow-y: auto;
    font-size: 12px;
}

.app-sidebar .nav-section {
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    font-size: 11px;
    padding: 12px 14px 4px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border-dim);
    margin-bottom: 2px;
}
.app-sidebar .nav-section:not(:first-child) {
    margin-top: 6px;
}

.app-sidebar a {
    display: block;
    color: var(--link);
    text-decoration: none;
    padding: 6px 14px;
    border-left: 3px solid transparent;
    font-size: 12px;
    transition: background-color 80ms linear, color 80ms linear;
}
.app-sidebar a:hover {
    background-color: var(--tint);
    color: var(--link-hover);
    text-decoration: none;
}
.app-sidebar a:active,
.app-sidebar a.active {
    background-color: var(--tint);
    color: var(--header-dark);
    border-left-color: var(--accent);
    font-weight: 700;
}

/* ----------------------------------------
   Main content area
   ---------------------------------------- */

.app-main {
    grid-area: main;
    background: var(--paper);
    border-left: 1px solid var(--border);
    padding: 14px 18px;
    overflow: auto;
}

.app-main h1:first-child,
.app-main h2:first-child {
    margin-top: 0;
}

/* ----------------------------------------
   Footer
   ---------------------------------------- */

.app-footer {
    grid-area: footer;
    background: var(--surface-alt);
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--muted);
    padding: 5px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ----------------------------------------
   Panels
   ---------------------------------------- */

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 3px;
    margin: 0 0 12px;
    box-shadow: 0 1px 0 #FFFFFF inset;
}

.panel-header {
    background: linear-gradient(to bottom,
        var(--header-light) 0%,
        var(--header) 100%);
    color: #FFFFFF;
    font-weight: 600;
    font-size: 13px;
    padding: 7px 12px;
    border-bottom: 1px solid var(--header-dark);
    border-top-left-radius: 2px;
    border-top-right-radius: 2px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    letter-spacing: 0.2px;
}

.panel-body {
    padding: 12px;
}

.panel-tight .panel-body {
    padding: 8px 12px;
}

/* ----------------------------------------
   Buttons
   ---------------------------------------- */

button,
input[type="submit"],
input[type="button"],
.btn {
    display: inline-block;
    font-family: var(--font-stack);
    font-size: 12px;
    color: var(--text);
    background: linear-gradient(to bottom, #FFFFFF 0%, #ECECEC 100%);
    border: 1px solid var(--border);
    border-radius: 3px;
    box-shadow: 0 1px 0 #FFFFFF inset;
    padding: 5px 14px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
    vertical-align: middle;
    transition: background 80ms linear, border-color 80ms linear;
}

button:hover,
.btn:hover {
    background: linear-gradient(to bottom, #F8F8F8 0%, #E0E0E0 100%);
    border-color: var(--border-dark);
    color: var(--text);
    text-decoration: none;
}

button:active,
.btn:active {
    background: linear-gradient(to bottom, #E0E0E0 0%, #ECECEC 100%);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

button:disabled,
.btn:disabled,
.btn.disabled {
    background: var(--surface-2);
    color: var(--muted-2);
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(to bottom,
        var(--header-light) 0%, var(--header) 100%);
    border-color: var(--header-dark);
    color: #FFFFFF;
    font-weight: 600;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}
.btn-primary:hover {
    background: linear-gradient(to bottom,
        #4F8AA3 0%, #3B6A82 100%);
    color: #FFFFFF;
    border-color: var(--header-dark);
}
.btn-primary:active {
    background: var(--header-deep);
    color: #FFFFFF;
}

.btn-danger {
    background: linear-gradient(to bottom, #D04949 0%, #BA2121 100%);
    border-color: #8A1818;
    color: #FFFFFF;
    font-weight: 600;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.btn-danger:hover {
    background: linear-gradient(to bottom, #D85959 0%, #A81C1C 100%);
    color: #FFFFFF;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-google svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ----------------------------------------
   Forms
   ---------------------------------------- */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="tel"],
select,
textarea {
    font-family: var(--font-stack);
    font-size: 12px;
    color: var(--text);
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 5px 7px;
    line-height: 1.4;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-2);
    outline: 2px solid var(--tint-2);
    outline-offset: 0;
}

label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    display: inline-block;
    margin-right: 6px;
}

fieldset {
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 12px 14px;
    margin: 0 0 12px;
    border-radius: 3px;
}

legend {
    font-weight: 700;
    color: var(--header-dark);
    padding: 0 6px;
    font-size: 12px;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.form-row label {
    min-width: 130px;
    text-align: right;
}

.inline-form {
    display: inline-block;
    margin: 0 4px 0 0;
}

/* ----------------------------------------
   Alerts
   ---------------------------------------- */

.alert {
    border: 1px solid var(--danger);
    border-left-width: 4px;
    border-radius: 3px;
    background: var(--danger-bg);
    color: var(--danger);
    font-weight: 600;
    font-size: 12px;
    padding: 8px 12px;
    margin: 0 0 12px;
}

.alert-info {
    border-color: var(--info);
    background: var(--info-bg);
    color: var(--header-dark);
}

.alert-ok {
    border-color: var(--ok);
    background: var(--ok-bg);
    color: #3C6D17;
}

.alert-warn,
.alert-warning {
    border-color: var(--warn);
    background: var(--warn-bg);
    color: #8A6500;
}

/* Django messages framework emits success / error / warning tags;
   map them onto the palette above. error reuses the base .alert
   (danger) styling, so only success + warning need aliases. */
.alert-success {
    border-color: var(--ok);
    background: var(--ok-bg);
    color: #3C6D17;
}

/* Sub-navigation tabs used by the Administration panel pages. */
.sub-nav {
    display: flex;
    gap: 4px;
    margin: 0 0 12px;
    border-bottom: 1px solid var(--rule);
}

.sub-nav a {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 3px 3px 0 0;
    text-decoration: none;
}

.sub-nav a:hover {
    background: var(--tint);
    color: var(--header-dark);
}

.sub-nav a.active {
    background: var(--panel-bg, #FFFFFF);
    color: var(--header-dark);
    border-color: var(--rule);
    margin-bottom: -1px;
}

/* Bulk-action bar above the findings table + stacked admin form on the
   finding detail page. Light spacing only; controls reuse .btn / select. */
.bulk-bar {
    margin: 0 0 8px;
    align-items: center;
    gap: 6px;
}

.stacked-form .filter-field {
    margin-bottom: 8px;
}

/* Findings changelist layout (classic Django admin): a thin horizontal
   filter bar on top, then the results table as the hero with the
   findings tree as a narrow nav rail on its left. */
.findings-main {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.findings-rail {
    flex: 0 0 300px;
    margin-bottom: 0;
}

.findings-results {
    flex: 1 1 auto;
    min-width: 0;
}

/* Let the asset search soak up the slack in the horizontal filter bar
   so the row fills the width instead of trailing off into dead space. */
.filter-field-grow {
    flex: 1 1 auto;
}

.filter-field-grow input[type="text"] {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 720px) {
    .findings-main {
        flex-direction: column;
    }
    .findings-rail {
        flex-basis: auto;
        width: 100%;
        margin-bottom: 12px;
    }
}

/* Findings tree: provider -> service -> rule, collapsible via native
   <details>. Each level's children are indented under their parent;
   counts hug the right; the selected node is highlighted. */
.finding-tree {
    font-size: 12px;
}

.finding-tree details {
    margin: 0;
}

/* Indent the children of each node one step in from its summary row,
   so provider sits above (and to the left of) its services, and
   services above their rules. */
.tree-children {
    margin: 0;
    padding-left: 18px;
}

.finding-tree summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
}

.finding-tree summary::-webkit-details-marker {
    display: none;
}

/* Disclosure triangle drawn on the summary so clicking it toggles,
   while the inner link still navigates. */
.finding-tree summary::before {
    content: "\25B8";  /* right-pointing triangle */
    color: var(--muted);
    font-size: 10px;
    width: 10px;
    flex: 0 0 10px;
    display: inline-block;
}

.finding-tree details[open] > summary::before {
    content: "\25BE";  /* down-pointing triangle */
}

.tree-provider > summary {
    font-weight: 700;
}

.tree-rules {
    list-style: none;
}

/* Align rule rows under their service label: the service summary has a
   10px triangle + 6px gap before its text, so pad rules to match. */
.tree-rules li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 1px 0 1px 16px;
}

.finding-tree .tree-link,
.tree-all {
    text-decoration: none;
    color: var(--accent-2, #1A4E66);
}

.tree-all {
    display: inline-block;
    margin-bottom: 6px;
    font-weight: 600;
}

.finding-tree .tree-link:hover,
.tree-all:hover {
    text-decoration: underline;
}

.finding-tree .tree-link.active,
.tree-all.active {
    font-weight: 700;
    color: var(--header-dark);
    background: var(--tint);
    padding: 0 4px;
    border-radius: 2px;
}

.tree-count {
    margin-left: auto;
    min-width: 20px;
    text-align: right;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* ----------------------------------------
   Badges
   ---------------------------------------- */

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border: 1px solid var(--border-dark);
    background: var(--surface-2);
    color: var(--text);
    letter-spacing: 0.3px;
    line-height: 1.4;
    vertical-align: middle;
    border-radius: 2px;
}

.badge-admin {
    background: var(--danger);
    color: #FFFFFF;
    border-color: #8A1818;
}

.badge-member {
    background: var(--accent);
    color: #FFFFFF;
    border-color: var(--header-dark);
}

.badge-none, .badge- {
    background: var(--muted-2);
    color: #FFFFFF;
    border-color: var(--muted);
}

.badge-severity-critical {
    background: linear-gradient(to bottom, #7A0000 0%, #4B0000 100%);
    color: #FFFFFF;
    border-color: #2B0000;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.badge-severity-high {
    background: linear-gradient(to bottom, #D94A4A 0%, var(--danger) 100%);
    color: #FFFFFF;
    border-color: #8A1818;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.badge-severity-medium {
    background: linear-gradient(to bottom, #FFD45A 0%, var(--warn) 100%);
    color: #3F2F00;
    border-color: #B88400;
}

.badge-severity-low {
    background: linear-gradient(to bottom, #A9D2E2 0%, var(--accent-pale) 100%);
    color: #163B4A;
    border-color: var(--accent-2);
}

.badge-severity-info {
    background: linear-gradient(to bottom, #FFFFFF 0%, var(--info-bg) 100%);
    color: var(--header-dark);
    border-color: var(--accent-2);
}

.badge-status-open {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger);
}

.badge-status-acknowledged {
    background: var(--warn-bg);
    color: #8A6500;
    border-color: var(--warn);
}

.badge-status-suppressed {
    background: var(--surface-2);
    color: var(--muted);
    border-color: var(--border-dark);
}

.badge-status-resolved {
    background: var(--ok-bg);
    color: #3C6D17;
    border-color: var(--ok);
}

/* ----------------------------------------
   Status indicators
   ---------------------------------------- */

.status {
    display: inline-block;
    width: 9px;
    height: 9px;
    border: 1px solid rgba(0, 0, 0, 0.35);
    vertical-align: middle;
    margin-right: 5px;
    border-radius: 2px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.status-ok    { background: var(--ok); }
.status-warn  { background: var(--warn); }
.status-err,
.status-danger { background: var(--danger); }
.status-info  { background: var(--accent-2); }
.status-idle  { background: var(--muted-2); }

/* ----------------------------------------
   Data tables (Django-admin changelist style)
   ---------------------------------------- */

table.data {
    border-collapse: collapse;
    width: 100%;
    margin: 0 0 12px;
    font-size: 12px;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
}

table.data th {
    background: linear-gradient(to bottom,
        var(--header-light) 0%, var(--header) 100%);
    color: #FFFFFF;
    border: 1px solid var(--header-dark);
    padding: 7px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

table.data td {
    border-top: 1px solid var(--border-dim);
    padding: 7px 10px;
    background: #FFFFFF;
    vertical-align: top;
}

table.data tr:nth-child(even) td {
    background: var(--surface-alt);
}

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

table.data.findings-table {
    table-layout: auto;
}

.findings-table .col-check {
    /* Hug the checkbox: 1% + nowrap collapses the column to its
       content width in an auto-layout table, so it never steals
       horizontal space from the asset column. */
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

.findings-table .col-severity {
    width: 86px;
}

.findings-table .col-status {
    width: 112px;
}

.findings-table .col-rule {
    width: 230px;
    overflow-wrap: anywhere;
}

.findings-table .col-project {
    width: 110px;
    overflow-wrap: anywhere;
}

.findings-table .col-last-seen {
    width: 132px;
    min-width: 132px;
}

.findings-table .asset-cell {
    min-width: 0;
}

.findings-table .asset-identifier {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-all;
}

.findings-table .col-actions {
    /* Pin the action column to a small fixed width on the right so
       the "View" button is always in the same spot per row, which
       is what makes the click target obvious. */
    width: 64px;
    min-width: 64px;
    text-align: right;
    white-space: nowrap;
}

/* Severity heatmap: a compact row of fixed-width counters, worst-first,
   reusing the badge severity palette. Zero cells dim out so non-zero
   counts read at a glance. */
.severity-heatmap {
    display: inline-flex;
    gap: 2px;
    vertical-align: middle;
}

.severity-heatmap .heat {
    display: inline-block;
    min-width: 22px;
    padding: 1px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
    border-radius: 2px;
}

.heat.heat-critical {
    background: linear-gradient(to bottom, #7A0000 0%, #4B0000 100%);
    color: #FFFFFF;
    border-color: #2B0000;
}

.heat.heat-high {
    background: linear-gradient(to bottom, #D94A4A 0%, var(--danger) 100%);
    color: #FFFFFF;
    border-color: #8A1818;
}

.heat.heat-medium {
    background: linear-gradient(to bottom, #FFD45A 0%, var(--warn) 100%);
    color: #3F2F00;
    border-color: #B88400;
}

.heat.heat-low {
    background: linear-gradient(to bottom, #A9D2E2 0%, var(--accent-pale) 100%);
    color: #163B4A;
    border-color: var(--accent-2);
}

.heat.heat-info {
    background: linear-gradient(to bottom, #FFFFFF 0%, var(--info-bg) 100%);
    color: var(--header-dark);
    border-color: var(--accent-2);
}

/* A zero count: drop the colour so only non-zero severities draw the
   eye. Overrides the per-severity rules above via the extra class. */
.heat.heat-zero {
    background: var(--tint);
    color: var(--muted);
    border-color: var(--rule);
    font-weight: 400;
}

/* Two-column panel grid for the project detail asset breakdowns. */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 720px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.btn-small {
    /* Compact variant of `.btn` for in-table actions. The default
       `.btn` padding makes rows taller than the data demands; the
       smaller pad keeps row height aligned with the badge baseline. */
    padding: 2px 8px;
    font-size: 11px;
}

/* ----------------------------------------
   Utility classes
   ---------------------------------------- */

.muted   { color: var(--muted); }
.small   { font-size: 11px; }
.bold    { font-weight: 700; }
.upper   { text-transform: uppercase; letter-spacing: 0.5px; }
.right   { text-align: right; }
.center  { text-align: center; }
.nowrap  { white-space: nowrap; }

.spacer-4  { height: 4px; }
.spacer-8  { height: 8px; }
.spacer-12 { height: 12px; }
.spacer-16 { height: 16px; }

.divider {
    border-top: 1px solid var(--border-dim);
    margin: 12px 0;
}

/* Inline KV grid for metadata, alternative to a table */
.kv {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 4px 12px;
    font-size: 12px;
}
.kv dt {
    font-weight: 700;
    color: var(--header-dark);
}
.kv dd {
    margin: 0;
    color: var(--text);
}

/* ----------------------------------------
   Filter bar (inventory + findings pages)
   ---------------------------------------- */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: flex-end;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Field captions: small, bold, slate — the late-2000s Django admin
   form-label treatment. Sentence case, never shouting. */
.filter-field label {
    font-size: 11px;
    font-weight: 700;
    color: var(--header-dark);
    letter-spacing: 0.2px;
}

.filter-field select,
.filter-field input[type="text"] {
    min-width: 150px;
}

/* The free-text searches want a little more room than the selects. */
.filter-field input[type="text"] {
    min-width: 180px;
}

.filter-actions {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    padding-bottom: 1px;
}

/* ----------------------------------------
   Pagination
   ---------------------------------------- */

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 12px;
    font-size: 12px;
}

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

/* ----------------------------------------
   Metadata pre-formatted block
   ---------------------------------------- */

.metadata-pre {
    white-space: pre-wrap;
    word-break: break-all;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.5;
    margin: 0;
    color: var(--text);
}

/* ----------------------------------------
   Homepage stat panels
   Two side-by-side panels with a tight label/value row
   list inside (Django-admin "Recent Actions" sidebar
   pattern), and a build-server-style scanner strip
   underneath.
   ---------------------------------------- */

.home-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0 0 12px;
}

@media (max-width: 720px) {
    .home-cols {
        grid-template-columns: 1fr;
    }
}

.panel-body-flush {
    padding: 0;
}

.stat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.stat-list li {
    border-bottom: 1px solid var(--border-dim);
}

.stat-list li:last-child {
    border-bottom: 0;
}

.stat-list li:nth-child(even) {
    background: var(--surface-alt);
}

.stat-list a,
.stat-list .stat-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 12px;
    color: var(--text);
    text-decoration: none;
}

.stat-list a:hover {
    background: var(--tint);
    text-decoration: none;
}

.stat-list a:hover .stat-list-value {
    color: var(--link-hover);
    text-decoration: underline;
}

.stat-list-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--header-dark);
}

.stat-list-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--link);
}

.stat-list-row-muted .stat-list-label,
.stat-list-row-muted .stat-list-value {
    color: var(--muted-2);
    font-weight: 400;
}

/* Severity dots for the findings list. Re-uses .status
   primitive (9px square, inset highlight) and just adds
   the colour family. */
.status-sev-critical { background: var(--danger); }
.status-sev-high     { background: #D9534F; }
.status-sev-medium   { background: var(--warn); }
.status-sev-low      { background: #6FAFCC; }
.status-sev-info     { background: var(--muted-2); }

/* Scanner strip -- compact stamped pills, one per
   provider. Mimics a build-server status bar. */
.scanner-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.scanner-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 8px;
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: 2px;
    background: var(--surface-alt);
    line-height: 1.4;
}

.scanner-cell-ok      { border-left-color: var(--ok);     background: var(--ok-bg); }
.scanner-cell-failed  { border-left-color: var(--danger); background: var(--danger-bg); }
.scanner-cell-running { border-left-color: var(--info);   background: var(--info-bg); }

.scanner-cell-status {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--header-dark);
}

.scanner-cell-ok .scanner-cell-status      { color: #3F7E11; }
.scanner-cell-failed .scanner-cell-status  { color: var(--danger); }
.scanner-cell-running .scanner-cell-status { color: var(--info); }

.scanner-cell-provider {
    font-weight: 600;
}

.scanner-cell-when {
    font-variant-numeric: tabular-nums;
}
