/* Engineering portal — the SDLC control tower.

   EVERY selector is scoped under `.eng`, the precedent set by `.ppd` for the
   Performance desk. The rule matters: this stylesheet is loaded on every page of
   the host, so a bare `table` or `button` rule here would restyle Matters,
   Coverage and the Access list too. Tokens come from the Law&Crime design system
   (vendor/design/styles.css); nothing below re-declares a brand hex.

   Unlike Performance, this surface is light-only and sits in the host's normal
   content chrome — it is a work queue inside the app, not a board that takes over
   the pane, so it does not bleed its own background out over `.content`. */

.eng { font-size: 13.5px; }

.eng .eng-head-right { display: flex; align-items: center; gap: 8px; }

/* ---- identity banner ---------------------------------------------------- */
.eng-ident {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin: 12px 0 16px;
  border: 1px solid var(--border-hair); border-radius: 10px;
  background: var(--lc-paper-2); font-size: 13px;
}
.eng-ident i { width: 16px; height: 16px; flex: none; }
.eng-ident span { flex: 1; }
/* Unlinked is the state that makes every button dead, so it gets the tape edge —
   it is a "do this first", not a warning about something broken. */
.eng-ident--warn { border-left: 4px solid var(--lc-yellow); }
.eng-ident--ok { color: var(--text-muted); }

.eng-linkbtn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-hair); border-radius: 8px;
  background: transparent; color: var(--lc-ink);
  font-family: var(--font-text); font-size: 12.5px; padding: 5px 10px; cursor: pointer;
}
.eng-linkbtn:hover { background: var(--lc-paper); }
.eng-linkbtn i { width: 14px; height: 14px; }

/* ---- tiles + ingest health ---------------------------------------------- */
.eng-tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 14px;
}
.eng-health {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted);
  padding: 8px 12px; margin-bottom: 16px;
  background: var(--lc-paper-2); border: 1px solid var(--border-hair); border-radius: 8px;
}
.eng-health i { width: 14px; height: 14px; }
.eng-health--bad { color: var(--lc-red); border-color: var(--lc-red); }

/* ---- the queue table ---------------------------------------------------- */
/* Wide by nature — eight columns of state. It scrolls inside its own box so the
   page never scrolls sideways. */
.eng-tablewrap { overflow-x: auto; margin-top: 10px; }
.eng-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.eng-table th {
  text-align: left; font-family: var(--font-display); font-weight: 400;
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); padding: 6px 10px; border-bottom: 1px solid var(--border-hair);
  white-space: nowrap;
}
.eng-table td { padding: 9px 10px; border-bottom: 1px solid var(--border-hair); vertical-align: middle; }
.eng-table tr.eng-row:hover { background: var(--lc-paper-2); }
.eng-c-repo { white-space: nowrap; color: var(--text-muted); }
.eng-c-title { min-width: 280px; }
.eng-c-title a { color: var(--lc-ink); text-decoration: none; font-weight: 600; }
.eng-c-title a:hover { text-decoration: underline; }
.eng-c-act { white-space: nowrap; text-align: right; }

/* 48h open with nobody asked to review: the queue stalling, which is the exact
   failure this portal exists to make visible. */
.eng-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--lc-red); margin-right: 6px; vertical-align: middle;
}
.eng-row--stale .eng-c-title a { color: var(--lc-red); }

.eng-enh, .eng-draft {
  display: inline-block; margin-left: 8px; padding: 1px 6px; border-radius: 4px;
  font-size: 11px; letter-spacing: .02em; background: var(--lc-paper-2);
  border: 1px solid var(--border-hair); color: var(--text-muted);
}

