/*
 * LDG ESG v4.5.6.1 — UI Critical Recovery
 * Scope: only critical visual defects left after v4.5.6.
 * No grid, routing, DB, CRUD, upload, AI, PDF/DOCX logic changes.
 */
:root{
  --ldg4561-dark:#073b67;
  --ldg4561-dark-2:#05263d;
  --ldg4561-ink:#071f35;
  --ldg4561-muted:#385971;
  --ldg4561-white:#ffffff;
  --ldg4561-soft:#eaf4ff;
  --ldg4561-line:#d7e7f2;
  --ldg4561-lime:#9bd314;
}

/* Sidebar and Access Center: no dark text on dark surfaces. */
html body .ldg40-root .ldg40-sidebar,
html body .ldg40-root .ldg40-sidebar.ldg4561-sidebar-surface{
  color:var(--ldg4561-white)!important;
  -webkit-text-fill-color:var(--ldg4561-white)!important;
}
html body .ldg40-root .ldg40-sidebar :where(h1,h2,h3,h4,h5,h6,strong,b,p,span,small,em,a,li,div,label){
  color:var(--ldg4561-white)!important;
  -webkit-text-fill-color:var(--ldg4561-white)!important;
  text-shadow:none!important;
}
html body .ldg40-root .ldg40-sidebar nav a,
html body .ldg40-root .ldg40-sidebar nav a:visited,
html body .ldg40-root .ldg40-sidebar nav a:hover,
html body .ldg40-root .ldg40-sidebar nav a.active{
  color:var(--ldg4561-white)!important;
  -webkit-text-fill-color:var(--ldg4561-white)!important;
}
html body .ldg40-root .ldg40-sidebar nav a strong,
html body .ldg40-root .ldg40-sidebar nav a small,
html body .ldg40-root .ldg40-sidebar nav a.active strong,
html body .ldg40-root .ldg40-sidebar nav a.active small{
  color:var(--ldg4561-white)!important;
  -webkit-text-fill-color:var(--ldg4561-white)!important;
}
html body .ldg40-root .ldg40-sidebar nav em{
  background:rgba(255,255,255,.14)!important;
  color:var(--ldg4561-white)!important;
  -webkit-text-fill-color:var(--ldg4561-white)!important;
}
html body .ldg40-root .ldg40-sidebar nav a.active em{
  background:var(--ldg4561-lime)!important;
  color:var(--ldg4561-ink)!important;
  -webkit-text-fill-color:var(--ldg4561-ink)!important;
}
html body .ldg40-root .ldg40-sidebar .ldg40-access,
html body .ldg40-root .ldg40-sidebar .ldg4561-access-surface{
  background:rgba(255,255,255,.14)!important;
  border-color:rgba(255,255,255,.28)!important;
  color:var(--ldg4561-white)!important;
  -webkit-text-fill-color:var(--ldg4561-white)!important;
}
html body .ldg40-root .ldg40-sidebar .ldg40-access strong,
html body .ldg40-root .ldg40-sidebar .ldg40-access p{
  color:var(--ldg4561-white)!important;
  -webkit-text-fill-color:var(--ldg4561-white)!important;
}
html body .ldg40-root .ldg40-sidebar .ldg40-access span,
html body .ldg40-root .ldg40-sidebar .ldg40-access span *{
  background:#ffffff!important;
  color:var(--ldg4561-ink)!important;
  -webkit-text-fill-color:var(--ldg4561-ink)!important;
}

/* Hero/state card: always white text on the blue hero surface. */
html body .ldg40-root .ldg40-hero,
html body .ldg40-root .ldg40-hero :where(h1,h2,h3,h4,h5,h6,strong,b,p,span,small,em,div,aside){
  color:var(--ldg4561-white)!important;
  -webkit-text-fill-color:var(--ldg4561-white)!important;
  text-shadow:none!important;
}
html body .ldg40-root .ldg40-hero aside,
html body .ldg40-root .ldg40-hero aside.ldg4561-status-surface{
  background:rgba(255,255,255,.15)!important;
  border-color:rgba(255,255,255,.30)!important;
  color:var(--ldg4561-white)!important;
  -webkit-text-fill-color:var(--ldg4561-white)!important;
}
html body .ldg40-root .ldg40-hero aside *{
  color:var(--ldg4561-white)!important;
  -webkit-text-fill-color:var(--ldg4561-white)!important;
}

