/* Vigilance admin — the licence server console.
   Self-hosted, no CDN: a security product's own operations surface should not
   have a third-party origin in its critical path. */

:root {
    color-scheme: dark;
    --bg: #0e1116;
    --panel: #161b22;
    --panel-edge: #232b36;
    --text: #e6edf3;
    --muted: #8b98a6;
    --accent: #4f9cf9;
    --ok: #3fb950;
    --bad: #f85149;
    --warn: #d29922;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 20px; }

.masthead { border-bottom: 1px solid var(--panel-edge); background: var(--panel); }
.masthead .wrap { display: flex; align-items: center; gap: 12px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark {
    width: 14px; height: 14px; border-radius: 3px;
    background: linear-gradient(135deg, var(--accent), #7ee0c0);
}
.brand-name { font-weight: 650; letter-spacing: -0.01em; }
.brand-org { margin-left: auto; color: var(--muted); font-size: 13px; }

main.wrap { padding-top: 36px; padding-bottom: 48px; }

h1 { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; margin: 0 0 6px; }
h2 { font-size: 15px; font-weight: 650; margin: 32px 0 12px; color: var(--muted);
     text-transform: uppercase; letter-spacing: 0.06em; }
p { margin: 0 0 14px; }
.lede { color: var(--muted); margin-bottom: 28px; }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }

.panel { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px; overflow: hidden; }

.check { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border-top: 1px solid var(--panel-edge); }
.check:first-child { border-top: 0; }
.check-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 9px; }
.check-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(63,185,80,.15); }
.check-dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(248,81,73,.15); }
.check-body { min-width: 0; flex: 1; }
.check-name { font-weight: 600; }
.check-detail { color: var(--muted); font-family: var(--mono); font-size: 12.5px; word-break: break-word; }
.check-remedy { color: var(--warn); font-size: 13px; margin-top: 4px; }

.status-line { display: flex; align-items: center; gap: 10px; margin-bottom: 28px;
               font-size: 14px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px;
        border: 1px solid var(--panel-edge); background: var(--panel); font-size: 13px; }
.pill.ok { color: var(--ok); }
.pill.bad { color: var(--bad); }

.endpoints { border-collapse: collapse; width: 100%; }
.endpoints th, .endpoints td { text-align: left; padding: 10px 18px; border-top: 1px solid var(--panel-edge); vertical-align: top; }
.endpoints th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase;
                letter-spacing: 0.06em; border-top: 0; }
.endpoints td:first-child { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.endpoints td.desc { color: var(--muted); font-size: 13.5px; white-space: normal; }
.verb { color: var(--accent); }

.note { border-left: 2px solid var(--panel-edge); padding-left: 16px; color: var(--muted); font-size: 13.5px; }

.footer { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 20px; padding-bottom: 40px;
          border-top: 1px solid var(--panel-edge); color: var(--muted); font-size: 13px; }
.sep { opacity: .5; }

.center { text-align: center; padding: 60px 0; }
.center .code { font-size: 56px; font-weight: 700; letter-spacing: -0.03em; color: var(--muted); opacity: .5; line-height: 1; }
.center h1 { margin-top: 10px; }
.btn { display: inline-block; margin-top: 18px; padding: 8px 16px; border-radius: 7px;
       background: var(--accent); color: #071018; text-decoration: none; font-weight: 600; font-size: 14px; }

pre.trace { background: #0b0e13; border: 1px solid var(--panel-edge); border-radius: 8px; padding: 14px;
            text-align: left; overflow-x: auto; color: var(--muted); white-space: pre-wrap; word-break: break-word; }

@media (max-width: 560px) {
    .masthead .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
    .brand-org { margin-left: 0; width: 100%; }
    .endpoints th, .endpoints td { padding: 9px 12px; }
    .endpoints td:first-child { white-space: normal; }
}

/* Login form, the sign-in call to action, and the signed-in bar.
   NOTE: these use --panel-edge. There is no --rule token; an earlier version of
   this block invented one, so every border silently fell back to a light grey
   on a dark theme. A var() fallback hides a typo instead of reporting it — if a
   token here does not exist, that is a bug worth seeing. */

.btn {
    font: inherit; font-weight: 650; line-height: 1.2;
    padding: 10px 16px; border: 0; border-radius: 6px;
    background: var(--accent); color: #08131f;
    cursor: pointer; text-decoration: none; display: inline-block;
}
.btn:hover { filter: brightness(1.1); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-quiet {
    font: inherit; padding: 7px 13px; border-radius: 6px; cursor: pointer;
    background: none; border: 1px solid var(--panel-edge); color: var(--muted);
}
.btn-quiet:hover { color: var(--text); border-color: var(--muted); }

.form { display: flex; flex-direction: column; max-width: 400px; padding: 20px; }
.form label {
    font-size: 12px; font-weight: 650; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--muted); margin: 16px 0 6px;
}
.form label:first-of-type { margin-top: 0; }
.form input {
    font: inherit; padding: 10px 12px; border-radius: 6px;
    border: 1px solid var(--panel-edge);
    background: var(--bg); color: var(--text);
}
.form input:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 156, 249, .18);
}
.form .btn { margin-top: 22px; align-self: flex-start; }

