:root {
  --red: #f03340;
  --navy: #1c365c;
  --navy-2: #24426e;
  --yellow: #ffbf40;
  --ink: #212421;
  --muted: #5b6472;
  --line: #e3e6eb;
  --bg: #f4f6f9;
  --card: #ffffff;
  --ok: #15803d;
  --ok-bg: #e7f6ec;
  --warn: #92600a;
  --warn-bg: #fff4dc;
  --bad: #b4232e;
  --bad-bg: #fde8ea;
  --idle: #5b6472;
  --idle-bg: #eef0f3;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Roboto, Arial, sans-serif; }
h1, h2, h3 { font-family: Poppins, Arial, sans-serif; line-height: 1.25; margin: 0; }
h1 { font-size: 24px; font-weight: 600; }
h2 { font-size: 16px; font-weight: 600; color: var(--navy); margin-bottom: 10px; }
h2.sect { margin: 22px 0 10px; }
h2.mt { margin-top: 18px; }
a { color: var(--navy); }
code, .code { font-family: Consolas, "SFMono-Regular", monospace; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.top { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 20px; padding: 10px 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-family: Poppins, Arial, sans-serif; font-weight: 500; }
.brand img { display: block; }
.brand span { border-left: 1px solid rgba(255, 255, 255, .35); padding-left: 12px; white-space: nowrap; }
.sites { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.sites a { color: #dfe6f1; text-decoration: none; padding: 6px 12px; border-radius: 6px; font-weight: 500; }
.sites a.on, .sites a:hover { background: var(--navy-2); color: #fff; }
.sites a.add { color: var(--yellow); }
.logout { margin: 0; }

main { max-width: 1240px; margin: 0 auto; padding: 24px; }
.page-head { margin-bottom: 18px; }
.page-head p { margin: 6px 0 0; }
.page-head.site { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.status-box { text-align: right; }
.status-box .muted { margin-top: 4px; max-width: 460px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.site-card { display: block; color: inherit; text-decoration: none; border-top: 4px solid var(--red); transition: box-shadow .15s; }
.site-card:hover { box-shadow: 0 6px 20px rgba(28, 54, 92, .12); }
.site-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.site-head h2 { font-size: 20px; margin: 0; color: var(--ink); }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; margin: 12px 0; }
.mini .k { display: block; font-size: 12px; color: var(--muted); }
.mini .v { font-family: Poppins, Arial, sans-serif; font-weight: 600; font-size: 17px; }
.row-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.row-badges > .muted { width: 92px; }

.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a.on { color: var(--navy); border-bottom-color: var(--red); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; border-left: 4px solid var(--navy); }
.tile.bad { border-left-color: var(--red); }
.tile .k { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tile .v { font-family: Poppins, Arial, sans-serif; font-size: 26px; font-weight: 600; margin: 2px 0; }
.tile .s { font-size: 13px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .card { margin-bottom: 16px; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill.up { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.down { background: var(--bad-bg); color: var(--bad); }
.pill.idle { background: var(--idle-bg); color: var(--idle); }

.btn { display: inline-block; font: 500 14px Roboto, Arial, sans-serif; padding: 8px 14px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--navy); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--navy); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: #d92a37; }
.btn.ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
form.inline { display: inline; }
.mt-s { display: inline-block; margin-top: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); padding: 8px; }
td { border-bottom: 1px solid #f0f2f5; padding: 8px; vertical-align: top; }
.num { text-align: right; }
td.path { font-family: Consolas, monospace; font-size: 13px; word-break: break-all; }
.legend { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: -1px; }
.sw.up { background: #16a34a; } .sw.warn { background: #f59e0b; } .sw.down { background: #f03340; } .sw.idle { background: #e5e7eb; }
.chart .ax { font-size: 10px; fill: var(--muted); } .chart .grid { stroke: #eef0f3; }
.share { margin: 6px 0; font-size: 14px; } .share-top { display: flex; justify-content: space-between; gap: 8px; }
.share-track { height: 7px; background: #eef0f3; border-radius: 4px; } .share-fill { height: 7px; border-radius: 4px; }
dl.kv { display: grid; grid-template-columns: 90px 1fr; gap: 4px 12px; margin: 10px 0 0; font-size: 14px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 0 0 16px; background: var(--ok-bg); color: var(--ok); }
.flash.bad { background: var(--bad-bg); color: var(--bad); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.shot { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.shot.warn { border-color: #f5c56b; } .shot.fail { border-color: var(--red); }
.shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: #f0f2f5; }
.noshot { aspect-ratio: 16 / 10; display: grid; place-items: center; color: var(--muted); background: #f0f2f5; }
.shot figcaption { padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.shot .u { font-size: 13px; word-break: break-all; }
.probs { margin: 0; padding-left: 18px; font-size: 13px; color: var(--bad); }
.probs li.info { color: var(--muted); }

.form label { display: block; margin-bottom: 12px; font-weight: 500; font-size: 14px; }
.form input, .form textarea, .notes-form textarea, .login input { display: block; width: 100%; margin-top: 4px; padding: 9px 11px; border: 1px solid #cfd4dc; border-radius: 7px; font: 14px Roboto, Arial, sans-serif; }
.form textarea.code { font: 12.5px Consolas, monospace; }
.notes-form { display: flex; gap: 8px; align-items: flex-start; }
.notes-form textarea { margin: 0; min-width: 220px; }
table.reports td { vertical-align: middle; }
pre.code { background: #f4f6f9; border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; white-space: pre-wrap; word-break: break-all; }

.login-body { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), #2c4f80); padding: 16px; }
.login { width: 100%; max-width: 380px; text-align: left; }
.login h1 { margin: 14px 0 4px; }
.login label { display: block; margin-top: 16px; font-weight: 500; }
.login .btn { width: 100%; margin-top: 16px; padding: 11px; }

@media (max-width: 860px) {
  .grid2 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  main { padding: 16px; }
  .top { padding: 10px 16px; }
  .status-box { text-align: left; }
  .mini { grid-template-columns: repeat(2, 1fr); }
  table { font-size: 13px; }
  .notes-form { flex-direction: column; }
  .notes-form textarea { min-width: 0; width: 100%; }
  .card { overflow-x: auto; }
}
