:root {
  --bg: #f4f6f8; --panel: #fff; --ink: #17212b; --ink2: #4a5866; --ink3: #7b8794; --line: #e3e8ee; --line2: #eef1f4;
  --side: #0e1a24; --side2: #16242f; --sideink: #a9b8c5; --accent: #0f766e; --accent2: #0d9488; --accentbg: #e6f4f2;
  --ok: #15803d; --okbg: #e7f6ec; --warn: #b45309; --warnbg: #fdf3e1; --bad: #c0262d; --badbg: #fdecec;
  --info: #2563eb; --infobg: #e8effd; --mute: #6b7785; --mutebg: #eef1f4;
  --r: 8px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
h1 { font-size: 20px; margin: 0; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 600; }
h3 { font-size: 13px; margin: 14px 0 6px; font-weight: 600; color: var(--ink2); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--ink3); } .small { font-size: 12px; } .nowrap { white-space: nowrap; } .right { text-align: right; }
.grow { flex: 1; } .row { display: flex; gap: 10px; align-items: center; } .wrap { flex-wrap: wrap; } .col { display: flex; flex-direction: column; gap: 10px; }
.hidden { display: none !important; }

/* shell */
.shell { display: grid; grid-template-columns: 232px 1fr; height: 100vh; }
.side { background: var(--side); color: var(--sideink); display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px 14px; color: #fff; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent2); display: grid; place-items: center; }
.brand b { display: block; font-size: 15px; letter-spacing: .01em; } .brand span { font-size: 11px; color: var(--sideink); }
.brand.has-logo { flex-direction: column; align-items: flex-start; gap: 6px; }
.brand .logo-img { background: #fff; border-radius: 8px; padding: 8px 10px; width: 100%; display: flex; align-items: center; justify-content: center; }
.brand .logo-img img { max-height: 46px; max-width: 100%; object-fit: contain; }
.brand.has-logo > span { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #dce6ee; }
.login .brand .logo-img { background: transparent; padding: 0; justify-content: flex-start; }
.login .brand .logo-img img { max-height: 60px; }
.login .brand.has-logo > span { color: var(--ink3); }
.logo-prev { width: 170px; height: 56px; border: 1px dashed #cfd8e1; border-radius: 8px; display: grid; place-items: center; background: #fff; }
.logo-prev img { max-width: 150px; max-height: 44px; object-fit: contain; }
.site { margin: 0 12px 10px; padding: 8px 10px; background: var(--side2); border-radius: 6px; font-size: 12px; color: #dce6ee; }
.nav { padding: 4px 8px; }
.nav .grp { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6f8293; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--sideink); font-size: 13.5px; }
.nav a:hover { background: var(--side2); color: #fff; text-decoration: none; }
.nav a.on { background: #1d3442; color: #fff; }
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav .badge { margin-left: auto; background: var(--bad); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 600; }
.side .foot { margin-top: auto; padding: 12px 18px; font-size: 11.5px; color: #6f8293; }
.side .foot a { color: var(--sideink); }
.main { overflow-y: auto; }
.top { position: sticky; top: 0; z-index: 5; background: rgba(244,246,248,.92); backdrop-filter: blur(6px); padding: 16px 26px 12px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid transparent; }
.top .crumb { font-size: 12px; color: var(--ink3); margin-bottom: 2px; }
.content { padding: 6px 26px 40px; }
.demo-banner { background: #fff7e0; border-bottom: 1px solid #f2dfa6; color: #7a5a00; font-size: 12.5px; padding: 6px 26px; }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.panel > .ph { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line2); }
.panel > .ph h2 { margin: 0; }
.panel > .pb { padding: 14px 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); } .g6 { grid-template-columns: repeat(6, minmax(0,1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; }
@media (max-width: 1200px) { .g6 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .shell { grid-template-columns: 1fr; } .side { display: none; } .g2, .g3 { grid-template-columns: 1fr; } .span2, .span3 { grid-column: auto; } }

.kpi { padding: 14px 16px; cursor: default; }
.kpi .k { font-size: 12px; color: var(--ink3); display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--ink2); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
a.kpi:hover { text-decoration: none; border-color: #c8d3dd; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.d-up, .d-ok { background: var(--ok); } .d-trouble, .d-warning { background: #e59a1b; } .d-down, .d-critical { background: var(--bad); }
.d-pending, .d-unknown, .d-unmonitored { background: #b4bec8; } .d-info { background: var(--info); } .d-paused { background: #8a94a0; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 20px; font-size: 12px; font-weight: 550; white-space: nowrap; line-height: 20px; }
.p-up, .p-ok, .p-completed, .p-existing, .p-resolved { background: var(--okbg); color: var(--ok); }
.p-trouble, .p-warning, .p-new { background: var(--warnbg); color: var(--warn); }
.p-down, .p-critical, .p-failed, .p-missing { background: var(--badbg); color: var(--bad); }
.p-info, .p-running { background: var(--infobg); color: var(--info); }
.p-pending, .p-unknown, .p-unmonitored, .p-cancelled, .p-mute, .p-open { background: var(--mutebg); color: var(--mute); }
.p-paused { background: var(--mutebg); color: var(--mute); }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--mutebg); color: var(--ink2); font-size: 11.5px; line-height: 19px; margin: 1px 2px 1px 0; }
.tag.acc { background: var(--accentbg); color: var(--accent); }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #cfd8e1; background: #fff; color: var(--ink); padding: 6px 12px; border-radius: 6px; font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f6f8fa; text-decoration: none; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; } .btn.pri:hover { background: #0b625b; }
.btn.danger { color: var(--bad); } .btn.danger:hover { background: var(--badbg); }
.btn.sm { padding: 3px 9px; font-size: 12px; } .btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 15px; height: 15px; }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=url], input[type=date], select, textarea {
  font: inherit; font-size: 13.5px; padding: 7px 10px; border: 1px solid #cfd8e1; border-radius: 6px; background: #fff; color: var(--ink); width: 100%; }
textarea { font-family: var(--mono); font-size: 12.5px; min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #99d5cf; border-color: var(--accent2); }
label.f { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink2); margin-bottom: 12px; }
label.f > span.h { display: block; font-weight: 400; color: var(--ink3); font-size: 11.5px; margin-top: 3px; }
label.f input, label.f select, label.f textarea { margin-top: 4px; }
label.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin-bottom: 10px; cursor: pointer; }
label.chk input { margin-top: 3px; }
.search { position: relative; } .search input { padding-left: 30px; width: 240px; }
.search svg { position: absolute; left: 9px; top: 8px; width: 15px; height: 15px; color: var(--ink3); }
.seg { display: inline-flex; border: 1px solid #cfd8e1; border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 5px 11px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--ink2); border-right: 1px solid #e3e8ee; }
.seg button:last-child { border-right: 0; } .seg button.on { background: var(--accentbg); color: var(--accent); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid #d6dee6; background: #fff; border-radius: 16px; padding: 2px 10px; font-size: 12.5px; cursor: pointer; color: var(--ink2); display: inline-flex; gap: 6px; align-items: center; }
.chip b { font-weight: 600; color: var(--ink); } .chip.on { background: var(--accentbg); border-color: #9fd3cc; color: var(--accent); }

/* tables */
.tw { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; font-size: 11.5px; color: var(--ink3); text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfc; position: sticky; top: 0; }
table.t th.sort { cursor: pointer; } table.t th.sort:hover { color: var(--ink); }
table.t td { padding: 8px 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: #f8fafb; }
table.t tr.sel td { background: #f0f8f7; }
table.t td.cb, table.t th.cb { width: 34px; padding-right: 0; }
.empty { padding: 34px; text-align: center; color: var(--ink3); }
.devname { display: flex; align-items: center; gap: 9px; }
.ic { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.ic svg { width: 16px; height: 16px; }
.bar { height: 6px; background: #edf0f3; border-radius: 4px; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--accent2); }
.bar.w > i { background: #e59a1b; } .bar.c > i { background: var(--bad); }

/* bulk bar */
.bulk { position: sticky; bottom: 16px; margin-top: 12px; background: var(--ink); color: #fff; border-radius: 8px; padding: 9px 14px; display: flex; gap: 10px; align-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.bulk .btn { background: #26333f; border-color: #3a4855; color: #fff; } .bulk .btn:hover { background: #33424f; }
.bulk .btn.pri { background: var(--accent2); border-color: var(--accent2); }

/* modal / drawer */
.ov { position: fixed; inset: 0; background: rgba(15,23,32,.45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 620px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 860px; }
.modal .mh { padding: 16px 20px; border-bottom: 1px solid var(--line2); display: flex; align-items: center; }
.modal .mh h2 { margin: 0; flex: 1; font-size: 16px; }
.modal .mb { padding: 18px 20px; } .modal .mf { padding: 12px 20px; border-top: 1px solid var(--line2); display: flex; gap: 8px; justify-content: flex-end; background: #fafbfc; border-radius: 0 0 10px 10px; }
.x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink3); padding: 0 4px; }

#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 99; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 380px; animation: tin .2s ease; }
.toast.err { background: var(--bad); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 9px 14px; color: var(--ink2); font-weight: 550; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tabs a:hover { color: var(--ink); text-decoration: none; } .tabs a.on { color: var(--accent); border-color: var(--accent); }

/* key-value */
dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
dl.kv dt { color: var(--ink3); } dl.kv dd { margin: 0; word-break: break-word; }

/* progress */
.prog { height: 8px; background: #e6ebf0; border-radius: 6px; overflow: hidden; }
.prog > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), #14b8a6); transition: width .5s; }
.prog.run > i { background-size: 30px 30px; background-image: linear-gradient(45deg, rgba(255,255,255,.25) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.25) 50%, rgba(255,255,255,.25) 75%, transparent 75%), linear-gradient(90deg, var(--accent2), #14b8a6); animation: stripes 1s linear infinite; }
@keyframes stripes { to { background-position: 30px 0, 0 0; } }
pre.log { background: #0f1a23; color: #b9c8d4; border-radius: 8px; padding: 12px 14px; font-family: var(--mono); font-size: 12px; max-height: 280px; overflow: auto; margin: 0; white-space: pre-wrap; }

/* list rows */
.li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line2); }
.li:last-child { border-bottom: 0; }
.li .t1 { font-weight: 550; } .li .t2 { font-size: 12px; color: var(--ink3); }

/* profile cards */
.card { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.card .ttl { font-weight: 600; font-size: 15px; }

/* topology */
.topo { position: relative; height: calc(100vh - 140px); min-height: 480px; overflow: hidden; background:
  radial-gradient(circle, #dfe5ea 1px, transparent 1px) 0 0 / 22px 22px, #fbfcfd; }
#tsvg { width: 100%; height: 100%; cursor: grab; user-select: none; display: block; }
#tsvg.drag { cursor: grabbing; }
#vp.far .node.ep text { display: none; }
#vp .node:hover text { display: block !important; font-weight: 600; }
.topo .node text { font-size: 11px; fill: var(--ink); paint-order: stroke; stroke: #fbfcfd; stroke-width: 3px; }
.topo .node.dim, .topo .edge.dim { opacity: .15; }
.topo .tbar { position: absolute; left: 14px; top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.topo .legend { position: absolute; left: 14px; bottom: 14px; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 11.5px; display: flex; gap: 12px; flex-wrap: wrap; max-width: 70%; }
.topo .info { position: absolute; right: 14px; top: 14px; width: 290px; max-height: calc(100% - 28px); overflow: auto; }

/* check editor */
.chkrow { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; background: #fff; }
.chkrow .crh { display: flex; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer; }
.chkrow .crb { border-top: 1px solid var(--line2); padding: 14px 14px 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.chkrow.off .crh { opacity: .55; }
.menu { position: absolute; z-index: 40; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.15); padding: 6px; width: 300px; max-height: 420px; overflow: auto; }
.menu .mg { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); padding: 8px 8px 4px; }
.menu a { display: flex; justify-content: space-between; padding: 6px 8px; border-radius: 5px; color: var(--ink); font-size: 13px; }
.menu a:hover { background: var(--accentbg); text-decoration: none; }
.osb { font-size: 10.5px; color: var(--ink3); }

.cmd { position: relative; background: #0f1a23; color: #d7e3ec; font-family: var(--mono); font-size: 12px; border-radius: 8px; padding: 12px 70px 12px 14px; white-space: pre-wrap; word-break: break-all; }
.cmd .btn { position: absolute; right: 8px; top: 8px; }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 70px; padding: 30px; background: linear-gradient(160deg, #0e1a24 0%, #133241 100%); }
.login .box { background: #fff; border-radius: 12px; width: 380px; padding: 28px; box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.login .brand { padding: 0 0 18px; color: var(--ink); } .login .brand span { color: var(--ink3); }

.chart { width: 100%; height: 170px; display: block; }
.chart text { font-size: 10.5px; fill: var(--ink3); }
.spark { width: 90px; height: 22px; }

/* report */
.report { max-width: 980px; margin: 0 auto; background: #fff; padding: 36px 44px; border: 1px solid var(--line); border-radius: 8px; }
.report h1 { font-size: 24px; } .report h2 { margin-top: 26px; font-size: 16px; border-bottom: 2px solid var(--accent); padding-bottom: 4px; }
@media print {
  .side, .top, .demo-banner, .noprint { display: none !important; }
  .shell { display: block; height: auto; } .main { overflow: visible; } body { background: #fff; }
  .content { padding: 0; } .report { border: 0; padding: 0; max-width: none; }
  table.t th { position: static; }
}

.login-hero { display: flex; align-items: center; gap: 36px; max-width: 520px; color: #dce6ee; }
.login-hero img { height: 340px; flex: none; filter: drop-shadow(0 18px 30px rgba(0,0,0,.35)); }
.login-hero .lh1 { font-size: 26px; font-weight: 650; color: #fff; line-height: 1.2; letter-spacing: -.01em; }
.login-hero .lh2 { margin-top: 10px; font-size: 14.5px; color: #a9b8c5; }
@media (max-width: 980px) { .login-hero { display: none; } }

.site.cust { padding: 8px 10px 10px; }
.site.cust select { margin-top: 4px; background: #1d2c38; color: #fff; border-color: #2c3e4c; font-size: 13px; padding: 6px 8px; }
.step { padding: 12px 0; border-top: 1px solid var(--line2); }
.step .sn { font-weight: 700; font-size: 12.5px; margin-bottom: 6px; }
.keybox { margin-top: 8px; display: flex; align-items: center; gap: 10px; border: 1px solid #cfd8e1; border-radius: 6px; padding: 8px 8px 8px 14px; background: #fafbfc; }
.keybox .mono { flex: 1; text-align: center; font-size: 14px; letter-spacing: .02em; }
.plat { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; color: var(--ink2); font: inherit; font-size: 13.5px; }
.plat span { width: 58px; height: 58px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; background: #fff; box-shadow: var(--shadow); }
.plat span svg { width: 28px; height: 28px; }
.plat.on { color: var(--info); } .plat.on span { border-color: var(--info); color: var(--info); }
.p-queued { background: var(--infobg); color: var(--info); }
a.pill { text-decoration: none; }

.wiz { display: flex; align-items: center; max-width: 980px; margin: 4px auto 22px; font-size: 13.5px; color: var(--ink2); }
.wiz .ws { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.wiz .ws span { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #c3ccd5; background: #fff; }
.wiz .ws.on { color: var(--ink); font-weight: 600; } .wiz .ws.on span { border-color: var(--ok); }
.wiz .ws.done span { background: var(--ok); border-color: var(--ok); }
.wiz .wl { flex: 1; height: 2px; background: var(--line); margin: 0 14px; }
table.ctab td { padding: 6px 4px; } table.ctab input, table.ctab select { padding: 5px 6px; font-size: 12.5px; }

.stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #edf0f3; margin-bottom: 10px; }
.stack i { display: block; height: 100%; }
.chain { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; row-gap: 10px; }
.chain .cn { border: 1px solid var(--line); border-left: 4px solid #b4bec8; border-radius: 8px; padding: 9px 12px; min-width: 170px; background: #fff; }
.chain .cn.ok { border-left-color: var(--ok); } .chain .cn.bad { border-left-color: var(--bad); background: #fffafa; } .chain .cn.warn { border-left-color: #e59a1b; }
.chain .cnl { font-weight: 600; font-size: 13px; }
.chain .arr { width: 34px; align-self: center; height: 2px; background: #b4bec8; position: relative; margin: 0 4px; }
.chain .arr:after { content: ''; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 7px solid #b4bec8; border-right: 0; }

.score { display: inline-block; font-weight: 700; font-size: 12.5px; padding: 2px 8px; border-radius: 10px; }
.score.ok { background: #e3f6ec; color: #137a46; } .score.warn { background: #fdf1dc; color: #a15c07; } .score.bad { background: #fde6e6; color: #b42318; }
.seg { display: flex; gap: 4px; flex-wrap: wrap; } .seg button { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 4px 11px; font-size: 12.5px; cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; border-color: var(--accent); } .seg button.on .muted { color: #e0f2f1; }
