:root {
  --bg: #f4f6f8;
  --surface: #fff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f6;
  --ink: #17202a;
  --muted: #667085;
  --soft: #98a2b3;
  --line: #d8dee7;
  --nav: #14202b;
  --nav-2: #101a23;
  --blue: #2563eb;
  --cyan: #0891b2;
  --green: #15803d;
  --amber: #b45309;
  --red: #b42318;
  --purple: #6d28d9;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .04);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  --bg: #101820;
  --surface: #162231;
  --surface-2: #111b26;
  --surface-3: #203044;
  --ink: #eef4fb;
  --muted: #a9b6c7;
  --soft: #8290a2;
  --line: #2f4054;
  --nav: #0c141d;
  --nav-2: #091018;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  margin: 0 !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.45;
}

body.admin-bar .lg2-nav,
body.admin-bar .lg2-topbar {
  top: 32px;
}

button,
input {
  font: inherit;
}

button,
.lg2-topbar a {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.lg2-primary {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

a {
  color: var(--blue);
}

.lg2-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}

.lg2-login__brand {
  background: #14202b;
  display: grid;
  place-items: center;
  padding: 42px;
}

.lg2-login__brand img {
  max-width: min(420px, 72vw);
  height: auto;
}

.lg2-login__form {
  display: grid;
  place-items: center;
  padding: 42px;
}

.lg2-card,
.lg2-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.lg2-signin {
  width: min(420px, 100%);
  padding: 26px;
  display: grid;
  gap: 16px;
}

.lg2-signin h1,
.lg2-page-head h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.18;
  font-weight: 650;
  letter-spacing: 0;
}

.lg2-signin p,
.lg2-page-head p {
  margin: 0;
  color: var(--muted);
}

.lg2-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 750;
}

.lg2-signin label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 650;
}

.lg2-signin input,
.lg2-topbar input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
}

.lg2-check {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.lg2-check input {
  width: auto;
  min-height: auto;
}

.lg2-alert {
  border: 1px solid #e8b7b2;
  background: #fff7f6;
  color: var(--red);
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 650;
}

.lg2-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}

.lg2-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: var(--nav);
  color: #d7dee8;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lg2-brand {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: center;
}

.lg2-brand > span {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #5b8def;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.lg2-brand strong {
  display: block;
  color: #fff;
  letter-spacing: .12em;
  font-size: 13px;
}

.lg2-brand em {
  display: block;
  color: #93a4b8;
  font-size: 12px;
  font-style: normal;
}

.lg2-nav nav {
  display: grid;
  gap: 18px;
}

.lg2-nav section {
  display: grid;
  gap: 6px;
}

.lg2-nav p {
  margin: 0;
  color: #8d9bae;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-weight: 750;
  padding: 8px 8px 4px;
}

.lg2-nav button {
  border: 0;
  min-height: 36px;
  justify-content: space-between;
  background: transparent;
  color: #cbd5e1;
  border-radius: 8px;
  padding: 0 10px;
}

.lg2-nav button.is-active {
  background: #2b4058;
  color: #fff;
  box-shadow: inset 3px 0 0 #38bdf8;
}

.lg2-nav small {
  color: #91a1b5;
  font-weight: 750;
}

.lg2-nav-note {
  margin-top: auto;
  border: 1px solid #2b4058;
  border-radius: 8px;
  padding: 12px;
  color: #9fb0c3;
  background: rgba(255, 255, 255, .03);
}

.lg2-main {
  min-width: 0;
}

.lg2-topbar {
  min-height: 70px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 22px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.lg2-topbar > div {
  display: flex;
  gap: 8px;
  align-items: center;
}

.lg2-notice {
  margin: 16px 24px 0;
  border: 1px solid #b7dfc2;
  background: #f0fbf3;
  color: var(--green);
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 650;
}

.lg2-view {
  display: none;
  padding: 24px;
  gap: 18px;
}

.lg2-view.is-active {
  display: grid;
}

.lg2-page-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
}

.lg2-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lg2-seg {
  display: inline-flex;
  gap: 2px;
  background: var(--surface-3);
  border-radius: 8px;
  padding: 3px;
}

.lg2-seg button {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: 12px;
}

.lg2-seg button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .1);
}

.lg2-rollup {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
}

