/* RIVPN Console. System fonts only: the console must work on an air-gapped network. */
:root {
  --paper: #f2f5f3;
  --surface: #ffffff;
  --ink: #14211d;
  --muted: #5b6b65;
  --line: #d3dbd6;
  --rail: #17302b;
  --rail-ink: #dfe9e4;
  --action: #0e5e6f;
  --action-ink: #ffffff;
  --live: #1c8048;
  --warn: #8a5f00;
  --stop: #b3261e;
  --idle: #9aa8a2;
  --ui: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
  --code: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--ui); line-height: 1.45; }
.boot { padding: 3rem; color: var(--muted); }
a { color: var(--action); }
h1 { font-size: 1.6rem; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 0.25rem; }
h2 { font-size: 1.05rem; font-weight: 650; margin: 2rem 0 0.6rem; }
p { margin: 0 0 0.8rem; max-width: 68ch; }
.lede { color: var(--muted); margin-bottom: 1.4rem; }
code, .mono { font-family: var(--code); font-size: 0.87rem; }

/* shell */
.shell { display: grid; grid-template-columns: 13.5rem 1fr; min-height: 100vh; }
.rail { background: var(--rail); color: var(--rail-ink); padding: 1.4rem 0 1rem; display: flex; flex-direction: column; }
.brand { padding: 0 1.3rem 1.2rem; }
.brand strong { display: block; font-size: 1.25rem; letter-spacing: 0.02em; font-weight: 700; color: #fff; }
.brand span { font-size: 0.82rem; opacity: 0.75; }
.rail nav a { display: block; padding: 0.5rem 1.3rem; color: var(--rail-ink); text-decoration: none; border-left: 3px solid transparent; }
.rail nav a:hover { background: rgba(255,255,255,0.06); }
.rail nav a[aria-current="page"] { border-left-color: #7fd0c0; background: rgba(255,255,255,0.09); color: #fff; font-weight: 600; }
.rail .who { margin-top: auto; padding: 1rem 1.3rem 0; font-size: 0.82rem; opacity: 0.85; overflow-wrap: anywhere; }
.rail .who button { margin-top: 0.5rem; }
main { padding: 2rem 2.4rem 4rem; min-width: 0; }

/* controls */
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0.38rem 0.8rem; border-radius: 4px; cursor: pointer; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--action); border-color: var(--action); color: var(--action-ink); font-weight: 600; }
button.primary:hover { background: #0a4c5a; }
button.danger { color: var(--stop); border-color: #e3bcb9; }
button.danger.armed { background: var(--stop); border-color: var(--stop); color: #fff; }
button.quiet { border-color: transparent; background: transparent; color: inherit; text-decoration: underline; padding: 0.2rem 0.3rem; }
.rail button.quiet { color: var(--rail-ink); padding-left: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.rail a:focus-visible, .rail button:focus-visible { outline-color: #7fd0c0; }
input, select, textarea { font: inherit; padding: 0.4rem 0.55rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); min-width: 0; }
textarea { font-family: var(--code); font-size: 0.87rem; width: 100%; min-height: 5.5rem; }
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.2rem; }
.field { margin-bottom: 0.9rem; }
.field input, .field select { width: 100%; }
.hint { font-size: 0.82rem; color: var(--muted); font-weight: 400; }
p.hint.pad { font-size: 0.9rem; margin: 0.5rem 0 0.8rem; }
a.btn { display: inline-block; text-decoration: none; }
a.btn:hover { border-color: var(--muted); }
.downloads { display: flex; flex-wrap: wrap; gap: 0.5rem; }
td.wrap { overflow-wrap: anywhere; max-width: 18rem; }
form.row { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); padding: 0.9rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
form.row .field { margin: 0; flex: 1 1 12rem; }
form.row .field.narrow { flex: 0 1 9rem; }
form.row .field.wide { flex: 2 1 22rem; }
form.row .field.checks { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; }
form.row .field.checks label { font-weight: 400; font-size: 0.93rem; margin: 0; }
form.row .field.checks input { width: auto; }
.error { color: var(--stop); font-weight: 600; margin: 0.6rem 0; }
.note { background: #e7f1ee; border-left: 4px solid var(--action); padding: 0.8rem 1rem; margin: 0 0 1rem; border-radius: 0 4px 4px 0; }
.note p { margin-bottom: 0.5rem; }
.secret { display: flex; gap: 0.5rem; align-items: stretch; margin: 0.4rem 0 0.7rem; }
.secret code { flex: 1; background: var(--ink); color: #e9f2ee; padding: 0.55rem 0.7rem; border-radius: 4px; overflow-x: auto; white-space: nowrap; }

/* tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 0.8rem; font-weight: 600; color: var(--muted); padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 0.55rem 0.7rem; border-bottom: 1px solid #e8ece9; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
td.actions button { margin-left: 0.3rem; padding: 0.2rem 0.55rem; font-size: 0.87rem; }
td .sub { display: block; font-size: 0.8rem; color: var(--muted); }
td select, td input { padding: 0.2rem 0.4rem; font-size: 0.9rem; max-width: 10.5rem; }
td textarea { min-height: 3.6rem; min-width: 14rem; }
.empty { padding: 1.6rem 1rem; color: var(--muted); }
.state { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.state::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--idle); flex: none; }
.state.live::before { background: var(--live); }
.state.stop::before { background: var(--stop); border-radius: 1px; }
.state.warn::before { background: var(--warn); }
.state.stop { color: var(--stop); }

/* overview */
.map { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem; margin-bottom: 0.6rem; }
.map svg { display: block; width: 100%; height: auto; max-height: 26rem; }
.map text { font-family: var(--ui); font-size: 12px; fill: var(--ink); paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
.map text.quiet { fill: var(--muted); font-size: 11px; }
.key { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: 0.85rem; color: var(--muted); margin-bottom: 1.5rem; }
.summary { font-size: 1.15rem; max-width: 60ch; margin-bottom: 1.2rem; }
.summary b { font-weight: 650; }

/* read-only role */
.readonly form.row.write, .readonly td.actions > *, .readonly .write { display: none; }
.readonly-note { max-width: none; }
.readonly td input:disabled, .readonly td select:disabled, .readonly td textarea:disabled { background: transparent; border-color: transparent; color: inherit; opacity: 1; appearance: none; resize: none; }
.rail .who .role { font-size: 0.78rem; opacity: 0.8; }
.warn-text { color: var(--warn); }
button.quiet.write { font-size: 0.8rem; padding: 0 0.2rem; }

/* sign-in */
.gate { max-width: 25rem; margin: 9vh auto; padding: 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.gate h1 { margin-bottom: 0.4rem; }
.gate button.primary { width: 100%; padding: 0.55rem; margin-top: 0.4rem; }
.sso { margin-bottom: 1rem; }
a.sso-btn { display: block; text-align: center; padding: 0.55rem; margin-bottom: 0.5rem; font-weight: 600; }
.or { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 0.8rem 0 0.4rem; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .rail { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 0.6rem 0.8rem; gap: 0.2rem 0.8rem; }
  .brand { padding: 0; } .brand span { display: none; }
  .rail nav { display: flex; flex-wrap: wrap; }
  .rail nav a { padding: 0.35rem 0.55rem; border-left: 0; border-bottom: 3px solid transparent; }
  .rail nav a[aria-current="page"] { border-bottom-color: #7fd0c0; }
  .rail .who { margin: 0 0 0 auto; padding: 0; } .rail .who span, .rail .who br { display: none; } .rail .who button { margin: 0; }
  main { padding: 1.2rem 1rem 3rem; }
}