/* Dark buttons and summaries. */
html body .ldg40-root :where(.ldg42-action-link,.ldg453-actionbar summary,.ldg42-gold-actionbar summary,.ldg40-switch .ldg42-action-link,.ldg456-dark-control,.ldg441-danger,.ldg441-primary):not(.ldg40-primary),
html body .ldg40-root :where(.ldg42-action-link,.ldg453-actionbar summary,.ldg42-gold-actionbar summary,.ldg40-switch .ldg42-action-link,.ldg456-dark-control,.ldg441-danger,.ldg441-primary):not(.ldg40-primary) *{
  background:var(--ldg4561-dark)!important;
  background-color:var(--ldg4561-dark)!important;
  color:var(--ldg4561-white)!important;
  -webkit-text-fill-color:var(--ldg4561-white)!important;
  border-color:var(--ldg4561-dark)!important;
  text-shadow:none!important;
}
html body .ldg40-root button.ldg40-primary,
html body .ldg40-root .ldg40-primary,
html body .ldg40-root .ldg40-primary *{
  color:var(--ldg4561-ink)!important;
  -webkit-text-fill-color:var(--ldg4561-ink)!important;
}

/* Lifecycle/report chips: dark chips require white text. */
html body .ldg40-root .ldg450-stage > b,
html body .ldg40-root .ldg450-stage b,
html body .ldg40-root .ldg450-report-grid a > b,
html body .ldg40-root .ldg450-report-grid a b,
html body .ldg40-root b.ldg456-chip,
html body .ldg40-root .ldg456-life-chip,
html body .ldg40-root .ldg456-report-chip{
  background:var(--ldg4561-dark)!important;
  background-color:var(--ldg4561-dark)!important;
  color:var(--ldg4561-white)!important;
  -webkit-text-fill-color:var(--ldg4561-white)!important;
  border-color:var(--ldg4561-dark)!important;
  text-shadow:none!important;
}
html body .ldg40-root .ldg450-stage > b *,
html body .ldg40-root .ldg450-report-grid a > b *{
  color:var(--ldg4561-white)!important;
  -webkit-text-fill-color:var(--ldg4561-white)!important;
}

/* Boundary cards: clear light cards only. Remove legacy internal blue bars. */
html body .ldg40-root .ldg450-boundary-grid > article{
  background:#ffffff!important;
  background-color:#ffffff!important;
  background-image:none!important;
  color:var(--ldg4561-ink)!important;
  -webkit-text-fill-color:var(--ldg4561-ink)!important;
  border:1px solid var(--ldg4561-line)!important;
  border-top:4px solid var(--ldg4561-dark)!important;
}
html body .ldg40-root .ldg450-boundary-grid > article :where(h1,h2,h3,h4,h5,h6,strong,b,div,span,p,small,em,label){
  background:transparent!important;
  background-color:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
  text-shadow:none!important;
}
html body .ldg40-root .ldg450-boundary-grid > article :where(h1,h2,h3,h4,h5,h6,strong,b,div,label){
  color:var(--ldg4561-ink)!important;
  -webkit-text-fill-color:var(--ldg4561-ink)!important;
}
html body .ldg40-root .ldg450-boundary-grid > article :where(p,span,small){
  color:var(--ldg4561-muted)!important;
  -webkit-text-fill-color:var(--ldg4561-muted)!important;
}
html body .ldg40-root .ldg450-boundary-grid > article em{
  display:inline-flex!important;
  width:auto!important;
  max-width:max-content!important;
  padding:5px 10px!important;
  border-radius:999px!important;
  background:#eaf4ff!important;
  color:var(--ldg4561-dark)!important;
  -webkit-text-fill-color:var(--ldg4561-dark)!important;
  font-style:normal!important;
}