/* ---- tier, checks, reviewers -------------------------------------------- */
.eng-tier {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  font-family: var(--font-display); font-size: 12px; letter-spacing: .04em;
  border: 1px solid var(--border-hair);
}
.eng-tier--t1 { background: var(--lc-paper-2); color: var(--text-body); }
.eng-tier--t2 { background: var(--lc-yellow); color: #000; border-color: var(--lc-yellow); }
/* Not an error state — an unset tier means the author has not said how risky this
   is, which is a thing to ask for, not a thing that failed. */
.eng-tier--none { color: var(--text-muted); border-style: dashed; }

.eng-checks, .eng-rev { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12.5px; }
.eng-checks i, .eng-rev i { width: 14px; height: 14px; }
.eng-checks--good { color: var(--lc-green-700, #2e7d32); }
.eng-checks--bad { color: var(--lc-red); }
.eng-checks--wait { color: var(--text-muted); }
.eng-rev { color: var(--text-muted); }
.eng-rev--ok { color: var(--lc-green-700, #2e7d32); }
.eng-rev--bad { color: var(--lc-red); }
.eng-rev--none { color: var(--lc-red); }

/* ---- the action button -------------------------------------------------- */
/* One button per row, and it is the server's verdict rendered — never a decision
   made here. Approve and Merge carry the tape, because they are the two clicks
   that change `main`; Update branch is quieter because it is a step on the way. */
.eng-act {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-display); font-size: 13px; letter-spacing: .05em;
  padding: 5px 12px; border-radius: 7px; border: 1px solid var(--lc-ink);
  background: var(--lc-yellow); color: #000; cursor: pointer;
}
.eng-act i { width: 14px; height: 14px; }
.eng-act--update_branch { background: transparent; color: var(--lc-ink); }
.eng-act--off, .eng-act:disabled {
  background: transparent; color: var(--text-muted);
  border-color: var(--border-hair); cursor: not-allowed;
}
.eng-icon {
  border: none; background: none; color: var(--text-muted);
  cursor: pointer; padding: 4px; margin-left: 2px;
}
.eng-icon:hover { color: var(--lc-ink); }
.eng-icon i { width: 15px; height: 15px; }
.eng-icon:disabled { opacity: .4; cursor: not-allowed; }

/* ---- the "why" drawer --------------------------------------------------- */
.eng-detail td { background: var(--lc-paper-2); }
.eng-detail__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 4px 2px 8px; }
.eng-detail__h {
  font-family: var(--font-display); font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px;
}
.eng-detail__reason { margin: 0 0 8px; font-size: 13px; }
.eng-blocked { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text-muted); }
.eng-blocked li { margin-bottom: 3px; }
.eng-kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 12.5px; }
.eng-kv dt { color: var(--text-muted); }
.eng-kv dd { margin: 0; }
.eng-kv code, .eng-commits code { font-size: 12px; background: var(--lc-paper); padding: 1px 4px; border-radius: 3px; }

/* ---- repos -------------------------------------------------------------- */
.eng-repos { display: grid; gap: 14px; }
.eng-repo__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.eng-repo__name { font-family: var(--font-display); font-size: 17px; color: var(--lc-ink); text-decoration: none; }
.eng-repo__name:hover { text-decoration: underline; }
.eng-repo__meta { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.eng-repo__rules { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.eng-rule { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.eng-rule i { width: 14px; height: 14px; }
.eng-rule--on { color: var(--lc-green-700, #2e7d32); }
/* An unprotected repo is stated plainly rather than styled as an alarm: msa-app
   is deliberately ungated today, and the portal simply will not offer a merge. */
.eng-rule--off { color: var(--text-muted); }

.eng-commits { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.eng-commits li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 4px 0; border-top: 1px solid var(--border-hair);
}
.eng-commits a { text-decoration: none; }
.eng-commits__msg { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eng-commits__by, .eng-commits__at, .eng-commits__pr { color: var(--text-muted); white-space: nowrap; }

.eng-empty { padding: 18px 2px; color: var(--text-muted); font-size: 13px; }

@media (max-width: 900px) {
  .eng-detail__grid { grid-template-columns: 1fr; gap: 14px; }
}