.lg2-rollup article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 15px;
  min-height: 94px;
}

.lg2-rollup span,
.lg2-section-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.lg2-rollup strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  line-height: 1;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.lg2-rollup em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-style: normal;
}

.lg2-section-title {
  margin: 4px 0 -4px;
}

.lg2-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
}

.lg2-portfolio-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px 16px;
  min-height: 238px;
  box-shadow: var(--shadow);
}

.lg2-portfolio-card header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.lg2-port-dot {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--green);
  flex: none;
}

.lg2-port-dot-blue { background: var(--blue); }
.lg2-port-dot-cyan { background: var(--cyan); }
.lg2-port-dot-green { background: var(--green); }
.lg2-port-dot-amber { background: var(--amber); }
.lg2-port-dot-red { background: var(--red); }
.lg2-port-dot-purple { background: var(--purple); }

.lg2-portfolio-card header strong {
  font-size: 14px;
  font-weight: 650;
}

.lg2-portfolio-card header em {
  margin-left: auto;
  background: var(--surface-3);
  color: var(--muted);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 750;
  text-transform: capitalize;
}

.lg2-port-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.lg2-port-value strong {
  font-size: 22px;
  line-height: 1;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.lg2-port-value span,
.lg2-portfolio-card p {
  color: var(--muted);
}

.lg2-portfolio-card p {
  min-height: 42px;
  margin: 0 0 10px;
}

.lg2-portfolio-card dl {
  margin: 0;
  border-top: 1px solid var(--line);
}

.lg2-portfolio-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.lg2-portfolio-card dt {
  color: var(--muted);
}

.lg2-portfolio-card dd {
  margin: 0;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.lg2-mandate-line {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
  margin-top: 12px;
  overflow: hidden;
}

.lg2-mandate-line span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: var(--green);
}

.lg2-portfolio-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 650;
}

.lg2-empty-state {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 32px;
  box-shadow: var(--shadow);
}

.lg2-empty-state h2 {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 650;
}

.lg2-empty-state p {
  max-width: 620px;
  margin: 0 0 18px;
  color: var(--muted);
}

.lg2-form-shell {
  display: grid;
  gap: 18px;
}

.lg2-field-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lg2-field-grid label {
  display: grid;
  gap: 6px;
}

.lg2-field-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.lg2-field-grid input,
.lg2-field-grid select,
.lg2-field-grid textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 11px;
  font: inherit;
}

.lg2-field-grid textarea {
  resize: vertical;
}

.lg2-span-2 {
  grid-column: span 2;
}

.lg2-demo-actions {
  padding: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.lg2-demo-actions p {
  flex: 1 1 420px;
  margin: 0;
  color: var(--muted);
}

.lg2-demo-actions form {
  margin: 0;
}

.lg2-dashboard-bottom {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
}

.lg2-allocation-empty,
.lg2-attention-list {
  padding: 14px 15px;
}

.lg2-allocation-empty p,
.lg2-attention-list p {
  margin: 0;
  color: var(--muted);
}

.lg2-allocation-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 64px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.lg2-allocation-row span {
  color: var(--muted);
}

.lg2-allocation-row div {
  height: 9px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.lg2-allocation-row i {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
}

.lg2-allocation-row strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.lg2-attention-list div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.lg2-attention-list div:last-child {
  border-bottom: 0;
}

.lg2-attention-list div span {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #fbedd6;
}

.lg2-attention-list strong {
  font-weight: 650;
}

.lg2-attention-list em {
  color: var(--muted);
  font-style: normal;
}

.lg2-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.lg2-metrics article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-height: 92px;
}

.lg2-metrics span {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 11px;
  font-weight: 750;
}

.lg2-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.lg2-metrics em {
  display: block;
  color: var(--muted);
  margin-top: 8px;
  font-style: normal;
}

.lg2-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 32px;
}

.lg2-empty h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 650;
}

.lg2-empty p {
  margin: 0;
  color: var(--muted);
  max-width: 620px;
}

.lg2-empty-small {
  min-height: 180px;
  color: var(--muted);
}

.lg2-panel {
  overflow: hidden;
}

.lg2-panel > header {
  min-height: 52px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.lg2-panel h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 650;
}

.lg2-panel header p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 750;
}

.lg2-table-wrap {
  overflow: auto;
}