/* Human metadata replacing machine tokens. */
html body .ldg40-root .ldg4561-human-meta,
html body .ldg40-root .ldg456-human-meta{
  display:block!important;
  margin-top:3px!important;
  color:var(--ldg4561-muted)!important;
  -webkit-text-fill-color:var(--ldg4561-muted)!important;
  font-size:.78rem!important;
  font-weight:600!important;
}

/* Checkbox UX: checkbox next to label, not floating far away. */
html body .ldg40-root label.ldg4561-check,
html body .ldg40-root label.ldg4561-email-toggle,
html body .ldg40-root label.ldg4561-blocking-toggle,
html body .ldg40-root .ldg40-task-form label.ldg40-check,
html body .ldg40-root .ldg43-wizard-form label.ldg40-check,
html body .ldg40-root form label.ldg40-check{
  display:grid!important;
  grid-template-columns:22px minmax(0,1fr)!important;
  gap:12px!important;
  align-items:flex-start!important;
  justify-content:start!important;
  max-width:760px!important;
  width:100%!important;
  margin:14px 0!important;
  padding:12px 14px!important;
  border:1px solid var(--ldg4561-line)!important;
  border-radius:14px!important;
  background:#f8fbfe!important;
  color:var(--ldg4561-ink)!important;
  -webkit-text-fill-color:var(--ldg4561-ink)!important;
}
html body .ldg40-root label.ldg4561-check input,
html body .ldg40-root label.ldg4561-email-toggle input,
html body .ldg40-root label.ldg4561-blocking-toggle input,
html body .ldg40-root form label.ldg40-check input[type="checkbox"]{
  grid-column:1!important;
  width:18px!important;
  height:18px!important;
  margin:2px 0 0 0!important;
  justify-self:start!important;
}
html body .ldg40-root label.ldg4561-check span,
html body .ldg40-root label.ldg4561-email-toggle span,
html body .ldg40-root label.ldg4561-blocking-toggle span{
  grid-column:2!important;
  display:block!important;
  color:var(--ldg4561-ink)!important;
  -webkit-text-fill-color:var(--ldg4561-ink)!important;
}
html body .ldg40-root label.ldg4561-check strong,
html body .ldg40-root label.ldg4561-email-toggle strong,
html body .ldg40-root label.ldg4561-blocking-toggle strong{
  display:block!important;
  color:var(--ldg4561-ink)!important;
  -webkit-text-fill-color:var(--ldg4561-ink)!important;
  font-weight:800!important;
}
html body .ldg40-root label.ldg4561-check small,
html body .ldg40-root label.ldg4561-email-toggle small,
html body .ldg40-root label.ldg4561-blocking-toggle small{
  display:block!important;
  margin-top:5px!important;
  color:var(--ldg4561-muted)!important;
  -webkit-text-fill-color:var(--ldg4561-muted)!important;
  font-weight:500!important;
  line-height:1.45!important;
}

/* Audit trail readability. */
html body .ldg40-root .ldg40-card .ldg4561-audit-event,
html body .ldg40-root .ldg4561-audit-event{
  display:grid!important;
  gap:4px!important;
  padding:12px 14px!important;
  border:1px solid var(--ldg4561-line)!important;
  border-radius:14px!important;
  background:#f8fbfe!important;
  color:var(--ldg4561-ink)!important;
}
html body .ldg40-root .ldg4561-audit-event strong{color:var(--ldg4561-ink)!important;-webkit-text-fill-color:var(--ldg4561-ink)!important;}
html body .ldg40-root .ldg4561-audit-event small{color:var(--ldg4561-muted)!important;-webkit-text-fill-color:var(--ldg4561-muted)!important;}

@media (max-width: 900px){
  html body .ldg40-root label.ldg4561-check,
  html body .ldg40-root label.ldg4561-email-toggle,
  html body .ldg40-root label.ldg4561-blocking-toggle,
  html body .ldg40-root form label.ldg40-check{max-width:100%!important;}
}
