/* LEVERAGE dashboard, THE DISCOVERY SIGNAL identity. No inline styles (CSP style-src 'self'). */
@font-face { font-family: "Space Grotesk"; src: url("/static/SpaceGrotesk.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/Inter.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #050A19; --bg-2: #070E24; --panel: #0B1530; --panel-2: #0F1B3B; --line: rgba(120,150,210,.14); --line-2: rgba(120,150,210,.24);
  --cyan: #22DDF7; --cyan-soft: rgba(34,221,247,.12); --cyan-glow: rgba(34,221,247,.35);
  --warm: #FFF3E3; --text: #E8ECF6; --mute: #8B97B5; --mute-2: #5E6A88;
  --ok: #34D399; --ok-soft: rgba(52,211,153,.12); --warn: #FBBF24; --warn-soft: rgba(251,191,36,.12);
  --bad: #FB7185; --bad-soft: rgba(251,113,133,.12); --live: #22DDF7; --live-soft: rgba(34,221,247,.12);
  --idle: #8B97B5; --idle-soft: rgba(139,151,181,.10);
  --r: 14px; --r-sm: 9px; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -18px rgba(0,0,0,.8);
  --sans: Inter, ui-sans-serif, system-ui, sans-serif; --display: "Space Grotesk", Inter, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 14.5px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: #7FEEFF; }
h1, h2, h3 { font-family: var(--display); color: var(--warm); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 700; line-height: 1.15; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--panel-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.ic { width: 18px; height: 18px; flex: none; }
.ic-sm { width: 15px; height: 15px; flex: none; }
.ic-lg { width: 22px; height: 22px; flex: none; }
.mute { color: var(--mute); } .small { font-size: 12.5px; } .mono { font-family: var(--mono); font-size: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 22px 16px;
  background: linear-gradient(180deg, #081130 0%, #050A19 100%); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; color: var(--warm); }
.brand img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line-2), 0 0 24px -6px var(--cyan-glow); }
.brand b { display: block; font: 700 16px var(--display); letter-spacing: .08em; }
.brand span { display: block; font-size: 11px; color: var(--mute); letter-spacing: .14em; text-transform: uppercase; }
.nav-label { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--mute-2); padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--mute); font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.03); color: var(--text); }
.nav a.on { background: var(--cyan-soft); color: var(--warm); box-shadow: inset 2px 0 0 var(--cyan); }
.nav a.on .ic { color: var(--cyan); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); color: var(--cyan);
  font: 700 13px var(--display); border: 1px solid var(--line-2); text-transform: uppercase; }
.side-foot .who { flex: 1; min-width: 0; line-height: 1.25; } .side-foot .who b { display: block; color: var(--text); font-weight: 600; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--mute); cursor: pointer; }
.icon-btn:hover { color: var(--bad); border-color: rgba(251,113,133,.4); background: var(--bad-soft); }