/* A failed login is the one message on this page a person actually reads. */
.form-error {
    padding: 12px 16px; margin: 0 0 20px; border-radius: 8px; max-width: 400px;
    border: 1px solid rgba(248, 81, 73, .35);
    background: rgba(248, 81, 73, .08);
    color: var(--text); font-size: 14px;
}

.signed-in {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 14px 18px; margin: 0 0 8px;
}
.signed-in form { margin: 0; }
.signed-in .pill { margin-left: 6px; }

.cta { margin: 0 0 28px; }

/* ── Signed-in console: navigation, account bar, tables, cards ─────────────
   Tokens only, no var() fallbacks — see the note above tools/css-lint.py. */

.account { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.account-name { font-weight: 650; font-size: 13.5px; }
.account form { margin: 0; }

.mainnav { border-bottom: 1px solid var(--panel-edge); background: var(--panel); }
.mainnav .wrap { display: flex; gap: 4px; overflow-x: auto; }
.navlink {
    padding: 11px 14px; font-size: 13.5px; font-weight: 600; white-space: nowrap;
    color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent;
}
.navlink:hover { color: var(--text); }
.navlink.active { color: var(--text); border-bottom-color: var(--accent); }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 2px; }

/* Numbers a person actually came to read. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 28px; }
.tile { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px; padding: 16px 18px; }
.tile-value { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.tile-label { margin-top: 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.tile-note { margin-top: 6px; font-size: 12px; color: var(--muted); }

table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th {
    text-align: left; padding: 11px 18px; font-size: 11.5px; font-weight: 650;
    text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
    border-bottom: 1px solid var(--panel-edge);
}
table.grid td { padding: 13px 18px; border-top: 1px solid var(--panel-edge); vertical-align: top; }
table.grid tr:first-child td { border-top: 0; }
table.grid a { color: var(--accent); text-decoration: none; }
table.grid a:hover { text-decoration: underline; }
.num { font-variant-numeric: tabular-nums; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; border: 1px solid transparent; }
.pill.ok { color: var(--ok); border-color: rgba(63,185,80,.4); background: rgba(63,185,80,.1); }
.pill.bad { color: var(--bad); border-color: rgba(248,81,73,.4); background: rgba(248,81,73,.1); }
.pill.warn { color: var(--warn); border-color: rgba(210,153,34,.4); background: rgba(210,153,34,.1); }
.pill.idle { color: var(--muted); border-color: var(--panel-edge); background: var(--bg); }

.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); margin-bottom: 6px; font-size: 15px; }

.panel-head { padding: 15px 18px; border-bottom: 1px solid var(--panel-edge); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-head h2 { margin: 0; }
.panel-body { padding: 18px; }

.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 18px; }
.inline-form .field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 260px; }
.inline-form label { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.inline-form input {
    font: inherit; padding: 10px 12px; border-radius: 6px;
    border: 1px solid var(--panel-edge); background: var(--bg); color: var(--text);
}
.inline-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,156,249,.18); }

/* A licence key is meant to be copied, so make it copyable-looking. */
.keyline { display: inline-flex; align-items: center; gap: 10px; }
.key {
    font-family: var(--mono); font-size: 14px; letter-spacing: 0.04em;
    background: var(--bg); border: 1px solid var(--panel-edge); border-radius: 6px; padding: 6px 10px;
}

pre.snippet {
    margin: 0; padding: 16px 18px; overflow-x: auto;
    background: var(--bg); border: 1px solid var(--panel-edge); border-radius: 8px;
    font-family: var(--mono); font-size: 12.5px; line-height: 1.55; color: var(--text);
}
pre.snippet .c { color: var(--muted); }
.step { display: flex; gap: 14px; padding: 18px; border-top: 1px solid var(--panel-edge); }
.step:first-child { border-top: 0; }
.step-n {
    flex: none; width: 24px; height: 24px; border-radius: 50%; margin-top: 1px;
    background: var(--panel-edge); color: var(--text);
    font-size: 12px; font-weight: 650; display: flex; align-items: center; justify-content: center;
}
.step-body { flex: 1; min-width: 0; }
.step-body h3 { margin: 2px 0 8px; font-size: 14px; font-weight: 650; }
.step-body p { margin: 0 0 10px; color: var(--muted); font-size: 13.5px; }

.rowsplit { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.dl { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 10px 20px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; padding-top: 2px; }
.dl dd { margin: 0; }

.notice { padding: 12px 16px; margin: 0 0 22px; border-radius: 8px; font-size: 14px; }
.notice.ok { border: 1px solid rgba(63,185,80,.35); background: rgba(63,185,80,.08); }
.notice.bad { border: 1px solid rgba(248,81,73,.35); background: rgba(248,81,73,.08); }
.notice.warn { border: 1px solid rgba(210,153,34,.35); background: rgba(210,153,34,.08); }
.notice form { display: inline; margin: 0; }
