/* Webcafe Heartbeat. Webcafe navy/cyan chrome; chart and status colours from the
   data-viz reference palette (series blue, fixed status good/warning/critical). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/inter-var.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --page: #f4f5f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6f6d68;
  --line: #e4e3df;
  --navy: #0e1b38;
  --cyan: #00b2fe;
  --link: #0a6fb8;
  --series: #2a78d6;
  --good: #0ca30c;
  --good-ink: #006300;
  --warn: #fab219;
  --warn-ink: #8a5a00;
  --bad: #d03b3b;
  --bad-ink: #b02a2a;
  --none: #dedcd6;
  --info-bg: #e8f4fd;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #9a988f; --line: #2f2e2b;
    --link: #5bb8ff; --series: #3987e5; --good-ink: #4fd14f; --warn-ink: #fab219; --bad-ink: #f07070; --none: #3a3936;
    --info-bg: #13283a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #9a988f; --line: #2f2e2b;
  --link: #5bb8ff; --series: #3987e5; --good-ink: #4fd14f; --warn-ink: #fab219; --bad-ink: #f07070; --none: #3a3936;
  --info-bg: #13283a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
h3 { font-size: 1rem; margin: 0 0 .25rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
code, pre { font-family: ui-monospace, Consolas, monospace; font-size: .85em; }
pre { background: var(--page); border: 1px solid var(--line); padding: .6rem .8rem; border-radius: 6px; overflow-x: auto; user-select: all; }
.small { font-size: .85rem; }
.muted { color: var(--muted); }
.pre { white-space: pre-line; }
.warn-text { color: var(--warn-ink); }
.danger-text { color: var(--bad-ink); }
[hidden] { display: none !important; }

/* chrome */
.top { background: var(--navy); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: .55rem 16px; gap: 1rem; flex-wrap: wrap; }
.top .brand { color: #fff; display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.05rem; }
.top .brand:hover { text-decoration: none; }
.top .tag { font-size: .7rem; font-weight: 600; background: var(--cyan); color: var(--navy); padding: .05rem .45rem; border-radius: 99px; }
.top nav { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.top nav a, .top nav .link { color: #dfe6f3; }
.page { max-width: 1200px; margin: 0 auto; padding: 1.25rem 16px 3rem; }
.crumbs { margin: 0 0 .25rem; font-size: .85rem; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.section-title { margin-top: 1.5rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; margin: 0 0 1rem; }
.card.narrow { max-width: 760px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 860px) { .two, .charts { grid-template-columns: 1fr; } }

.flash { padding: .6rem .8rem; border-radius: 8px; margin: 0 0 1rem; border: 1px solid var(--line); background: var(--surface); }
.flash.ok { border-color: var(--good); }
.flash.error { border-color: var(--bad); color: var(--bad-ink); }
.flash.info { background: var(--info-bg); border-color: transparent; }

/* status: always icon + label, never colour alone */
.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 600; padding: .1rem .55rem; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); white-space: nowrap; }
.pill .ico { font-size: .7rem; }
.pill.up .ico { color: var(--good); }
.pill.down { border-color: var(--bad); color: var(--bad-ink); }
.pill.down .ico { color: var(--bad); }
.pill.paused, .pill.unknown { color: var(--muted); }

.summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.hero { display: flex; align-items: center; gap: .7rem; font-size: 1.35rem; }
.hero .ico { font-size: 1.2rem; color: var(--muted); }
.hero.good .ico { color: var(--good); }
.hero.bad .ico { color: var(--bad); }
.sysinfo { list-style: none; margin: 0; padding: 0; display: flex; gap: .4rem 1.2rem; flex-wrap: wrap; }
.alert-card { border-color: var(--bad); }
.incidents { list-style: none; margin: 0; padding: 0; }
.incidents li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.incidents li:last-child { border-bottom: 0; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.muted td { color: var(--muted); }
.strip-col { min-width: 220px; }
table.compact td { padding: .3rem .6rem; vertical-align: middle; white-space: nowrap; }
table.compact th { padding: .3rem .6rem; }
table.compact .pill { padding-top: 0; padding-bottom: 0; }
table.compact .strip { height: 16px; }
@media (max-width: 700px) { .strip-col { display: none; } }
@media (max-width: 560px) { .hide-sm { display: none; } }

/* daily uptime strip */
.strip { display: flex; gap: 2px; align-items: stretch; height: 26px; }
.strip .cell { flex: 1; min-width: 3px; border-radius: 2px; }
.cell { display: inline-block; }
.legend .cell { width: 10px; height: 10px; border-radius: 2px; margin: 0 .2rem 0 .6rem; vertical-align: -1px; }
.legend .cell:first-child { margin-left: 0; }
.cell.good { background: var(--good); }
.cell.warn { background: var(--warn); }
.cell.bad { background: var(--bad); }
.cell.none { background: var(--none); }

/* hosts */
.hosts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 1rem; }
.host-card { color: var(--ink); display: block; }
.host-card:hover { text-decoration: none; border-color: var(--series); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .8rem; margin: .7rem 0 0; }
.stats.wide { margin: 1rem 0; }
.stats div { display: flex; flex-direction: column; }
.stats dt { font-size: .78rem; color: var(--muted); }
.stats dd { margin: 0; font-size: 1.4rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.2rem; margin: 0 0 .8rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: Inter, system-ui, sans-serif; }
.chart .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--series); opacity: .1; }
.chart .dot { fill: var(--series); }
.chart .cross { stroke: var(--muted); stroke-width: 1; }
.chart .hover-dot { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: crosshair; }
.empty-chart { padding: 2rem 0; text-align: center; }
.tooltip { position: fixed; z-index: 10; pointer-events: none; background: var(--navy); color: #fff; font-size: .8rem; padding: .3rem .55rem; border-radius: 6px; white-space: nowrap; }
.tooltip b { font-variant-numeric: tabular-nums; }
.ranges { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.ranges a { padding: .3rem .7rem; color: var(--ink-2); font-size: .85rem; }
.ranges a + a { border-left: 1px solid var(--line); }
.ranges a[aria-current] { background: var(--navy); color: #fff; }
.ranges a:hover { text-decoration: none; }

/* forms */
label { display: block; font-weight: 600; font-size: .85rem; margin: .7rem 0 .25rem; }
label.check { font-weight: 400; display: flex; align-items: center; gap: .4rem; }
input[type=text], input[type=email], input[type=url], input[type=password], input[type=number], input[type=date], select {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 7px; background: var(--page); color: var(--ink); font: inherit; }
input:focus, select:focus { outline: 2px solid var(--series); outline-offset: 0; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.thresholds { display: grid; grid-template-columns: 1fr 110px; gap: .2rem 1rem; align-items: center; max-width: 640px; }
.thresholds label { margin: .2rem 0; font-weight: 400; }
.actions { margin: 1rem 0; display: flex; gap: 1rem; align-items: center; }
.btn { display: inline-block; background: var(--navy); color: #fff; border: 0; border-radius: 8px; padding: .55rem 1rem; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(1.2); }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); }
button.link { background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; }
form.inline { display: inline; }
.inline-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
.danger-zone { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.row-form { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; margin-top: 1rem; }
.row-form label { width: 100%; margin-bottom: 0; }
.row-form input { max-width: 260px; }
.token { border-color: var(--cyan); }
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin: .5rem 0 1rem; flex-wrap: wrap; }
.tabs a { padding: .45rem .8rem; color: var(--ink-2); border-bottom: 2px solid transparent; }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--series); font-weight: 600; }
.tabs a:hover { text-decoration: none; }
.steps { padding-left: 1.2rem; }
.steps li { margin: .25rem 0; }

/* sign-in */
main.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem 16px; }
.login-card { width: 100%; max-width: 420px; text-align: center; padding: 2rem 1.5rem; }
.login-card.wide { max-width: 760px; text-align: left; }
.login-card .logo { height: 48px; width: auto; margin-bottom: .8rem; }
.login-card .btn { margin-top: .5rem; }
.login-card .dev { margin-top: 1.5rem; text-align: left; border-top: 1px solid var(--line); padding-top: 1rem; }
.login-card .dev .btn { margin-top: .6rem; }
