/* Harbinger portal */
:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --surface: #fcfcfb;
  --ink: #18201c;
  --ink-2: #52514e;
  --line: #dddcd6;
  --accent: #0f6b5c;
  --accent-ink: #ffffff;
  --accent-soft: #e2f0ec;
  --danger: #b3261e;
  --good: #1a7f37;
  --warn: #9a6700;
  --bad: #b3261e;
  --series-1: #2a78d6;
  --grid: #e6e5df;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121413;
    --surface: #1a1a19;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --line: #34332f;
    --accent: #4fb3a0;
    --accent-ink: #0b1311;
    --accent-soft: #1d302b;
    --danger: #f2817a;
    --good: #57c46f;
    --warn: #e0b04f;
    --bad: #f2817a;
    --series-1: #3987e5;
    --grid: #2b2a27;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0.2rem 0 0.8rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 0.6rem; }
h2.inline { display: inline; }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--accent-soft); padding: 0.1em 0.35em; border-radius: 4px; }
code.secret { cursor: copy; font-weight: 600; user-select: all; }
code.secret.copied::after { content: " copied"; font-weight: 400; color: var(--good); }
.meta, .hint { color: var(--ink-2); font-size: 0.88rem; font-weight: 400; }
.lead { color: var(--ink-2); max-width: 60rem; margin-top: 0; }

/* layout */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.6rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.top nav { display: flex; gap: 0.25rem 1rem; flex-wrap: wrap; }
.top nav a { color: var(--ink); text-decoration: none; font-size: 0.92rem; }
.top nav a:hover { color: var(--accent); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-weight: 650; }
.brand.big { font-size: 1.35rem; margin-bottom: 0.25rem; }
.tile { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 6px; background: var(--accent);
  color: var(--accent-ink); font-weight: 700; font-size: 0.95rem; letter-spacing: -0.02em; }
.tile.lg { width: 3rem; height: 3rem; font-size: 1.2rem; }
.page { max-width: 1160px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.centered { min-height: 100vh; display: grid; place-items: center; }
.login { width: 100%; max-width: 400px; padding: 1rem; }
.banner { padding: 0.55rem 1.25rem; font-size: 0.92rem; }
.banner.warn { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); border-bottom: 1px solid var(--line); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card.narrow { max-width: 30rem; }
.card.empty { text-align: center; padding: 2rem; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.two > .card { margin-bottom: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.scroll { overflow-x: auto; }
.span { grid-column: 1 / -1; }

/* forms */
label { display: block; margin: 0 0 0.8rem; font-size: 0.9rem; font-weight: 550; }
input:not([type=checkbox]), select { display: block; width: 100%; margin-top: 0.3rem; padding: 0.55rem 0.65rem; font: inherit;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; }
input:focus, select:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label.check { display: flex; gap: 0.5rem; align-items: center; font-weight: 450; }
label.check select { display: inline-block; width: auto; margin: 0 0 0 0.25rem; padding: 0.25rem 0.4rem; }
input.short { min-width: 9rem; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.9rem 0.2rem; margin: 0 0 0.8rem; }
legend { font-size: 0.9rem; font-weight: 600; padding: 0 0.3rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1rem; margin-top: 1rem; }
.stack { max-width: 28rem; }
.inline-form { display: inline-flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form input, .inline-form select { width: auto; margin: 0; padding: 0.35rem 0.5rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.filters { margin-bottom: 0.8rem; }
.filters select { display: inline-block; width: auto; margin-left: 0.4rem; }
details > summary { cursor: pointer; }
details.card > summary { list-style-position: inside; }
.login-card .sub { color: var(--ink-2); margin: 0 0 1.2rem; font-size: 0.92rem; }

/* buttons */
.btn { display: inline-block; padding: 0.5rem 0.95rem; font: inherit; font-weight: 600; font-size: 0.92rem; cursor: pointer;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.btn.block { width: 100%; padding: 0.65rem; margin-top: 0.3rem; }
.btn.small { padding: 0.32rem 0.65rem; font-size: 0.85rem; }

/* messages and pills */
.flash { padding: 0.6rem 0.85rem; border-radius: 8px; margin-bottom: 0.9rem; border: 1px solid var(--line); background: var(--surface); }
.flash.ok { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); background: color-mix(in srgb, var(--good) 9%, var(--surface)); }
.flash.error { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad) 9%, var(--surface)); }
.pill { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--line); }
.pill.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.pill.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); white-space: normal; }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.pill.muted { color: var(--ink-2); }

/* containers */
.container-card { display: flex; flex-direction: column; gap: 0.45rem; align-items: flex-start; text-decoration: none; color: var(--ink);
  transition: border-color 0.15s; }
.container-card:hover { border-color: var(--accent); }
.container-card .cname { font-size: 1.15rem; font-weight: 650; }
.container-card .btn { margin-top: 0.4rem; }
.container-row .head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }

/* dashboard */
.status-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  border-left: 5px solid var(--good); }
.status-card.is-down { border-left-color: var(--warn); }
.status-card .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.status-card .actions form { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; display: flex; flex-direction: column; }
.kpi .v { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .k { font-weight: 600; font-size: 0.9rem; }
.kpi .s { color: var(--ink-2); font-size: 0.82rem; }
.kpi.attention { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--ink-2); stroke-width: 1; }
.chart .tick { fill: var(--ink-2); font-size: 11px; font-family: inherit; }
.chart .bar { fill: var(--series-1); }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: color-mix(in srgb, var(--series-1) 10%, transparent); }
.table-view { margin-top: 0.4rem; font-size: 0.9rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0.8rem 0 0; font-size: 0.92rem; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; }
meter { display: block; width: 100%; max-width: 18rem; height: 0.6rem; margin-top: 0.25rem; }

/* tables */
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 0.82rem; border-bottom: 1px solid var(--line); padding: 0.45rem 0.6rem; }
table.data td { border-bottom: 1px solid var(--line); padding: 0.5rem 0.6rem; vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data.compact td { padding: 0.3rem 0.5rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

@media (max-width: 640px) {
  .top { padding: 0.6rem 1rem; }
  h1 { font-size: 1.35rem; }
}