.lg2-table-wrap table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.lg2-table-wrap th,
.lg2-table-wrap td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.lg2-table-wrap th {
  background: #f3f1ee;
  color: #7b8491;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 750;
}

:root[data-theme="dark"] .lg2-table-wrap th {
  background: #203044;
  color: #b8c3d2;
}

.lg2-table-wrap .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.lg2-datasheet table {
  min-width: 1200px;
}

.lg2-empty-row {
  min-height: 150px;
  display: grid;
  place-items: center;
  gap: 6px;
  text-align: center;
}

.lg2-empty-row strong {
  font-size: 16px;
  font-weight: 650;
}

.lg2-empty-row span {
  color: var(--muted);
}

.lg2-row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.lg2-row-actions button {
  min-height: 30px;
  padding: 0 10px;
}

.lg2-schema-map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  padding: 16px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--surface-2);
  background-size: 34px 34px;
}

.lg2-schema-tables {
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: 14px;
  align-content: start;
}

.lg2-schema-table {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.lg2-schema-table header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f3f1ee;
  display: grid;
  gap: 2px;
}

:root[data-theme="dark"] .lg2-schema-table header {
  background: #203044;
}

.lg2-schema-table strong {
  font-weight: 650;
}

.lg2-schema-table code {
  color: var(--muted);
  font-size: 11px;
}

.lg2-schema-table p {
  margin: 0;
  min-height: 30px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.lg2-schema-table p:last-child {
  border-bottom: 0;
}

.lg2-schema-table span {
  min-height: 20px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 750;
}

.lg2-schema-table span.is-primary_key {
  background: #e0f2fe;
  color: #0369a1;
}

.lg2-schema-table span.is-foreign_key {
  background: #ecfdf3;
  color: #166534;
}

.lg2-schema-table em {
  color: var(--ink);
  font-style: normal;
  overflow-wrap: anywhere;
}

.lg2-rel-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  align-self: start;
  overflow: hidden;
}

.lg2-rel-list h3 {
  margin: 0;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 650;
  border-bottom: 1px solid var(--line);
}

.lg2-rel-list section {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 4px;
}

.lg2-rel-list section:last-child {
  border-bottom: 0;
}

.lg2-rel-list strong {
  font-weight: 650;
}

.lg2-rel-list span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 750;
}

.lg2-rel-list p {
  margin: 4px 0 0;
  color: var(--muted);
}

.lg2-relationship-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
}

.lg2-canvas {
  position: relative;
  min-height: 620px;
  min-width: 960px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--surface-2);
  background-size: 34px 34px;
  overflow: auto;
}

.lg2-blank-canvas {
  min-height: 560px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 32px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--surface-2);
  background-size: 34px 34px;
}

.lg2-blank-canvas h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 650;
}

.lg2-blank-canvas p {
  margin: 0;
  max-width: 520px;
  color: var(--muted);
}

.lg2-table-box {
  position: absolute;
  width: 230px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.lg2-table-box header {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  background: #f3f1ee;
  border-bottom: 1px solid var(--line);
}

:root[data-theme="dark"] .lg2-table-box header {
  background: #203044;
}

.lg2-table-box header strong {
  font-weight: 700;
}

.lg2-table-box header span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 750;
}

