:root {
  --navy: #1e3a5f;
  --navy-dark: #152b47;
  --accent: #2f6fed;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #64748b;
  --border: #e2e8f0;
  --critical: #b91c1c; --critical-bg: #fee2e2;
  --high: #c2410c;     --high-bg: #ffedd5;
  --medium: #b45309;   --medium-bg: #fef3c7;
  --low: #15803d;      --low-bg: #dcfce7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; font-weight: 650; }
h3 { font-size: .95rem; margin: 0 0 .5rem; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt { margin-top: 1rem; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header { background: var(--navy); color: #fff; border-bottom: 3px solid var(--accent); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; font-weight: 700; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; background: #fff; position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; inset: 6px 8px 5px; background: var(--navy); clip-path: polygon(50% 0, 100% 18%, 100% 55%, 50% 100%, 0 55%, 0 18%); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-size: .72rem; font-weight: 400; color: #c7d2e0; letter-spacing: .02em; }
.site-nav { display: flex; gap: .25rem; margin-left: auto; }
.site-nav a { color: #dbe4f0; padding: .5rem .8rem; border-radius: 6px; font-weight: 500; }
.site-nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.site-nav a.active { background: rgba(255,255,255,.16); color: #fff; }
.status-pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; padding: .3rem .65rem; border-radius: 999px; background: rgba(255,255,255,.12); color: #e2e8f0; }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); }
.status-pill.offline .dot { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .25); }

/* Page header */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: 1.75rem 0 1.25rem; }
.page-head p { margin: 0; color: var(--muted); max-width: 720px; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Cards & stats */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-head h2 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .85rem; margin-bottom: 1.25rem; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); color: inherit; position: relative; }
.stat:hover { text-decoration: none; border-color: #c7d2e0; }
.stat.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 111, 237, .12); }
.stat .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 1.7rem; font-weight: 700; line-height: 1.2; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .78rem; color: var(--muted); }
.stat.critical .value { color: var(--critical); }
.stat.high .value { color: var(--high); }
.stat.medium .value { color: var(--medium); }
.stat.low .value { color: var(--low); }
.overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.overview .card { margin: 0; }

/* Bars */
.bars { display: grid; gap: .45rem; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 56px; gap: .6rem; align-items: center; font-size: .86rem; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 9px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.bar-row .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.trend { display: flex; align-items: flex-end; gap: 4px; height: 90px; padding-top: .5rem; }
.trend .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.trend .col span { display: block; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.trend .col:hover span { opacity: 1; }
.trend-labels { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: .3rem; }

/* Filters */
.filters { display: flex; gap: .7rem; flex-wrap: wrap; align-items: flex-end; }
.filters > div { flex: 1; min-width: 150px; }
.filters > div.narrow { flex: 0 0 120px; min-width: 100px; }
.filters > div.actions { flex: 0 0 auto; min-width: 0; display: flex; gap: .5rem; }
label { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: .25rem; text-transform: uppercase; letter-spacing: .04em; }
input[type=text], input[type=search], input[type=number], select { width: 100%; padding: .5rem .65rem; border: 1px solid #cbd5e1; border-radius: 7px; font: inherit; background: #fff; color: var(--text); }
input:focus, select:focus { outline: 2px solid rgba(47, 111, 237, .3); border-color: var(--accent); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem .9rem; border-radius: 7px; border: 1px solid #cbd5e1; background: #fff; color: var(--text); font: inherit; font-weight: 500; cursor: pointer; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: #f8fafc; text-decoration: none; border-color: #94a3b8; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #245ccc; border-color: #245ccc; }
.btn-sm { padding: .32rem .6rem; font-size: .84rem; }

/* Badges & threat level */
.badge { display: inline-block; padding: .14rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 650; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.badge-critical { background: var(--critical-bg); color: var(--critical); }
.badge-high { background: var(--high-bg); color: var(--high); }
.badge-medium { background: var(--medium-bg); color: var(--medium); }
.badge-low { background: var(--low-bg); color: var(--low); }
.badge-neutral { background: #e2e8f0; color: #334155; text-transform: none; }
.level { display: inline-flex; align-items: center; gap: .5rem; min-width: 120px; }
.level .track { width: 64px; height: 7px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.level .fill { height: 100%; border-radius: 999px; }
.level .pct { font-variant-numeric: tabular-nums; font-weight: 650; min-width: 2.6em; }
.level.critical .fill { background: var(--critical); } .level.critical .pct { color: var(--critical); }
.level.high .fill { background: var(--high); } .level.high .pct { color: var(--high); }
.level.medium .fill { background: var(--medium); } .level.medium .pct { color: var(--medium); }
.level.low .fill { background: var(--low); } .level.low .pct { color: var(--low); }
.flag { display: inline-block; min-width: 2.2em; padding: .05rem .35rem; border-radius: 4px; background: #eef2f7; font-size: .78rem; font-weight: 650; color: #334155; text-align: center; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .6rem .8rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { background: #f8fafc; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: #475569; white-space: nowrap; font-weight: 650; }
th a { color: inherit; }
th a.sorted { color: var(--accent); }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: 0; }
td.ip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; white-space: nowrap; }
td.ip a { color: var(--navy); }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .8rem 1.25rem; border-top: 1px solid var(--border); font-size: .88rem; color: var(--muted); }

/* Pagination */
.pagination { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span { padding: .3rem .6rem; border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: .86rem; color: var(--text); }
.pagination a:hover { border-color: #94a3b8; text-decoration: none; }
.pagination span.current { background: var(--navy); color: #fff; border-color: var(--navy); }
.pagination span.disabled { color: #cbd5e1; }

/* Detail page */
.detail-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 1.75rem 0 1.25rem; }
.detail-head h1 { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.7rem; margin: 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: 1.25rem; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.2rem; font-size: .92rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.timeline .meta { color: var(--muted); font-size: .82rem; margin-top: .2rem; }
@media (max-width: 640px) { .timeline li { grid-template-columns: 1fr; gap: .2rem; } }
details summary { cursor: pointer; color: var(--accent); font-size: .86rem; }
details pre { background: #0f172a; color: #e2e8f0; padding: .75rem; border-radius: 7px; margin-top: .5rem; font-size: .8rem; overflow: auto; }

/* Docs */
.docs h2 { margin-top: 1.5rem; }
.docs table td:first-child { white-space: nowrap; }
.docs pre.code { background: #0f172a; color: #e2e8f0; padding: .85rem 1rem; border-radius: 8px; font-size: .84rem; overflow: auto; margin: .5rem 0 1rem; }
.method { display: inline-block; font-size: .72rem; font-weight: 700; padding: .1rem .4rem; border-radius: 4px; background: #dbeafe; color: #1e40af; margin-right: .3rem; }
.method.post { background: #dcfce7; color: #166534; }
.note { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; padding: .7rem 1rem; border-radius: 8px; font-size: .9rem; }

/* Footer */
.site-footer { margin-top: 3rem; border-top: 1px solid var(--border); background: #fff; font-size: .84rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.2rem 1.25rem; }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }

@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; gap: .75rem; padding-top: .6rem; padding-bottom: .6rem; }
  .site-nav { margin-left: 0; order: 3; width: 100%; }
  .hide-mobile { display: none; }
}
