/* Sherpa web UI. Brand: navy #0A1A3F, cyan #00C8F0 (pdf_theme.toml). Light and dark. */
:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #f0f3f9;
  --text: #0f1b33;
  --muted: #5d6b85;
  --line: #dfe5ef;
  --brand: #0A1A3F;
  --accent: #0089a8;
  --accent-soft: #e0f6fb;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 51, .06), 0 2px 8px rgba(15, 27, 51, .04);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --panel: #111a2c;
    --panel-2: #172238;
    --text: #e6ecf7;
    --muted: #94a3bd;
    --line: #24314a;
    --brand: #e6ecf7;
    --accent: #3ad3f5;
    --accent-soft: #0e3443;
    --ok: #4ade80;
    --ok-soft: #0f2e1d;
    --warn: #fbbf24;
    --warn-soft: #3a2a08;
    --bad: #f87171;
    --bad-soft: #3b1414;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/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; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 0 0 12px; }
p { margin: 0 0 8px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.booting { min-height: 100vh; }

/* layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side {
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 700; font-size: 16px; color: var(--brand); }
.brand img { width: 28px; height: 28px; }
.brand small { font-weight: 500; color: var(--muted); font-size: 11px; display: block; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--text); font-weight: 500;
}
.nav a:hover { background: var(--panel-2); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; padding: 8px; display: grid; gap: 8px; font-size: 12px; color: var(--muted); }
.main { padding: 24px 28px 48px; min-width: 0; max-width: 1200px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 24px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 24px; text-align: center; color: var(--muted); }

/* badges */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--accent-soft); color: var(--accent); }

/* forms */
label { display: grid; gap: 4px; font-weight: 500; font-size: 13px; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; min-width: 0;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.row > label { flex: 1 1 160px; }
.stack { display: grid; gap: 12px; }
button, .btn {
  font: inherit; font-weight: 600; border-radius: 8px; padding: 7px 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
}
button:hover { background: var(--panel-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--bad); }
button.small { padding: 3px 10px; font-size: 12px; }
button:disabled { opacity: .55; cursor: default; }
.link { background: none; border: none; padding: 0; color: var(--accent); font-weight: 500; }
.link:hover { background: none; text-decoration: underline; }

/* notices */
.notice { border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.notice.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.notice.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.notice.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 10; max-width: 420px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.timeline .t { color: var(--muted); font-family: var(--mono); font-size: 12px; }

/* providers */
.target { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.target select, .target input { flex: 1 1 140px; }
.role { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.role-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
pre.result { background: var(--panel-2); border-radius: 8px; padding: 10px; overflow: auto; font-size: 12px; margin: 8px 0 0; }

/* settings */
details.group { margin: 0; }
details.group > summary { cursor: pointer; padding: 2px 0 8px; list-style-position: outside; }
details.group details.group { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; margin-left: 4px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 16px; margin-bottom: 8px; }
.field { align-content: start; }
.field.check > span:first-child { display: flex; align-items: center; gap: 6px; }
.field.check.inline { display: inline-flex; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); outline: 1px solid var(--bad); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; flex: 2 1 320px; padding-bottom: 8px; }
.checks label { flex: none; }
.small { font-size: 12px; }
.bad-text { color: var(--bad); }
textarea { resize: vertical; }
input.secret { -webkit-text-security: disc; font-family: var(--mono); }

.readonly button.primary, .readonly button.danger { display: none; }
.step h2 { font-size: 16px; }
.side-foot a { color: var(--text); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(380px, 100%); }
.login .brand { justify-content: center; padding-bottom: 8px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; }
  .brand { padding: 0 8px 0 0; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .side-foot { margin: 0 0 0 auto; grid-auto-flow: column; align-items: center; }
  .main { padding: 16px; }
  .two { grid-template-columns: 1fr; }
}
