/* IntraVault panel styles.
   One stylesheet, no external origins, no inline style attributes anywhere: the content
   security policy allows neither, because these pages print text that came from switches. */

:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --ink: #16202b;
  --ink-soft: #5b6b7c;
  --line: #dde3e9;
  --accent: #0e6f73;
  --accent-ink: #ffffff;
  --ok: #1f7a4c;
  --ok-bg: #e3f4ea;
  --warn: #8a5a00;
  --warn-bg: #fdf1dc;
  --bad: #a32020;
  --bad-bg: #fbe6e6;
  --info: #15557f;
  --info-bg: #e3eef8;
  --add-bg: #e3f4ea;
  --del-bg: #fbe6e6;
  --mono: ui-monospace, "DejaVu Sans Mono", "Liberation Mono", Menlo, Consolas, monospace;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161c;
    --panel: #181f27;
    --panel-2: #1d262f;
    --ink: #e6edf3;
    --ink-soft: #9aabbb;
    --line: #2a3542;
    --accent: #2dd4bf;
    --accent-ink: #07211f;
    --ok: #7ee2a8;
    --ok-bg: #11301f;
    --warn: #f1c46b;
    --warn-bg: #352713;
    --bad: #f99;
    --bad-bg: #3a1a1a;
    --info: #8ec5f0;
    --info-bg: #122b3d;
    --add-bg: #11301f;
    --del-bg: #3a1a1a;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono, pre { font-family: var(--mono); }

