/* Uptime Monitor — glass theme (matches the WPF glass skin: deep navy backdrop,
   frosted translucent panels, hairline light borders, cyan accent) */
:root {
  --bg-0: #070b1d;
  --bg-1: #0e1530;
  --bg-2: #161a44;
  --glass: rgba(255, 255, 255, 0.065);
  --glass-hi: rgba(255, 255, 255, 0.11);
  --glass-input: rgba(8, 12, 32, 0.45);
  --border: rgba(255, 255, 255, 0.14);
  --border-hi: rgba(255, 255, 255, 0.26);
  --text: #e9eefc;
  --text-2: #b4bdd9;
  --muted: #8892b4;
  --accent: #5cc8ff;
  --accent-2: #3b82f6;
  --up: #34d399;
  --down: #f87171;
  --warn: #fbbf24;
  --paused: #94a3b8;
  --nodata: rgba(255, 255, 255, 0.10);
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.10);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg-0); }
body { margin: 0; min-height: 100vh; font: 14.5px/1.5 var(--font); color: var(--text); background: transparent; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(1200px 800px at 85% -10%, #1d2a6b 0%, transparent 60%),
              radial-gradient(900px 700px at -10% 110%, #123a52 0%, transparent 55%),
              linear-gradient(160deg, var(--bg-1), var(--bg-0) 55%, var(--bg-2));
}
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .45; }
.bg-orbs span:nth-child(1) { width: 520px; height: 520px; background: #2563eb; top: -160px; left: 18%; opacity: .28; }
.bg-orbs span:nth-child(2) { width: 460px; height: 460px; background: #7c3aed; bottom: -180px; right: 6%; opacity: .26; }
.bg-orbs span:nth-child(3) { width: 360px; height: 360px; background: #06b6d4; top: 40%; left: -120px; opacity: .20; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 24px; }
h2 { font-size: 16px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }
.small { font-size: 12.5px; }

/* ---------- glass surface ---------- */
.glass {
  background: linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.035));
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { padding: 20px 22px; }
.card + .card, .card + .grid, .grid + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 16px 40px; }
.topbar {
  position: sticky; top: 10px; z-index: 20; max-width: 1180px; margin: 10px auto 0; width: calc(100% - 32px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px 10px 18px; border-radius: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 16px; }
.brand svg { color: var(--accent); filter: drop-shadow(0 0 6px rgba(92,200,255,.6)); }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { color: var(--text-2); padding: 7px 11px; border-radius: 10px; border: 1px solid transparent; }
.topbar nav a:hover { background: var(--glass-hi); color: var(--text); text-decoration: none; }
.topbar nav a.on { background: rgba(92,200,255,.14); border-color: rgba(92,200,255,.35); color: #fff; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 10px 0 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid.tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 0 16px 28px; }

/* ---------- tiles ---------- */
.tile { padding: 16px 18px; }
.tile .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.tile .value { font-size: 28px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .sub { color: var(--text-2); font-size: 12.5px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer;
  font: 500 14px var(--font); color: var(--text); padding: 9px 16px; border-radius: 11px;
  background: var(--glass-hi); border: 1px solid var(--border-hi); transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: rgba(255,255,255,.18); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, #5cc8ff, #3b82f6); border-color: rgba(255,255,255,.35); color: #04122b; font-weight: 600;
  box-shadow: 0 6px 22px rgba(59,130,246,.35), inset 0 1px 0 rgba(255,255,255,.4); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: rgba(248,113,113,.14); border-color: rgba(248,113,113,.45); color: #fecaca; }
.btn.danger:hover { background: rgba(248,113,113,.24); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.field { margin-bottom: 16px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=url], input[type=datetime-local], select, textarea {
  width: 100%; font: 14px var(--font); color: var(--text); background: var(--glass-input);
  border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 70px; resize: vertical; }
select option { background: #121836; color: var(--text); }
input:focus, select:focus, textarea:focus { border-color: rgba(92,200,255,.7); box-shadow: 0 0 0 3px rgba(92,200,255,.18); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
.check { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 400; cursor: pointer; margin: 0; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.checks { display: flex; gap: 22px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--glass-input); border: 1px solid var(--border); border-radius: 12px; flex-wrap: wrap; }
.seg button, .seg label { margin: 0; font: 500 13px var(--font); color: var(--text-2); background: transparent; border: 0; padding: 7px 13px; border-radius: 9px; cursor: pointer; }
.seg button.on, .seg input:checked + span { background: rgba(92,200,255,.18); color: #fff; box-shadow: inset 0 0 0 1px rgba(92,200,255,.45); }
.seg label { padding: 0; }
.seg label span { display: block; padding: 7px 13px; border-radius: 9px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }

/* ---------- flash ---------- */
.flash { padding: 12px 16px; margin-bottom: 14px; border-left: 4px solid var(--up); border-radius: 12px; }
.flash.err { border-left-color: var(--down); }
.flash.warn { border-left-color: var(--warn); }

/* ---------- status ---------- */
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; background: var(--paused); }
.dot.up { background: var(--up); box-shadow: 0 0 0 3px rgba(52,211,153,.18), 0 0 12px rgba(52,211,153,.7); }
.dot.down { background: var(--down); box-shadow: 0 0 12px rgba(248,113,113,.8); animation: pulse 1.4s infinite; }
.dot.warn { background: var(--warn); box-shadow: 0 0 10px rgba(251,191,36,.7); }
.dot.pending { background: var(--accent); opacity: .7; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(248,113,113,.7); } 70% { box-shadow: 0 0 0 9px rgba(248,113,113,0); } 100% { box-shadow: 0 0 0 0 rgba(248,113,113,0); } }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: rgba(255,255,255,.07); border: 1px solid var(--border); white-space: nowrap; }
.pill.up { color: #a7f3d0; border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.10); }
.pill.down { color: #fecaca; border-color: rgba(248,113,113,.5); background: rgba(248,113,113,.13); }
.pill.warn { color: #fde68a; border-color: rgba(251,191,36,.45); background: rgba(251,191,36,.10); }
.pill.paused, .pill.pending { color: var(--text-2); }
.badge { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2);
  padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,.07); border: 1px solid var(--border); }

/* ---------- monitor list ---------- */
.mon-list { padding: 6px; }
.mon {
  display: grid; grid-template-columns: 110px minmax(180px, 1.6fr) 1.3fr 90px 100px 70px; align-items: center; gap: 14px;
  padding: 13px 14px; border-radius: 13px; color: var(--text); border: 1px solid transparent;
}
.mon + .mon { border-top-color: rgba(255,255,255,.06); }
.mon:hover { background: rgba(255,255,255,.06); border-color: var(--border); text-decoration: none; }
.mon.head { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; padding-top: 8px; padding-bottom: 8px; }
.mon.head:hover { background: none; border-color: transparent; }
.mon .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon .target { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon .num { font-variant-numeric: tabular-nums; text-align: right; }
.beats { display: flex; gap: 2px; height: 26px; align-items: stretch; }
.beats i { flex: 1; min-width: 3px; max-width: 7px; border-radius: 2px; background: var(--nodata); }
.beats i.u { background: var(--up); opacity: .85; }
.beats i.d { background: var(--down); }
.empty { text-align: center; padding: 50px 20px; }
.empty p { color: var(--muted); }

/* ---------- monitor detail ---------- */
.detail-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.detail-head .title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-head .meta { color: var(--muted); margin-top: 6px; font-size: 13px; }
.range-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.custom-range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.custom-range input { width: auto; padding: 7px 10px; font-size: 13px; }
.chart-box { position: relative; height: 240px; }
.chart-box.short { height: 200px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.range-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 14px; }
.range-summary div { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 10px 14px; }
.range-summary b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.range-summary span { font-size: 12px; color: var(--muted); }
.zoom-hint { font-size: 12px; color: var(--muted); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.nowrap { white-space: nowrap; }
.ok-text { color: #a7f3d0; } .err-text { color: #fecaca; }

/* ---------- login / install ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; }
.auth .card { width: 100%; max-width: 420px; padding: 30px 28px; }
.auth .card.wide { max-width: 620px; }
.auth .brand { justify-content: center; margin-bottom: 6px; font-size: 20px; }
.auth h1 { text-align: center; font-size: 15px; font-weight: 400; color: var(--muted); margin-bottom: 22px; }
pre.code { background: var(--glass-input); border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; overflow-x: auto; font: 12.5px/1.5 var(--mono); color: #cfe9ff; white-space: pre-wrap; word-break: break-all; margin: 6px 0 0; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }
.test-result { margin-top: 12px; padding: 10px 14px; border-radius: 11px; font-size: 13.5px; display: none; }
.test-result.ok { display: block; background: rgba(52,211,153,.10); border: 1px solid rgba(52,211,153,.4); }
.test-result.bad { display: block; background: rgba(248,113,113,.10); border: 1px solid rgba(248,113,113,.45); }
.hidden { display: none !important; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .mon { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .mon.head { display: none; }
  .mon > :nth-child(1) { grid-column: 2; grid-row: 1; justify-self: end; }
  .mon > :nth-child(2) { grid-column: 1; grid-row: 1 / span 2; }
  .mon > :nth-child(3) { grid-column: 1 / -1; }
  .mon > :nth-child(4), .mon > :nth-child(5) { display: none; }
  .mon > :nth-child(6) { grid-column: 2; grid-row: 2; }
  .topbar { flex-direction: column; align-items: stretch; position: static; }
  .topbar nav { justify-content: space-between; }
  .chart-box { height: 210px; }
}
@media (prefers-reduced-motion: reduce) { .dot.down { animation: none; } }
.mon.link { cursor: pointer; }
