:root {
  --brand: #14365d; --brand-dark: #0d2744; --ink: #1f2328; --muted: #5b6168; --line: #d5d8dc; --bg: #f6f7f8;
  --ok: #1f7a3a; --warn: #9a6200; --bad: #b42318; --link: #1b5e9a;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif; font-size: 15px; color: var(--ink); background: var(--bg); }
a { color: var(--link); }
header.top { background: var(--brand); color: #fff; display: flex; align-items: center; padding: 0 20px; height: 52px; }
header.top .name { font-weight: 600; font-size: 17px; letter-spacing: .2px; }
header.top .name small { font-weight: 400; opacity: .85; margin-left: 10px; font-size: 13px; }
header.top .who { margin-left: auto; font-size: 13px; text-align: right; line-height: 1.25; }
header.top .who a { color: #fff; opacity: .85; margin-left: 8px; }
.wrap { display: flex; min-height: calc(100vh - 52px); }
nav.side { width: 214px; background: #fff; border-right: 1px solid var(--line); padding: 14px 0; flex-shrink: 0; }
nav.side h4 { margin: 14px 18px 4px; font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .6px; }
nav.side a { display: block; padding: 6px 18px; color: var(--ink); text-decoration: none; border-left: 3px solid transparent; }
nav.side a.on { border-left-color: var(--brand); background: #eaf1f8; font-weight: 600; }
nav.side a:hover { background: #f4f4f6; }
main { flex: 1; padding: 18px 26px 40px; min-width: 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
h1 { font-size: 23px; margin: 2px 0 4px; font-weight: 600; }
h2 { font-size: 17px; margin: 22px 0 8px; font-weight: 600; }
.sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
table.t { width: 100%; border-collapse: collapse; background: #fff; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 600; border-bottom: 2px solid var(--line); padding: 6px 8px; white-space: nowrap; color: #333; }
table.t th a { color: #333; text-decoration: none; }
table.t td { border-bottom: 1px solid #e8eaed; padding: 6px 8px; vertical-align: top; }
table.t tr:hover td { background: #fafafb; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 12px; border: 1px solid; white-space: nowrap; }
.tag.ok { color: var(--ok); border-color: #9fd3ae; background: #eff8f1; }
.tag.warn { color: var(--warn); border-color: #e7c27a; background: #fdf6e7; }
.tag.bad { color: var(--bad); border-color: #f0a39b; background: #fdeeec; }
.tag.info { color: #44505c; border-color: #c6ccd2; background: #f3f5f7; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; }
.filters label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 2px; }
select, input[type=text], textarea { font: inherit; font-size: 14px; padding: 5px 7px; border: 1px solid #b9bec4; border-radius: 3px; background: #fff; }
button, .btn { font: inherit; font-size: 13.5px; padding: 5px 12px; border: 1px solid var(--brand); background: var(--brand); color: #fff; border-radius: 3px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn.plain { background: #fff; color: var(--brand); }
.pager { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin-top: 8px; }
.pager a { margin-left: 8px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); background: #fff; border-radius: 4px; margin-bottom: 16px; }
.facts div { padding: 9px 14px; border-right: 1px solid #eceef0; }
.facts div:nth-child(4n) { border-right: 0; }
.facts div:nth-child(n+5) { border-top: 1px solid #eceef0; }
.facts b { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.gallery a { display: block; background: #fff; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; color: var(--ink); font-size: 12.5px; }
.gallery img { width: 100%; height: 146px; object-fit: cover; display: block; border-bottom: 1px solid var(--line); background: #222; }
.gallery span { display: block; padding: 6px 8px; line-height: 1.35; }
.note { background: #fdf6e7; border: 1px solid #e7c27a; padding: 8px 12px; border-radius: 4px; font-size: 13.5px; margin-bottom: 12px; }
.err { background: #fdeeec; border: 1px solid #f0a39b; padding: 8px 12px; border-radius: 4px; font-size: 13.5px; margin-bottom: 12px; }
.muted { color: var(--muted); }
.asof { font-size: 12.5px; color: var(--muted); }
.timeline td:first-child { width: 44px; color: var(--muted); }
canvas { max-width: 100%; }
dl.kv { display: grid; grid-template-columns: 170px 1fr; gap: 4px 12px; margin: 0; font-size: 13.5px; }
dl.kv dt { color: var(--muted); }
.empty { padding: 22px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 4px; }
header.top .env { margin-left: 14px; font-size: 11.5px; border: 1px solid rgba(255,255,255,.55); border-radius: 3px; padding: 1px 7px; letter-spacing: .3px; }
header.top .logo { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--brand); font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center; margin-right: 10px; letter-spacing: -.3px; }
nav.side .count { float: right; background: var(--bad); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; margin-top: 2px; }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 10px 14px; }
.kpi b { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.kpi span { font-size: 22px; font-weight: 600; }
.kpi small { display: block; color: var(--muted); font-size: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 10px 14px 6px; border-top: 3px solid #c6ccd2; }
.tile.ok { border-top-color: var(--ok); } .tile.warn { border-top-color: #d08a00; }
.tile .nm { font-size: 13px; color: var(--muted); min-height: 34px; }
.tile .v { font-size: 24px; font-weight: 600; }
.tile .v small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.tile .t { font-size: 12px; color: var(--muted); }
.tile canvas { height: 44px !important; margin-top: 4px; }
.steps { counter-reset: s; }
.lineage { display: flex; align-items: center; gap: 0; flex-wrap: wrap; margin: 6px 0 14px; }
.lineage .node { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; font-size: 13px; min-width: 150px; }
.lineage .node b { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.lineage .node.me { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.lineage .arr { width: 34px; height: 2px; background: #9aa3ad; position: relative; margin: 0 4px; }
.lineage .arr:after { content: ""; position: absolute; right: -1px; top: -4px; border-left: 7px solid #9aa3ad; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.cell { text-align: center; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cell.ok { background: #eff8f1; color: var(--ok); } .cell.bad { background: #fdeeec; color: var(--bad); font-weight: 600; } .cell.na { color: #9aa3ad; }
pre.sql { background: #0f2238; color: #e6edf5; padding: 12px 14px; border-radius: 4px; font-size: 12.5px; white-space: pre-wrap; margin: 0; }
#map { height: 380px; border: 1px solid var(--line); border-radius: 4px; }
.bar { background: #e8ecf0; border-radius: 3px; height: 8px; position: relative; overflow: hidden; min-width: 90px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); border-radius: 3px; }
.bar.ok i { background: var(--ok); }
details.rb { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; margin-bottom: 8px; }
details.rb summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.inline { display: inline; }
.small { font-size: 12.5px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.chip { display: inline-block; font-size: 11.5px; padding: 0 6px; border-radius: 3px; background: #eaf1f8; color: #1b4a78; border: 1px solid #c3d6ea; margin: 1px 2px 1px 0; white-space: nowrap; }
.chip.r { background: #fdeeec; color: #8c1d13; border-color: #f0a39b; } .chip.c { background: #fdf6e7; color: #7a4d00; border-color: #e7c27a; }
.muted-tiles { filter: grayscale(.85) brightness(1.04) contrast(.92); }
table.t td a[href^="/pipeline/"] { white-space: nowrap; }
td.nw { white-space: nowrap; }
.tile .dash { height: 100px; position: relative; margin-top: 6px; }
.tile .dash canvas { height: 100px !important; }
