:root {
  --navy: #0B2540;
  --blue: #00609E;
  --blue-dark: #00426E;
  --green: #2F7326;
  --red: #B42318;
  --amber: #9A5B00;
  --ink: #0B2540;
  --muted: #56616C;
  --line: #DDE1DC;
  --bg: #F5F6F3;
  --card: #FFFFFF;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--blue); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); font-weight: 400; }
.mono { font-family: "IBM Plex Mono", monospace; font-size: 13px; }

/* header */
.top { background: var(--navy); color: #fff; }
.top-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-name { font-family: "IBM Plex Mono", monospace; font-size: 15px; color: #8CCB6A; letter-spacing: .06em; text-transform: uppercase; border-left: 1px solid #2C3F57; padding-left: 12px; }
.top-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; padding: 6px 12px; border-radius: 999px; background: #13324F; color: #DDE6EE; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #8B97A3; }
.pill.ok::before { background: #8CCB6A; }
.pill.bad { background: #5A1A14; color: #fff; }
.pill.bad::before { background: #FF8A7A; }

/* buttons */
.btn { font: inherit; font-weight: 500; font-size: 14px; min-height: 40px; padding: 8px 14px; border-radius: 6px; border: 1px solid #A9B1AB; background: #fff; color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-danger { color: var(--red); border-color: #E3B4AE; }
.btn-ghost { background: transparent; color: #fff; border-color: #4A5E73; }
.btn-ghost:hover { border-color: #fff; }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.linkbtn { font: inherit; background: none; border: 0; padding: 4px 6px; color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: 13px; }

/* summary */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 24px 0 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; display: flex; align-items: baseline; gap: 10px; }
.tile-n { font-size: 30px; font-weight: 700; }
.tile-l { color: var(--muted); }
.tile-down.has .tile-n { color: var(--red); }
.tile-down.has { border-color: #E3B4AE; background: #FDF3F1; }

.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.toolbar-left { display: flex; gap: 8px; flex-wrap: wrap; }
.search input { font: inherit; min-height: 40px; padding: 8px 12px; border: 1px solid #A9B1AB; border-radius: 6px; width: min(340px, 100%); background: #fff; }
.search { flex: 0 1 340px; }

/* customers and tables */
.customer { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; overflow: hidden; }
.customer-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.customer-head h2 { margin: 0; font-size: 18px; }
.customer-head .meta { color: var(--muted); font-size: 14px; }
.table-wrap { overflow-x: auto; position: relative; }
table { border-collapse: collapse; width: 100%; min-width: 860px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #EEF0EC; vertical-align: top; }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: #FAFBF9; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mon-name { font-weight: 600; }
.child .mon-name::before { content: "↳ "; color: var(--muted); font-weight: 400; }
.sub { color: var(--muted); font-size: 13px; word-break: break-all; }
.since { white-space: nowrap; word-break: normal; }
.err { color: var(--red); font-size: 13px; }
.empty { padding: 18px; color: var(--muted); }
.row-actions { white-space: nowrap; width: 56px; text-align: right; }
.kebab { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.kebab:hover, .kebab[aria-expanded=true] { background: #EEF0EC; border-color: var(--line); color: var(--ink); }
.kebab:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.menu { position: absolute; z-index: 50; min-width: 168px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(11,37,64,.18); padding: 4px; display: flex; flex-direction: column; }
.menu button { font: inherit; font-size: 14px; text-align: left; background: none; border: 0; border-radius: 6px; padding: 9px 12px; min-height: 40px; cursor: pointer; color: var(--ink); }
.menu button:hover, .menu button:focus-visible { background: #EAF3FA; outline: none; }

.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #8B97A3; }
.status.up { color: var(--green); }  .status.up::before { background: var(--green); }
.status.down { color: var(--red); }  .status.down::before { background: var(--red); }
.status.failing { color: var(--amber); } .status.failing::before { background: #D99A00; }
.status.paused { color: var(--muted); } .status.paused::before { background: transparent; border: 2px solid #8B97A3; width: 6px; height: 6px; }

.u-good { color: var(--green); } .u-warn { color: var(--amber); } .u-bad { color: var(--red); }

/* incidents */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin: 24px 0 48px; }
.panel h2 { margin: 0 0 12px; font-size: 18px; }
.incidents { display: flex; flex-direction: column; }
.inc { display: grid; grid-template-columns: minmax(120px, 160px) 1fr auto; gap: 12px; padding: 10px 0; border-top: 1px solid #EEF0EC; align-items: baseline; }
.inc:first-child { border-top: 0; }
.inc .when { color: var(--muted); font-size: 13px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: #EEF0EC; color: var(--muted); margin-left: 6px; }
.tag.ongoing { background: #FDE8E5; color: var(--red); }
@media (max-width: 640px) { .inc { grid-template-columns: 1fr; gap: 2px; } }

/* dialogs */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(11,37,64,.35); color: var(--ink); }
dialog.wide { width: min(900px, calc(100vw - 24px)); padding: 22px; }
dialog::backdrop { background: rgba(11,37,64,.45); }
dialog form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
dialog h2 { margin: 0; font-size: 20px; }
dialog label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 500; }
dialog input:not([type=radio]):not([type=checkbox]), dialog select, dialog textarea { font: inherit; font-weight: 400; min-height: 40px; padding: 8px 10px; border: 1px solid #A9B1AB; border-radius: 6px; background: #fff; width: 100%; }
dialog textarea { resize: vertical; }
label.check { flex-direction: row; align-items: center; gap: 8px; align-self: end; min-height: 40px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
fieldset.types { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
fieldset.types legend { font-size: 14px; font-weight: 500; margin-bottom: 6px; padding: 0; }
fieldset.types label { flex-direction: row; align-items: center; gap: 6px; border: 1px solid #C9CFCA; border-radius: 6px; padding: 8px 12px; cursor: pointer; min-height: 40px; }
fieldset.types label:has(input:checked) { border-color: var(--blue); background: #EAF3FA; }
.hint { margin: -4px 0 0; color: var(--muted); font-size: 14px; }
details.more { border-top: 1px solid var(--line); padding-top: 10px; }
details.more summary { cursor: pointer; font-weight: 500; font-size: 14px; color: var(--blue); }
details.more[open] { display: flex; flex-direction: column; gap: 12px; }
.form-error { margin: 0; color: var(--red); font-size: 14px; min-height: 0; }
.form-error:empty { display: none; }
.test-result { margin: 0; font-size: 14px; }
.test-result:empty { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spacer { flex: 1; }

/* history */
.history-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.seg { display: inline-flex; border: 1px solid #A9B1AB; border-radius: 6px; overflow: hidden; }
.seg button { font: inherit; font-size: 14px; border: 0; background: #fff; padding: 6px 14px; min-height: 36px; cursor: pointer; }
.seg button + button { border-left: 1px solid #A9B1AB; }
.seg button[aria-pressed=true] { background: var(--navy); color: #fff; }
.chart { width: 100%; overflow: hidden; }
.chart svg { width: 100%; height: auto; display: block; }

/* HTTPS security scan */
.grade { font: inherit; font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 600; line-height: 1; margin-left: 8px; padding: 4px 7px; border-radius: 5px; border: 1px solid transparent; cursor: pointer; vertical-align: 1px; min-height: 0; }
.grade.g-good { background: #E6F2E3; color: var(--green); border-color: #B9D8B1; }
.grade.g-warn { background: #FBF0DC; color: var(--amber); border-color: #EBCB8E; }
.grade.g-bad { background: #FDE8E5; color: var(--red); border-color: #E3B4AE; }
.grade.g-pending { background: #EEF0EC; color: var(--muted); border-color: var(--line); font-family: inherit; font-weight: 500; }
.grade.busy { outline: 2px dashed #A9B1AB; outline-offset: 1px; }
.grade:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.warn-text { color: var(--amber); font-size: 13px; }
label.check-top { align-self: start; align-items: flex-start; min-height: 0; }
label.check-top input { margin-top: 4px; }
.hint-indent { margin: 4px 0 0 24px; font-size: 13px; }
.tls-panel { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; }
.tls-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.tls-head h3 { margin: 0; font-size: 17px; }
.tls-grid { display: grid; grid-template-columns: 84px 1fr; gap: 16px; align-items: start; }
.tls-grade { width: 84px; height: 84px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700; border: 1px solid; }
.tls-grade.g-good { background: #E6F2E3; color: var(--green); border-color: #B9D8B1; }
.tls-grade.g-warn { background: #FBF0DC; color: var(--amber); border-color: #EBCB8E; }
.tls-grade.g-bad { background: #FDE8E5; color: var(--red); border-color: #E3B4AE; }
.tls-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
.tls-facts dt { color: var(--muted); }
.tls-facts dd { margin: 0; word-break: break-word; }
.protos { display: flex; flex-wrap: wrap; gap: 6px; }
.proto { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.proto.p-on { background: #E6F2E3; color: var(--green); border-color: #B9D8B1; }
.proto.p-bad { background: #FDE8E5; color: var(--red); border-color: #E3B4AE; }
.proto.p-off { color: var(--muted); }
.caps { margin: 12px 0 0; padding-left: 18px; color: var(--red); font-size: 14px; }
.tls-panel h4 { margin: 14px 0 6px; font-size: 14px; }
.findings { list-style: none; margin: 0; padding: 0; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.findings li { word-break: break-word; }
.sev { display: inline-block; min-width: 68px; text-align: center; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; }
.sev-critical { background: var(--red); color: #fff; }
.sev-high { background: #FDE8E5; color: var(--red); }
.sev-medium { background: #FBF0DC; color: var(--amber); }
.sev-low { background: #EEF0EC; color: var(--muted); }
.more-findings { margin-top: 10px; font-size: 14px; }
.more-findings summary { cursor: pointer; color: var(--blue); margin-bottom: 6px; }
.small { font-size: 13px; }
@media (max-width: 560px) { .tls-grid { grid-template-columns: 1fr; } .tls-facts { grid-template-columns: 1fr; } .tls-facts dd { margin-bottom: 6px; } }

/* on-site probes */
.via { display: inline-block; font-size: 12px; padding: 0 7px; border-radius: 999px; background: #EAF3FA; color: var(--blue-dark); white-space: nowrap; }
.tag-btn { font: inherit; font-size: 12px; border: 1px solid #EBCB8E; background: #FBF0DC; color: var(--amber); cursor: pointer; }
.tag-btn:hover { border-color: var(--amber); }
.hint-small { font-size: 13px; margin: 4px 0 0; }
.probe-info { border-top: 1px solid var(--line); padding-top: 12px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.update-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 14px; }
.probe-install { border-top: 1px solid var(--line); padding-top: 12px; font-size: 14px; }
.probe-install h3 { margin: 0 0 8px; font-size: 16px; }
.probe-install ol { margin: 8px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.probe-install details { margin-top: 8px; }
.probe-install summary { cursor: pointer; color: var(--blue); }
.warn-box { margin: 0; padding: 8px 12px; border-radius: 6px; background: #FBF0DC; border: 1px solid #EBCB8E; color: #5C3A00; }
.cmd { margin-top: 8px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.cmd-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 4px 10px; background: #FAFBF9; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.cmd pre { margin: 0; padding: 10px; white-space: pre-wrap; word-break: break-all; font-size: 12.5px; background: #fff; }

/* discovery suggestions */
.tag-paid { background: #E6F0E0; color: var(--green); font-weight: 600; }
.count { display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 12px; align-items: center; justify-content: center; vertical-align: 1px; }
.dgroup { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.drow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #EEF0EC; }
.drow:last-child { border-bottom: 0; }
.drow.risky { background: #FDF6EC; }
.dmain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.dsrc { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.dtag { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: #EAF3FA; color: var(--blue-dark); }
.dtag-warn { background: #FBF0DC; color: var(--amber); }
.dacts { display: flex; align-items: center; gap: 8px; }

/* domain expiry strip */
.domains-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 18px; border-bottom: 1px solid var(--line); background: #FAFBF9; font-size: 13px; }
.dom { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.dom .mono { font-size: 12px; }
.dom-ok { color: var(--muted); }
.dom-warn { background: #FBF0DC; border-color: #EBCB8E; color: #5C3A00; }
.dom-bad { background: #FDE8E5; border-color: #E3B4AE; color: var(--red); font-weight: 500; }
.dom-muted { color: var(--muted); border-style: dashed; }

/* discovery port findings */
.seg-btns { display: flex; gap: 6px; }
.dgroup-h { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.dgroup-h:first-child { margin-top: 0; }
.drow.review { background: #FBF7EF; }
.dtag-bad { background: var(--red); color: #fff; }

/* port scan progress */
.scan-prog { margin-top: 10px; }
.scan-bar { height: 8px; background: #EEF0EC; border-radius: 999px; overflow: hidden; }
.scan-fill { height: 100%; background: var(--blue); border-radius: 999px; transition: width .4s ease; }
.scan-label { margin-top: 4px; font-size: 13px; color: var(--muted); }

/* ISP / geo line */
.geo { color: var(--muted); font-size: 12px; margin-top: 2px; }
.geo::before { content: "\1F310"; margin-right: 4px; opacity: .6; }

/* port scan scope dialog */
.scan-choices { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.scan-choices .btn { text-align: left; }
.scan-choices label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 500; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; }

[hidden] { display: none !important; }

/* phones: keep the key columns, drop the rest */
@media (max-width: 720px) {
  table { min-width: 0; }
  th:nth-child(3), td:nth-child(3), th:nth-child(5), td:nth-child(5), th:nth-child(6), td:nth-child(6),
  th:nth-child(7), td:nth-child(7), th:nth-child(8), td:nth-child(8) { display: none; }
  th, td { padding: 10px; }
  .brand-logo { height: 34px; }
}
.credit { margin: 24px 0 8px; text-align: center; }
.credit a { color: inherit; }
/* maintenance windows */
.tag-maint { background: #E3EEF7; color: var(--blue-dark); }
.maint-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; padding: 10px 0; border-top: 1px solid #EEF0EC; }
.maint-row:first-child { border-top: 0; }
.maint-row .grow { flex: 1 1 280px; }
#maint-form { padding: 16px 0 0; border-top: 1px solid var(--line); margin-top: 12px; }
#maint-form h3 { margin: 0; font-size: 16px; }
#maint-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
#maint-form legend { font-weight: 500; margin-bottom: 4px; }
.maint-monitors { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; padding-left: 26px; }
.maint-days { display: flex; flex-wrap: wrap; gap: 6px 16px; }
#maint-form label.check { align-self: start; min-height: 32px; }
/* Cloudflare import */
#cf-form { padding: 16px 0 0; border-top: 1px solid var(--line); margin-top: 12px; }
#cf-form h3 { margin: 0; font-size: 16px; }
#cf-form label.check { align-self: start; min-height: 32px; }
.cf-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.tag-bad { background: #FDE8E5; color: var(--red); }