.main { min-width: 0; padding: 34px 44px 70px; background: radial-gradient(1200px 500px at 70% -10%, rgba(34,221,247,.06), transparent 60%); }
.wrap { max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head .eyebrow { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.page-head .sub { color: var(--mute); margin-top: 8px; max-width: 720px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--mute); font-size: 13px; margin-bottom: 14px; }
.crumb:hover { color: var(--text); }

/* ---------- surfaces ---------- */
.card { background: linear-gradient(180deg, var(--panel) 0%, #0A1329 100%); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.card-head h2 { display: flex; align-items: center; gap: 10px; }
.card-head h2 .ic { color: var(--cyan); }
.card-body { padding: 18px 22px; }
.stack { display: grid; gap: 20px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: start; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .top { display: flex; align-items: center; justify-content: space-between; color: var(--mute); font-size: 12.5px; font-weight: 500; }
.kpi .top .ic { color: var(--cyan); opacity: .9; }
.kpi .val { font: 700 32px/1.1 var(--display); color: var(--warm); margin: 12px 0 6px; letter-spacing: -.02em; }
.kpi .foot { color: var(--mute); font-size: 12.5px; }
.kpi::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%;
  border: 1px solid rgba(34,221,247,.10); box-shadow: 0 0 0 18px rgba(34,221,247,.03); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.t-ok { color: var(--ok); background: var(--ok-soft); } .t-warn { color: var(--warn); background: var(--warn-soft); }
.t-bad { color: var(--bad); background: var(--bad-soft); } .t-live { color: var(--live); background: var(--live-soft); }
.t-idle { color: var(--idle); background: var(--idle-soft); }
.badge.t-live i { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid transparent; font: 600 14px var(--sans); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn-primary { background: var(--cyan); color: #04101F; box-shadow: 0 6px 20px -8px var(--cyan-glow); }
.btn-primary:hover { background: #5BE7FA; color: #04101F; }
.btn-ghost { background: rgba(255,255,255,.02); color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--warm); background: var(--cyan-soft); }
.btn-danger { background: transparent; color: var(--bad); border-color: rgba(251,113,133,.35); }
.btn-danger:hover { background: var(--bad-soft); color: #FFB3C0; }
.btn-lg { height: 50px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:focus-visible, .icon-btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 2px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline-flex; margin: 0; }

/* forms */
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 12.5px; color: var(--mute); }
input[type=text], input[type=password], textarea, select { width: 100%; background: #060C1F; color: var(--text); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 11px 14px; font: 14.5px var(--sans); transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--mute-2); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(34,221,247,.12); }
textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B97B5' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.015); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--cyan); flex: none; }
.check b { display: block; color: var(--text); font-weight: 600; }

/* flash */
.flash { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; margin-bottom: 20px;
  background: var(--cyan-soft); border: 1px solid rgba(34,221,247,.25); color: var(--warm); }
.flash .ic { color: var(--cyan); }
.flash.bad { background: var(--bad-soft); border-color: rgba(251,113,133,.3); } .flash.bad .ic { color: var(--bad); }

/* production rows */
.prod { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); color: inherit; }
.prod:last-child { border-bottom: 0; }
.prod:hover { background: rgba(34,221,247,.035); color: inherit; }
.prod .t { font: 600 15.5px var(--display); color: var(--warm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod .meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--mute); font-size: 12.5px; margin-top: 4px; }
.prod .right { display: flex; align-items: center; gap: 14px; }
.segs { display: flex; gap: 3px; margin-top: 12px; grid-column: 1 / -1; }
.segs span { flex: 1; height: 5px; border-radius: 3px; background: rgba(139,151,181,.16); }
.segs .s-succeeded { background: var(--ok); } .segs .s-running { background: var(--cyan); } .segs .s-failed { background: var(--bad); }
.segs .s-superseded { background: var(--warn); }
.empty { padding: 44px 22px; text-align: center; color: var(--mute); }
.empty .ic-lg { color: var(--cyan); margin-bottom: 10px; }
.empty b { display: block; color: var(--text); font: 600 16px var(--display); margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

/* status lists (health, integrations) */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows .name { flex: 1; min-width: 0; color: var(--text); font-weight: 500; }
.rows .name small { display: block; color: var(--mute); font-weight: 400; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--idle); }
.dot.t-ok { background: var(--ok); box-shadow: 0 0 10px rgba(52,211,153,.6); } .dot.t-warn { background: var(--warn); }
.dot.t-bad { background: var(--bad); box-shadow: 0 0 10px rgba(251,113,133,.6); }
.tile { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); color: var(--cyan); flex: none; }
.health-sum { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }

/* pipeline stepper */
.stepper { list-style: none; margin: 0; padding: 22px 22px 8px; display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); }
.step { position: relative; text-align: center; padding: 0 2px 14px; }
.step::before { content: ""; position: absolute; top: 15px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 2px; background: var(--line-2); }
.step:first-child::before { display: none; }
.step .node { position: relative; z-index: 1; width: 32px; height: 32px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center;
  background: #081028; border: 2px solid var(--line-2); color: var(--mute); font: 700 12px var(--display); }
.step .lbl { font-size: 12px; font-weight: 600; color: var(--mute); line-height: 1.25; }
.step .sub2 { font-size: 11px; color: var(--mute-2); margin-top: 2px; }
.step.s-succeeded .node { background: var(--ok); border-color: var(--ok); color: #03140D; }
.step.s-succeeded::before, .step.s-succeeded + .step::before { background: linear-gradient(90deg, var(--ok), var(--line-2)); }
.step.s-succeeded + .step.s-succeeded::before { background: var(--ok); }
.step.s-succeeded .lbl { color: var(--text); }
.step.s-running .node { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 0 5px rgba(34,221,247,.12), 0 0 18px var(--cyan-glow); }
.step.s-running .lbl { color: var(--cyan); }
.step.s-failed .node { border-color: var(--bad); color: var(--bad); background: #2A0D18; }
.step.s-failed .lbl { color: var(--bad); }
.step.s-superseded .node { border-color: var(--warn); color: var(--warn); }
.step.next .node { border-color: var(--cyan); color: var(--cyan); }
.step.next .lbl { color: var(--warm); }
.step.gate .node { border-style: dashed; }

/* tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute-2); font-weight: 600; padding: 10px 22px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 22px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .err { color: var(--bad); font-size: 12.5px; margin-top: 4px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 4px 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(34,221,247,.12); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 20px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--mute); font-size: 12px; }

/* logs */
.log { width: 100%; border-collapse: collapse; font-size: 13px; }
.log td { padding: 9px 22px; border-bottom: 1px solid var(--line); vertical-align: top; }
.log tr:last-child td { border-bottom: 0; }
.log .time { white-space: nowrap; color: var(--mute); font-family: var(--mono); font-size: 12px; width: 1%; }
.log .src { white-space: nowrap; color: var(--mute-2); font-family: var(--mono); font-size: 12px; width: 1%; }
.lvl { display: inline-block; min-width: 62px; text-align: center; padding: 1px 8px; border-radius: 6px; font: 700 10.5px var(--mono); letter-spacing: .05em; }
.lvl-INFO { color: var(--cyan); background: var(--cyan-soft); } .lvl-WARNING { color: var(--warn); background: var(--warn-soft); }
.lvl-ERROR, .lvl-CRITICAL { color: var(--bad); background: var(--bad-soft); } .lvl-DEBUG { color: var(--mute); background: var(--idle-soft); }
.log pre { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; font: 11.5px/1.5 var(--mono); color: var(--mute); }

/* brief, files */
.brief { color: var(--text); font-size: 15px; line-height: 1.65; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.file { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: rgba(255,255,255,.015); color: inherit; display: block; }
.file:hover { border-color: var(--cyan); color: inherit; }
.file video, .file img { width: 100%; border-radius: 8px; display: block; margin-bottom: 10px; background: #000; }
.file .fn { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,.02); border: 1px dashed var(--line-2); color: var(--mute); }
.notice .ic { color: var(--cyan); margin-top: 2px; }

/* ---------- login ---------- */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 48px 56px;
  background: radial-gradient(900px 600px at 30% 40%, #0F2150 0%, #070E24 55%, #03060F 100%); border-right: 1px solid var(--line); }
.auth-art .orbits { position: absolute; left: 50%; top: 46%; width: 1100px; height: 1100px; transform: translate(-50%, -50%); pointer-events: none; }
.auth-art .lockup { position: relative; display: flex; align-items: center; gap: 14px; color: var(--warm); }
.auth-art .lockup img { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line-2); }
.auth-art .lockup b { font: 700 15px var(--display); letter-spacing: .16em; }
.auth-art .hero { position: relative; max-width: 520px; }
.auth-art .hero img { width: 148px; height: 148px; border-radius: 50%; margin-bottom: 34px; box-shadow: 0 0 0 1px rgba(34,221,247,.25), 0 0 80px -10px var(--cyan-glow); }
.auth-art .hero h1 { font-size: 44px; line-height: 1.05; letter-spacing: -.02em; }
.auth-art .hero h1 em { font-style: normal; color: var(--cyan); }
.auth-art .hero p { color: var(--mute); font-size: 16px; margin-top: 16px; max-width: 440px; }
.auth-art .tags { position: relative; color: var(--cyan); font: 600 12px var(--display); letter-spacing: .26em; }
.auth-form { display: grid; place-items: center; padding: 48px 32px; background: var(--bg); }
.auth-box { width: 100%; max-width: 380px; }
.auth-box .mark { display: none; }
.auth-box h2 { font-size: 30px; font-weight: 700; margin-bottom: 8px; }
.auth-box .lead { color: var(--mute); margin-bottom: 30px; }
.pw { position: relative; }
.pw .ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--mute); pointer-events: none; }
.pw input { height: 52px; padding-left: 46px; font-size: 16px; border-radius: 12px; }
.auth-box .meta { display: flex; align-items: center; gap: 8px; margin-top: 22px; color: var(--mute-2); font-size: 12.5px; }
.auth-box .meta .ic { color: var(--ok); }
.auth-err { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 10px; margin-bottom: 18px; background: var(--bad-soft); color: #FFC2CC; border: 1px solid rgba(251,113,133,.3); font-size: 13.5px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: 1fr; }
  .stepper { grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: 8px; }
  .step:nth-child(7)::before { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; z-index: 5; height: auto; flex-direction: row; align-items: center; padding: 10px 14px; gap: 4px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 8px 0 0; } .brand div, .nav-label, .side-foot .who { display: none; }
  .brand img { width: 32px; height: 32px; }
  .nav { display: flex; gap: 2px; } .nav a { padding: 8px 10px; } .nav a span { display: none; }
  .nav a.on { box-shadow: inset 0 -2px 0 var(--cyan); }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; } .side-foot .avatar { display: none; }
  .main { padding: 22px 16px 50px; }
  h1 { font-size: 23px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-box .mark { display: block; width: 76px; height: 76px; border-radius: 50%; margin-bottom: 26px; box-shadow: 0 0 0 1px rgba(34,221,247,.25), 0 0 50px -10px var(--cyan-glow); }
  .auth-form { place-items: start center; padding-top: 14vh; background: radial-gradient(600px 400px at 50% 0%, #0F2150, var(--bg) 70%); }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .kpi { padding: 14px; } .kpi .val { font-size: 24px; }
  .stepper { grid-template-columns: 1fr; padding: 16px 18px; }
  .step { display: flex; align-items: center; gap: 12px; text-align: left; padding: 0 0 14px; }
  .step::before { top: -14px; bottom: auto; left: 15px; right: auto; width: 2px; height: 14px; }
  .step:first-child::before, .step:nth-child(7)::before { display: block; } .step:first-child::before { display: none; }
  .step .node { margin: 0; }
  .prod { grid-template-columns: 1fr; } .prod .right { justify-content: space-between; }
  .table th, .table td, .log td { padding-left: 14px; padding-right: 14px; }
  .log .src { display: none; }
  .groups { grid-template-columns: 1fr; }
}
.check + .actions, .check + .field { margin-top: 20px; }
.gap-b { margin-bottom: 20px; }
.log td.l { width: 1%; white-space: nowrap; }
.card-pad > h2 + .timeline { margin-top: 18px; }