.lg2-table-box p {
  margin: 0;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.lg2-table-box p:last-child {
  border-bottom: 0;
}

.lg2-table-box b,
.lg2-table-box i {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 10px;
  font-style: normal;
}

.lg2-table-box em {
  color: var(--soft);
  font-size: 11px;
  font-style: normal;
}

.lg2-table-box.portfolios { left: 35px; top: 54px; border-color: #8bb4ff; }
.lg2-table-box.holdings { left: 365px; top: 54px; }
.lg2-table-box.transactions { left: 695px; top: 54px; }
.lg2-table-box.entities { left: 35px; top: 350px; }
.lg2-table-box.shareholders { left: 365px; top: 350px; }

.lg2-rel-line {
  position: absolute;
  height: 2px;
  background: #7b8491;
  transform-origin: left center;
}

.lg2-rel-line.is-selected {
  height: 3px;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.lg2-rel-line:before,
.lg2-rel-line:after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.lg2-rel-line:before { left: -4px; }
.lg2-rel-line:after { right: -4px; }
.lg2-rel-line.rel-a { left: 265px; top: 132px; width: 100px; }
.lg2-rel-line.rel-b { left: 595px; top: 132px; width: 100px; }
.lg2-rel-line.rel-c { left: 265px; top: 426px; width: 100px; }

.lg2-rel-label {
  position: absolute;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.lg2-rel-label.label-a { left: 280px; top: 103px; }
.lg2-rel-label.label-b { left: 610px; top: 103px; }
.lg2-rel-label.label-c { left: 285px; top: 397px; }

.lg2-inspector {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.lg2-inspector section {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.lg2-inspector strong {
  font-weight: 650;
}

.lg2-inspector span {
  color: var(--muted);
}

.lg2-form-grid {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
}

.lg2-about > div {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.lg2-about span {
  color: var(--muted);
}

.lg2-command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 1160px) {
  .lg2-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lg2-rollup {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lg2-portfolio-grid,
  .lg2-dashboard-bottom {
    grid-template-columns: 1fr;
  }

  .lg2-relationship-layout,
  .lg2-form-grid,
  .lg2-schema-map {
    grid-template-columns: 1fr;
  }

  .lg2-schema-tables {
    grid-template-columns: repeat(2, minmax(210px, 1fr));
  }
}

@media (max-width: 760px) {
  body.admin-bar .lg2-nav,
  body.admin-bar .lg2-topbar {
    top: 0;
  }

  .lg2-login,
  .lg2-app {
    grid-template-columns: 1fr;
  }

  .lg2-login__brand {
    min-height: 38vh;
  }

  .lg2-nav,
  .lg2-topbar {
    position: static;
    height: auto;
  }

  .lg2-topbar,
  .lg2-page-head {
    grid-template-columns: 1fr;
  }

  .lg2-topbar > div,
  .lg2-actions {
    justify-content: stretch;
  }

  .lg2-topbar a,
  .lg2-topbar button,
  .lg2-actions button {
    flex: 1;
  }

  .lg2-view {
    padding: 14px;
  }

  .lg2-metrics {
    grid-template-columns: 1fr;
  }

  .lg2-rollup,
  .lg2-portfolio-grid {
    grid-template-columns: 1fr;
  }

  .lg2-allocation-row {
    grid-template-columns: 1fr;
  }

  .lg2-field-grid,
  .lg2-span-2 {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .lg2-schema-tables {
    grid-template-columns: 1fr;
  }
}

.lg2-nav-child {
  padding-left: 28px !important;
  color: #a8b6c7 !important;
  font-size: 12.5px;
}

.lg2-page-head-dashboard {
  margin-bottom: -2px;
}

.lg2-portfolio-card-button {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.lg2-portfolio-card-button:hover,
.lg2-portfolio-card-button:focus-visible {
  border-color: #7aa7ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .14), var(--shadow);
  outline: 0;
}

.lg2-mandate-meter {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  margin-top: 12px;
  overflow: visible;
}

.lg2-mandate-meter span {
  display: block;
  width: var(--value);
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.lg2-mandate-meter i {
  position: absolute;
  top: -5px;
  left: var(--target);
  width: 2px;
  height: 18px;
  background: var(--ink);
  opacity: .72;
}

.lg2-portfolio-card small.is-green { color: var(--green); }
.lg2-portfolio-card small.is-amber { color: var(--amber); }
.lg2-portfolio-card small.is-blue { color: var(--blue); }
.lg2-portfolio-card small.is-muted { color: var(--muted); }

.lg2-allocation-stack-wrap {
  padding: 16px;
}

.lg2-allocation-stack-wrap p {
  margin: 0;
  color: var(--muted);
}

.lg2-stack {
  min-height: 34px;
  display: flex;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-3);
}

.lg2-stack span {
  display: grid;
  place-items: center;
  min-width: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.lg2-stack-green,
.lg2-stack-legend i.lg2-port-dot-green { background: var(--green); }
.lg2-stack-blue,
.lg2-stack-legend i.lg2-port-dot-blue { background: var(--blue); }
.lg2-stack-cyan,
.lg2-stack-legend i.lg2-port-dot-cyan { background: var(--cyan); }
.lg2-stack-amber,
.lg2-stack-legend i.lg2-port-dot-amber { background: var(--amber); }
.lg2-stack-purple,
.lg2-stack-legend i.lg2-port-dot-purple { background: var(--purple); }
.lg2-stack-red,
.lg2-stack-legend i.lg2-port-dot-red { background: var(--red); }

.lg2-stack-legend {
  display: flex;
  gap: 12px 18px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.lg2-stack-legend button {
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.lg2-stack-legend i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.lg2-stack-legend span {
  color: var(--soft);
}

.lg2-record-view.is-active {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0;
  padding: 0;
}

.lg2-record-rail {
  min-height: calc(100vh - 70px);
  background: var(--nav-2);
  color: #cbd5e1;
  padding: 18px 14px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.lg2-link-button {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: #63a7ff;
  padding: 0;
  justify-content: flex-start;
}

.lg2-record-card {
  border-bottom: 1px solid #2b4058;
  padding: 8px 4px 16px;
  display: grid;
  gap: 8px;
}

.lg2-record-card h2 {
  margin: 0;
  color: #fff;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 650;
}

.lg2-record-card p {
  margin: 0;
  color: #91a1b5;
}

.lg2-record-card strong {
  color: #fff;
  font-size: 18px;
  font-weight: 650;
}

.lg2-record-tabs {
  display: grid;
  gap: 4px;
}

.lg2-record-tabs button {
  border: 0;
  min-height: 36px;
  justify-content: flex-start;
  background: transparent;
  color: #cbd5e1;
  padding: 0 10px;
}

.lg2-record-tabs button.is-active {
  background: #2b4058;
  color: #fff;
}

.lg2-record-main {
  min-width: 0;
  padding: 22px 26px 34px;
  display: grid;
  gap: 18px;
}

.lg2-record-top {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  box-shadow: var(--shadow);
}

.lg2-record-top p,
.lg2-record-top span {
  margin: 0;
  color: var(--muted);
}

.lg2-record-top h1 {
  margin: 2px 0 2px;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 650;
}

.lg2-danger,
.lg2-danger-soft {
  border-color: #f0bbb7;
  background: #fff8f7;
  color: var(--red);
}

.lg2-danger-soft {
  min-height: 30px;
  padding: 0 10px;
}

:root[data-theme="dark"] .lg2-danger,
:root[data-theme="dark"] .lg2-danger-soft {
  background: #2c191a;
}

.lg2-record-tab,
.lg2-edit-panel,
.lg2-holding-record {
  display: none;
}

.lg2-record-tab.is-active {
  display: grid;
  gap: 18px;
}

.lg2-edit-panel.is-open {
  display: grid;
}

.lg2-panel.lg2-edit-panel.is-open,
.lg2-holding-record.is-open {
  display: block;
}

.lg2-record-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.lg2-kpi-grid,
.lg2-holding-summary {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.lg2-kpi-grid article,
.lg2-holding-summary article {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
}

.lg2-kpi-grid span,
.lg2-holding-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 750;
}

.lg2-kpi-grid strong,
.lg2-holding-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 17px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.lg2-panel-body {
  padding: 16px;
  color: var(--muted);
}

.lg2-panel-body p {
  margin: 0 0 12px;
}

.lg2-panel-body small {
  display: block;
  margin-top: 10px;
}

.lg2-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.lg2-create-flow {
  display: grid;
  gap: 16px;
}

.lg2-subform-table .lg2-table-link {
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
}

.lg2-subform-table small {
  color: var(--muted);
}

.lg2-row-actions form {
  margin: 0;
}

.lg2-two-col {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 0;
}

.lg2-fact-list {
  margin: 12px 0 0;
  display: grid;
  gap: 0;
}

.lg2-fact-list div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.lg2-fact-list dt {
  color: var(--muted);
}

.lg2-fact-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 1180px) {
  .lg2-record-view.is-active {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .lg2-kpi-grid,
  .lg2-holding-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .lg2-record-view.is-active,
  .lg2-record-top,
  .lg2-record-grid,
  .lg2-two-col {
    grid-template-columns: 1fr;
  }

  .lg2-record-rail {
    min-height: 0;
  }

  .lg2-record-main {
    padding: 16px;
  }

  .lg2-kpi-grid,
  .lg2-holding-summary {
    grid-template-columns: 1fr;
  }
}