/* ---- header ---------------------------------------------------------- */
.top {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 650; letter-spacing: .2px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.mark {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 12px/1 var(--mono);
}
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav a {
  padding: 6px 10px; border-radius: 7px; color: var(--ink-soft); font-size: 14px;
}
.nav a:hover { background: var(--panel-2); text-decoration: none; color: var(--ink); }
.nav a.on { background: var(--accent); color: var(--accent-ink); }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.who form { margin: 0; }

main { max-width: 1420px; margin: 0 auto; padding: 20px; }

footer {
  max-width: 1420px; margin: 0 auto; padding: 10px 20px 30px;
  color: var(--ink-soft); font-size: 12px;
}

/* ---- layout ---------------------------------------------------------- */
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.head h1 { margin: 0 0 2px; font-size: 22px; }
.head p { margin: 0; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 16px;
}
.card h1 { margin: 0 0 10px; font-size: 20px; }
.card h2 { margin: 0 0 10px; font-size: 15px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-soft); }
.card h2:not(:first-child) { margin-top: 20px; }
.card.narrow { max-width: 520px; }
.card.bad-border { border-color: var(--bad); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

/* ---- tiles ----------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; color: var(--ink);
}
.tile:hover { text-decoration: none; border-color: var(--accent); }
.tile .n { font-size: 26px; font-weight: 600; line-height: 1.1; }
.tile .l { font-size: 13px; color: var(--ink-soft); }
.tile .sub { font-size: 12px; color: var(--ink-soft); }
.tile.ok .n { color: var(--ok); }
.tile.warn .n { color: var(--warn); }
.tile.bad .n { color: var(--bad); }

/* ---- tables ---------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-soft);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table tbody tr:hover { background: var(--panel-2); }
.table.wide { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table.kv th { width: 42%; color: var(--ink-soft); font-weight: 500; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.right { text-align: right; white-space: nowrap; }
.table td.right a, .table td.right form { margin-left: 8px; }
.table tr.muted td { opacity: .55; }

.indent-0 { padding-left: 10px; }
.indent-1 { padding-left: 32px; }
.indent-2 { padding-left: 54px; }
.indent-3 { padding-left: 76px; }
.indent-4 { padding-left: 98px; }
.indent-5 { padding-left: 120px; }

/* ---- text helpers ---------------------------------------------------- */
.muted { color: var(--ink-soft); }
.small { font-size: 12.5px; }
.add { color: var(--ok); }
.del { color: var(--bad); }
ul.plain { margin: 0; padding-left: 18px; }
ul.plain li { margin: 2px 0; }
.pager { display: flex; gap: 14px; align-items: center; color: var(--ink-soft); font-size: 13px; }

/* ---- badges ---------------------------------------------------------- */
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; white-space: nowrap; border: 1px solid transparent;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.muted { background: var(--panel-2); color: var(--ink-soft); border-color: var(--line); }
.badge.mono { font-family: var(--mono); font-size: 11.5px; }
a.badge:hover { text-decoration: none; filter: brightness(1.05); }
.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* ---- buttons and forms ---------------------------------------------- */
.btn {
  display: inline-block; padding: 6px 12px; border-radius: 8px; font-size: 14px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
button.link, .link {
  background: none; border: none; padding: 0; font-size: inherit; color: var(--accent);
  cursor: pointer; font-family: inherit;
}
button.link:hover { text-decoration: underline; }
.link.danger { color: var(--bad); }
form.inline { display: inline-block; }

label { display: block; margin: 0 0 12px; font-size: 13px; color: var(--ink-soft); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 7px 9px;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; font: inherit;
}
input[type=checkbox] { width: auto; margin: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; }
textarea.mono, input.mono { font-family: var(--mono); font-size: 13px; }
textarea.full { width: 100%; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; }
legend { color: var(--ink-soft); font-size: 12px; padding: 0 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid2 .span2 { grid-column: 1 / -1; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }

.filters {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px;
}
.filters input, .filters select { width: auto; min-width: 150px; margin: 0; }
.filters .btn { padding: 7px 12px; }

/* ---- flashes --------------------------------------------------------- */
.flashes { margin-bottom: 16px; }
.flash {
  margin: 0 0 8px; padding: 9px 12px; border-radius: 8px; font-size: 14px;
  border: 1px solid var(--line); background: var(--panel);
}
.flash.success { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.flash.info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.flash.warning { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.flash.error { background: var(--bad-bg); color: var(--bad); border-color: transparent; }

/* ---- bodies and diffs ------------------------------------------------ */
pre.body, pre.diff {
  margin: 0; padding: 12px 14px; max-height: 70vh; overflow: auto;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  font-size: 12.5px; line-height: 1.45; white-space: pre; tab-size: 4;
}
pre.diff span { display: block; }
pre.diff span.add { background: var(--add-bg); }
pre.diff span.del { background: var(--del-bg); }
pre.diff span.hunk { color: var(--ink-soft); }

.diff-table { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font-size: 12.5px; }
.diff-table td { padding: 1px 8px; border: none; white-space: pre-wrap; word-break: break-word; }
.diff-table td.lineno { width: 1%; color: var(--ink-soft); text-align: right; user-select: none; font-family: var(--mono); }
.diff-table tr.add td.add { background: var(--add-bg); }
.diff-table tr.remove td.del { background: var(--del-bg); }
.diff-table tr.change td.del { background: var(--del-bg); }
.diff-table tr.change td.add { background: var(--add-bg); }
.diff-table tr.gap td { text-align: center; color: var(--ink-soft); background: var(--panel-2); }
.diff-table tr:hover { background: transparent; }

/* ---- progress bars --------------------------------------------------- */
.bar { height: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; min-width: 90px; }
.bar .fill { display: block; height: 100%; background: var(--accent); }
.fill-0 { width: 0; } .fill-5 { width: 5%; } .fill-10 { width: 10%; } .fill-15 { width: 15%; }
.fill-20 { width: 20%; } .fill-25 { width: 25%; } .fill-30 { width: 30%; } .fill-35 { width: 35%; }
.fill-40 { width: 40%; } .fill-45 { width: 45%; } .fill-50 { width: 50%; } .fill-55 { width: 55%; }
.fill-60 { width: 60%; } .fill-65 { width: 65%; } .fill-70 { width: 70%; } .fill-75 { width: 75%; }
.fill-80 { width: 80%; } .fill-85 { width: 85%; } .fill-90 { width: 90%; } .fill-95 { width: 95%; }
.fill-100 { width: 100%; }

/* ---- login ----------------------------------------------------------- */
.login { margin: 8vh auto 0; }
.login h1 { margin-bottom: 0; }
