:root {
  --bg: #f3f5f8; --card: #fff; --ink: #1b2430; --muted: #64707d; --line: #dde3ea;
  --accent: #b5473c; --accent-ink: #fff; --ok: #2e8b57; --warn: #d9822b; --bad: #c0392b; --info: #3b6ea5;
  --navy: #14213d;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; }
code { background: #eef1f5; padding: 0 .3em; border-radius: 3px; font-size: .92em; }
h1 { font-size: 1.5rem; margin: .2rem 0 .6rem; }
h1 small, h2 small { font-weight: 400; font-size: .8rem; }
h2 { font-size: 1.05rem; margin: 1rem 0 .4rem; }
h2:first-child { margin-top: 0; }
p { margin: .3rem 0 .6rem; line-height: 1.45; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.tiny { font-size: .75rem; }
.nowrap { white-space: nowrap; }
.r { text-align: right; }
.ellip { max-width: 28rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

header.top { background: var(--navy); color: #e9edf3; display: flex; align-items: center; gap: 1.2rem; padding: .55rem 1.2rem; flex-wrap: wrap; }
.brand { font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.brand small { font-weight: 400; opacity: .7; margin-left: .3rem; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }
header nav { display: flex; gap: .2rem; flex-wrap: wrap; }
header nav a { color: #cfd7e3; padding: .35rem .6rem; border-radius: 6px; font-size: .9rem; }
header nav a.on, header nav a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
form.logout { margin-left: auto; display: flex; align-items: center; gap: .6rem; font-size: .88rem; }
main { max-width: 1400px; margin: 0 auto; padding: 1rem 1.2rem 3rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; margin-bottom: 1rem; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid .card { margin-bottom: 0; }
@media (max-width: 900px) { .grid.two { grid-template-columns: 1fr; } }
a.card { color: inherit; display: block; }
a.card:hover { text-decoration: none; border-color: var(--accent); }
.stat .num { font-size: 2rem; font-weight: 700; }
.stat.big { grid-column: span 2; }

.bar { position: relative; height: 10px; background: #e6eaf0; border-radius: 5px; overflow: hidden; margin: .4rem 0; }
.bar span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--warn); border-radius: 5px; width: 0; transition: width .4s; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ok); border-radius: 5px; width: 0; transition: width .4s; }
.bar.small { width: 180px; display: inline-block; vertical-align: middle; }

.flash { padding: .6rem .9rem; border-radius: 8px; margin-bottom: .8rem; border: 1px solid var(--line); background: #fff; }
.flash.ok { border-color: var(--ok); }
.flash.error { border-color: var(--bad); color: var(--bad); }

button, .btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: .45rem .9rem; font: inherit; cursor: pointer; display: inline-block; }
button:hover, .btn:hover { filter: brightness(.93); text-decoration: none; }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
header button.ghost { color: #fff; border-color: rgba(255,255,255,.3); }
input, select, textarea { font: inherit; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); width: 100%; }
label { display: block; margin-bottom: .7rem; font-size: .9rem; color: var(--muted); }
label input, label select, label textarea { margin-top: .25rem; display: block; color: var(--ink); }
.login { max-width: 380px; margin: 4rem auto; }
.filters { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.filters input { width: 16rem; }
.filters select { width: auto; }
.titlebar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
form.inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
form.inline input { width: 24rem; }
form.inline select { width: auto; }
.settings { max-width: 560px; }

table { border-collapse: collapse; width: 100%; }
table.tight td, table.tight th { padding: .25rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; font-size: .9rem; }
table.items th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .3rem .4rem; border-bottom: 1px solid var(--line); }
table.items td { padding: .45rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.items tr:last-child td { border-bottom: 0; }
table.items select.st { width: auto; padding: .25rem .4rem; font-size: .86rem; }
tr.st-verified { background: #eef8f1; }
tr.st-configured { background: #f4f9ee; }
tr.st-skipped td, tr.disabled td, tr.st-source_disabled td { color: var(--muted); }
tr.disabled b, tr.st-skipped b { text-decoration: line-through; font-weight: 500; }
tr.saving { outline: 2px solid var(--warn); }
tr.saved { outline: 2px solid var(--ok); }
tr.warnrow { background: #fdf1ef; }
.note { font-size: .85rem; color: var(--info); margin-top: .15rem; white-space: pre-line; }

.pill { display: inline-block; font-size: .74rem; padding: .1rem .5rem; border-radius: 999px; background: #e7ebf1; color: var(--muted); }
.pill.ok { background: #dcf1e3; color: var(--ok); }
.pill.warn { background: var(--warn); color: #fff; }
.pill.st-verified { background: #dcf1e3; color: var(--ok); }
.pill.st-configured { background: #e7f2d8; color: #4f7a1d; }
.risk { display: inline-block; font-size: .74rem; padding: .1rem .5rem; border-radius: 4px; text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.risk.high { background: #fbe3e0; color: var(--bad); }
.risk.medium { background: #fdeedb; color: var(--warn); }
.risk.low { background: #e6eef8; color: var(--info); }
.risk.info { background: #eceff3; color: var(--muted); }
.risks { display: flex; gap: .6rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.risks .risk { font-size: .95rem; padding: .5rem .9rem; text-transform: none; }
.risks .risk b { font-size: 1.2rem; margin-left: .3rem; }

.grouphead { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: .5rem; }
.grouphead h2 { margin: 0; font-family: ui-monospace, Consolas, monospace; }
.groupmeta { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.bulk { display: flex; gap: .3rem; align-items: center; }
.bulk select { width: auto; font-size: .85rem; padding: .25rem .4rem; }
.host { margin-right: .8rem; }

.ipgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem; }
.ipchip { border: 1px solid var(--line); border-radius: 6px; padding: .35rem .5rem; display: flex; justify-content: space-between; color: var(--ink); font-size: .85rem; }
.ipchip b { font-family: ui-monospace, Consolas, monospace; font-weight: 500; }
.ipchip.done { background: #f4f9ee; border-color: #b9d9a1; }
.ipchip.ver { background: #dcf1e3; border-color: var(--ok); }
.ipchip:hover { text-decoration: none; border-color: var(--accent); }

pre.cli { background: #0f172a; color: #d7e0ea; padding: .8rem 1rem; border-radius: 8px; overflow: auto; font-size: .82rem; line-height: 1.4; white-space: pre; }
pre.cli.full { max-height: 75vh; }
details.snip summary { cursor: pointer; font-size: .82rem; color: var(--info); }
details.snip pre { background: #0f172a; color: #d7e0ea; padding: .6rem .8rem; border-radius: 6px; font-size: .78rem; margin: .3rem 0 0; white-space: pre; overflow: auto; max-width: 42rem; }
.decision.decided { opacity: .7; }
.dhead { display: flex; align-items: center; gap: .6rem; }
.dhead h2 { margin: 0; }
