:root {
  --bg: #0c1117;
  --bg-elev: #141b23;
  --bg-soft: #1b2530;
  --line: #2a3948;
  --text: #edf3fb;
  --muted: #9eb0c7;
  --accent: #2c95ff;
  --accent-2: #4ebf9d;
  --ok: #34c38f;
  --warn: #f0b14a;
  --bad: #ef6d6d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: #121922;
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-main {
  display: grid;
  gap: 14px;
  min-height: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.brand img {
  width: 42px;
  height: 42px;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.user-panel {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #151f2a;
  border-radius: 6px;
}

.user-panel strong {
  font-size: 12px;
  color: var(--muted);
}

.user-panel span {
  font-size: 13px;
}

.build-stamp {
  font-size: 11px;
  color: var(--muted);
}

.view-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-banner {
  margin-bottom: 16px;
  border: 1px solid #6b4d1f;
  background: rgba(153, 106, 24, 0.16);
  color: #ffd98a;
  border-radius: 8px;
  padding: 12px 14px;
  line-height: 1.45;
}

.mode-banner strong {
  display: block;
  color: #fff2c6;
  margin-bottom: 4px;
}

.mode-banner a {
  color: #fff2c6;
}

.view-toggle button {
  background: transparent;
  border-color: #35506d;
  color: #b8cce3;
}

.view-toggle button.active {
  background: #24415e;
  color: #fff;
}

.nav {
  display: grid;
  gap: 14px;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-group-label {
  margin: 0;
  padding: 0 10px;
  color: #61728a;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 13px;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
  border-color: #365578;
  background: #1a2634;
}

.main {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-elev);
  padding: 12px 14px;
}

.topbar h2 {
  margin: 0;
  font-size: 20px;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-strip {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101722;
  padding: 8px 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.action-strip span {
  color: var(--muted);
  font-size: 12px;
}

.topbar-meta {
  display: none;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.range-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #181e2a;
}

.range-toggle button {
  min-width: 48px;
  border: 0;
  border-right: 1px solid #2a3241;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

.range-toggle button:last-child {
  border-right: 0;
}

.range-toggle button.active {
  background: #5569ff;
  color: #fff;
}

.utility-actions {
  display: flex;
  gap: 8px;
}

.utility-btn {
  min-width: 62px;
  height: 36px;
  border-radius: 10px;
  padding: 0;
  display: grid;
  place-items: center;
  background: #181e2a;
  border-color: #2f3848;
  color: #c8d2e1;
}

button {
  border: 1px solid #3c5f87;
  background: #1f4d7a;
  color: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
}

button:hover {
  background: #2566a4;
}

button.loading {
  opacity: 0.75;
  cursor: wait;
}

.toast-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 8px;
  z-index: 9999;
}

.toast {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1722;
  padding: 10px 12px;
  min-width: 220px;
  color: #dbe6f5;
  font-size: 12px;
}

.toast.error {
  border-color: #b14b4b;
}

.detail-modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 18, 0.78);
  display: grid;
  place-items: center;
  z-index: 10000;
  padding: 16px;
}

.detail-card {
  width: min(760px, 96vw);
  max-height: 86vh;
  overflow: auto;
  border: 1px solid #324a67;
  border-radius: 10px;
  background: #0f1824;
  padding: 12px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.detail-body {
  font-size: 12px;
  color: #d6e4f5;
  line-height: 1.45;
}

.info-dot {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #426385;
  color: #bcd6f5;
  font-size: 10px;
  cursor: pointer;
}

.command-strip {
  display: grid;
  grid-template-columns: minmax(320px, 1.8fr) repeat(3, minmax(150px, 0.7fr));
  gap: 10px;
}

.command-strip article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, #172231, #111922);
  padding: 14px;
  min-height: 104px;
}

.command-primary {
  background:
    linear-gradient(145deg, rgba(44, 149, 255, 0.2), rgba(78, 191, 157, 0.08)),
    #131c26 !important;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.command-strip h3 {
  margin: 0;
  font-size: 24px;
}

.command-strip p,
.command-strip small {
  display: block;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.command-strip strong {
  display: block;
  font-size: 28px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.kpis article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #17202a, #121922);
  padding: 12px;
  min-height: 112px;
}

.kpis h3 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.kpis p {
  margin: 7px 0 0;
  font-size: 24px;
  font-weight: 700;
}

.kpis span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-elev);
  padding: 12px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-head h3,
h4 {
  margin: 0;
}

.panel-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.role-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.role-tabs button {
  background: transparent;
  border-color: #35506d;
  color: #b8cce3;
}

.role-tabs button.active {
  background: #24415e;
  color: #fff;
}

.role-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.role-title strong {
  font-size: 16px;
}

.role-title span {
  color: var(--muted);
  font-size: 13px;
}

.role-summary {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.metric {
  border: 1px solid #2f4053;
  border-radius: 6px;
  background: var(--bg-soft);
  padding: 8px;
}

.metric-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}

.tag {
  border: 1px solid #426385;
  color: #bcd6f5;
  border-radius: 999px;
  font-size: 10px;
  padding: 2px 6px;
}

.metric-value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 6px;
}

.source-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.role-body {
  overflow: hidden;
}

.visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.visual-panel {
  border: 1px solid #2d4054;
  border-radius: 8px;
  background: #111923;
  padding: 12px;
  min-height: 280px;
}

.visual-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.visual-head h4 {
  font-size: 14px;
}

.visual-head span,
.visual-head em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.bar-list {
  display: grid;
  gap: 11px;
}

.bar-row {
  display: grid;
  gap: 5px;
}

.clickable-data {
  cursor: pointer;
}

.clickable-data:hover {
  opacity: 0.94;
}

.bar-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #dbe8f7;
  font-size: 12px;
}

.bar-row-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row-head strong {
  flex: 0 0 auto;
}

.bar-track {
  height: 9px;
  border-radius: 999px;
  background: #223041;
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.bar-track.status-warning span {
  background: linear-gradient(90deg, var(--warn), #e6d26a);
}

.bar-track.status-critical span {
  background: linear-gradient(90deg, var(--bad), #d89292);
}

.risk-matrix {
  display: grid;
  grid-template-columns: 70px repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.risk-matrix span {
  color: var(--muted);
  font-size: 11px;
  align-self: center;
}

.risk-matrix strong {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid #30465d;
  border-radius: 8px;
  background: #182331;
  font-size: 20px;
}

.risk-matrix strong.warm {
  background: rgba(240, 177, 74, 0.18);
  border-color: rgba(240, 177, 74, 0.45);
}

.risk-matrix strong.hot {
  background: rgba(239, 109, 109, 0.2);
  border-color: rgba(239, 109, 109, 0.5);
}

.unavailable {
  min-height: 190px;
  border: 1px dashed #3c5066;
  border-radius: 8px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.unavailable strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.grid.two .wide {
  grid-column: 1 / -1;
}

.evidence-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.source-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 10px;
}

.source-card {
  border: 1px solid #2d4054;
  border-radius: 8px;
  background: #111923;
  padding: 12px;
  display: grid;
  gap: 12px;
  min-height: 330px;
}

.source-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.source-card h4 {
  font-size: 14px;
  line-height: 1.25;
}

.source-card-head span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.source-card-head strong {
  flex: 0 0 auto;
  font-size: 11px;
}

.source-visual {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 12px;
  align-items: center;
}

.source-ring {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 8px solid rgba(240, 177, 74, 0.3);
  display: grid;
  place-items: center;
  color: var(--warn);
  font-size: 12px;
  font-weight: 700;
}

.source-ring.healthy {
  border-color: rgba(52, 195, 143, 0.75);
  color: var(--ok);
}

.source-ring.warning {
  border-color: rgba(240, 177, 74, 0.72);
  color: var(--warn);
}

.source-ring.critical {
  border-color: rgba(255, 93, 108, 0.72);
  color: var(--danger);
}

.source-visual p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.source-visual small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.source-facts {
  display: grid;
  gap: 9px;
  margin: 0;
}

.source-facts div {
  border-top: 1px solid #283646;
  padding-top: 8px;
}

.source-facts dt {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.source-facts dd {
  margin: 3px 0 0;
  font-size: 11px;
  line-height: 1.35;
}

.muted {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.phase-list {
  display: grid;
  gap: 8px;
}

.phase-item {
  border: 1px solid #2f4259;
  border-radius: 6px;
  padding: 8px;
  background: var(--bg-soft);
}

.phase-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #243345;
  margin-top: 6px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2c95ff, #4ebf9d);
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  border-bottom: 1px solid #283646;
  padding: 7px 0;
}

.status-row span {
  color: var(--muted);
}

form {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

label {
  display: grid;
  gap: 5px;
  font-size: 12px;
}

input {
  border: 1px solid #36506d;
  background: #101923;
  color: #f1f6ff;
  border-radius: 6px;
  padding: 7px;
}

select {
  border: 1px solid #36506d;
  background: #101923;
  color: #f1f6ff;
  border-radius: 6px;
  padding: 7px;
}

.inline-form {
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
}

.registry-toolbar {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.asset-row {
  cursor: pointer;
}

.asset-row.active {
  background: #1a2634;
}

.asset-detail {
  margin-top: 10px;
  border: 1px solid #2f4259;
  border-radius: 8px;
  background: #111923;
  padding: 10px;
}

.asset-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.asset-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.asset-tabs {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}

.asset-tabs button {
  background: transparent;
  border-color: #35506d;
  color: #b8cce3;
}

.asset-tabs button.active {
  background: #24415e;
  color: #fff;
}

.asset-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.asset-kpi {
  border: 1px solid #2f4053;
  border-radius: 6px;
  background: #172331;
  padding: 8px;
}

.shadow-summary {
  margin-bottom: 8px;
  font-size: 12px;
  color: #f0b14a;
}

.check {
  grid-template-columns: auto 1fr;
  align-items: center;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  font-size: 12px;
  border-bottom: 1px solid #283646;
  padding: 7px 4px;
  vertical-align: top;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #162234;
}

th {
  color: var(--muted);
  font-size: 11px;
}

.compact-list {
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 4px;
  color: #d6e4f5;
  font-size: 12px;
}

.inline-actions {
  display: flex;
  gap: 4px;
}

.small {
  font-size: 11px;
  padding: 4px 7px;
}

.insight {
  display: grid;
  gap: 4px;
}

.insight ul {
  margin: 0;
  padding-left: 16px;
}

.status-healthy {
  color: var(--ok);
}

.status-warning {
  color: var(--warn);
}

.status-critical {
  color: var(--bad);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-shell {
  width: min(420px, 92vw);
}

.auth-card {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 12px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-brand img {
  width: 44px;
  height: 44px;
}

.auth-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.auth-actions .secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.auth-brand h1 {
  margin: 0;
  font-size: 20px;
}

.auth-brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.auth-message {
  min-height: 18px;
  margin: 0;
  color: var(--warn);
  font-size: 12px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.mgmt-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  border: 1px solid #3a4458;
  color: #c8d3e4;
  background: #252d3c;
}

.mgmt-pill.ok {
  background: rgba(61, 185, 129, 0.14);
  border-color: rgba(61, 185, 129, 0.25);
  color: #6fe0a6;
}

.mgmt-pill.warn {
  background: rgba(239, 109, 109, 0.15);
  border-color: rgba(239, 109, 109, 0.25);
  color: #ff9b9b;
}

.mgmt-pill.info {
  background: rgba(93, 111, 255, 0.14);
  border-color: rgba(93, 111, 255, 0.24);
  color: #9fb0ff;
}

.mgmt-pill.muted {
  background: #232938;
  color: #aeb9cc;
}

body[data-view-mode="mgmt"] .sidebar {
  background: #0f131c;
  border-right-color: #272d3a;
  padding: 16px 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body[data-view-mode="mgmt"] .brand {
  padding: 0 8px 16px;
  min-height: 56px;
}

body[data-view-mode="mgmt"] .brand img {
  width: 28px;
  height: 28px;
}

body[data-view-mode="mgmt"] .brand h1 {
  font-size: 15px;
  font-weight: 700;
}

body[data-view-mode="mgmt"] .brand p,
body[data-view-mode="mgmt"] .topbar p,
body[data-view-mode="mgmt"] .command-strip,
body[data-view-mode="mgmt"] .action-strip {
  display: none;
}

body[data-view-mode="mgmt"] .nav-group-label {
  padding: 0;
  font-size: 10px;
  font-weight: 600;
  line-height: 15px;
  letter-spacing: 0;
}

body[data-view-mode="mgmt"] .nav a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 10px 12px;
  border-radius: 10px;
  border-color: transparent;
  background: transparent;
  color: #c3cddd;
  font-size: 13px;
  font-weight: 500;
  line-height: 19.5px;
}

body[data-view-mode="mgmt"] .nav a:hover,
body[data-view-mode="mgmt"] .nav a.active {
  background: #1a1f36;
  border-color: #232b49;
  color: #f2f5fb;
  box-shadow: inset 0 0 0 1px rgba(99, 111, 255, 0.35);
}

body[data-view-mode="mgmt"] .sidebar-footer {
  border-top-color: #222838;
}

body[data-view-mode="mgmt"] .view-toggle {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-view-mode="mgmt"] .view-toggle button {
  background: #141928;
  border-color: #2c3347;
  color: #aebad0;
}

body[data-view-mode="mgmt"] .view-toggle button.active {
  background: #2e4d7f;
  border-color: #476ab0;
}

body[data-view-mode="mgmt"] .user-panel {
  background: #171c2a;
  border-color: #2c3347;
  border-radius: 10px;
}

body[data-view-mode="mgmt"] .main {
  background: #0c1017;
  padding: 0 16px 20px;
  gap: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body[data-view-mode="mgmt"] .topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -16px;
  padding: 16px 24px 14px;
  border: 0;
  border-bottom: 1px solid #232836;
  border-radius: 0;
  background: #0f131c;
}

body[data-view-mode="mgmt"] .topbar h2 {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

body[data-view-mode="mgmt"] .topbar-actions {
  display: none;
}

body[data-view-mode="mgmt"] .topbar-meta {
  display: flex;
}

body[data-view-mode="mgmt"] .kpis {
  display: none;
}

body[data-view-mode="mgmt"] #rolePanel {
  border: 0;
  background: transparent;
  padding: 0;
}

body[data-view-mode="mgmt"] .panel {
  border-radius: 14px;
  border-color: #272d3b;
  background: #171b26;
  padding: 14px 16px;
}

body[data-view-mode="mgmt"] .main > .panel:first-of-type .panel-head {
  margin-bottom: 20px;
}

body[data-view-mode="mgmt"] .main > .panel:first-of-type .panel-head h3 {
  display: none;
}

body[data-view-mode="mgmt"] #roleSectionTitle {
  display: none;
}

body[data-view-mode="mgmt"] .role-tabs {
  width: 100%;
  gap: 0;
  padding: 4px;
  border: 1px solid #262c3d;
  border-radius: 12px;
  background: #1d2230;
}

body[data-view-mode="mgmt"] .role-tabs button {
  flex: 1 1 0;
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  color: #c6cfdf;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

body[data-view-mode="mgmt"] .role-tabs button[data-role="cio"] { order: 1; }
body[data-view-mode="mgmt"] .role-tabs button[data-role="ciso"] { order: 2; }
body[data-view-mode="mgmt"] .role-tabs button[data-role="cfo"] { order: 3; }
body[data-view-mode="mgmt"] .role-tabs button[data-role="coo"] { order: 4; }
body[data-view-mode="mgmt"] .role-tabs button[data-role="cco"] { order: 5; }
body[data-view-mode="mgmt"] .role-tabs button[data-role="cto"] { order: 6; }

body[data-view-mode="mgmt"] .role-tabs button.active {
  background: #20263a;
  box-shadow: inset 0 0 0 2px rgba(101, 111, 255, 0.8);
}

body[data-view-mode="mgmt"] .role-title {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

body[data-view-mode="mgmt"] .role-title strong {
  font-size: 10px;
  color: #7d8fff;
  text-transform: uppercase;
  font-weight: 700;
  line-height: 15px;
  letter-spacing: 0;
}

body[data-view-mode="mgmt"] .role-title span {
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  line-height: 33px;
}

body[data-view-mode="mgmt"] .role-summary {
  margin: 0 0 18px;
  color: #6b7280;
}

body[data-view-mode="mgmt"] .metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

body[data-view-mode="mgmt"] #mgmtWorkspace {
  display: grid;
  gap: 14px;
}

body[data-view-mode="mgmt"] .metric,
body[data-view-mode="mgmt"] .visual-panel,
body[data-view-mode="mgmt"] .source-card {
  border-radius: 12px;
  border-color: #2b3143;
  background: #1c212d;
}

body[data-view-mode="mgmt"] .mgmt-kpi {
  min-height: 156px;
  padding: 18px 20px;
  background:
    radial-gradient(circle at top right, rgba(98, 111, 255, 0.12), transparent 35%),
    linear-gradient(180deg, #1a1f2b, #171b27);
  box-shadow: inset 0 2px 0 0 rgba(97, 214, 255, 0.8);
}

body[data-view-mode="mgmt"] .metric-grid .mgmt-kpi:nth-child(2) {
  box-shadow: inset 0 2px 0 0 rgba(101, 226, 149, 0.8);
}

body[data-view-mode="mgmt"] .metric-grid .mgmt-kpi:nth-child(3) {
  box-shadow: inset 0 2px 0 0 rgba(79, 197, 255, 0.8);
}

body[data-view-mode="mgmt"] .metric-grid .mgmt-kpi:nth-child(4) {
  box-shadow: inset 0 2px 0 0 rgba(170, 114, 255, 0.8);
}

body[data-view-mode="mgmt"] .mgmt-kpi-label {
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  line-height: 16.5px;
  text-transform: uppercase;
}

body[data-view-mode="mgmt"] .mgmt-kpi-delta {
  margin-top: 8px;
  min-height: 16px;
  color: #34d399;
  font-size: 11px;
  line-height: 16.5px;
}

body[data-view-mode="mgmt"] .mgmt-kpi-context {
  color: #7b8190;
  font-size: 12px;
  line-height: 18px;
}

body[data-view-mode="mgmt"] .mgmt-kpi-help {
  color: #a8b4c8;
  font-size: 12px;
  line-height: 17px;
  margin-top: 4px;
  min-height: 34px;
}

body[data-view-mode="mgmt"] .mgmt-kpi-source {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

body[data-view-mode="mgmt"] .mgmt-kpi-source small {
  color: #7b8190;
  font-size: 11px;
  line-height: 16.5px;
}

body[data-view-mode="mgmt"] .mgmt-main-grid {
  grid-template-columns: minmax(0, 2.1fr) minmax(280px, 0.9fr);
  gap: 14px;
}

body[data-view-mode="mgmt"] .mgmt-page-grid {
  gap: 14px;
}

body[data-view-mode="mgmt"] .mgmt-page-kpis-five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body[data-view-mode="mgmt"] .mgmt-secondary-grid {
  margin-top: 16px;
}

body[data-view-mode="mgmt"] .source-note {
  display: none;
}

body[data-view-mode="mgmt"] .mgmt-ds-strip {
  padding: 16px 18px;
  border: 1px solid #2a3042;
  border-radius: 10px;
  background: #171b26;
}

body[data-view-mode="mgmt"] .mgmt-ds-strip h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 19.5px;
}

body[data-view-mode="mgmt"] .mgmt-ds-items {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

body[data-view-mode="mgmt"] .mgmt-ds-item {
  padding: 10px 12px;
  border: 1px solid #2b3143;
  border-radius: 10px;
  background: #1c212d;
  color: #c6cfdf;
  font-size: 12px;
  line-height: 18px;
}

body[data-view-mode="mgmt"] .mgmt-alert {
  padding: 14px 18px;
  border: 1px solid rgba(255, 193, 79, 0.28);
  border-radius: 10px;
  background: rgba(116, 91, 23, 0.26);
  color: #f3d38b;
  font-size: 14px;
}

body[data-view-mode="mgmt"] .mgmt-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) repeat(5, minmax(120px, 0.7fr));
  gap: 10px;
}

body[data-view-mode="mgmt"] .mgmt-filters input,
body[data-view-mode="mgmt"] .mgmt-filters button {
  min-height: 40px;
  background: #1b2130;
  border-color: #2b3143;
  color: #c5d0df;
}

body[data-view-mode="mgmt"] .mgmt-table-panel {
  padding: 0;
  overflow: hidden;
}

body[data-view-mode="mgmt"] .mgmt-table-panel .panel-head {
  padding: 18px 18px 0;
}

body[data-view-mode="mgmt"] .mgmt-table th,
body[data-view-mode="mgmt"] .mgmt-table td {
  padding: 12px 16px;
}

body[data-view-mode="mgmt"] .mgmt-table input,
body[data-view-mode="mgmt"] .mgmt-table select {
  width: 100%;
  min-height: 34px;
  background: #111723;
  border: 1px solid #2b3143;
  color: #dce6f5;
  border-radius: 8px;
  padding: 6px 10px;
}

body[data-view-mode="mgmt"] .mgmt-table button.small {
  min-height: 34px;
  white-space: nowrap;
}

body[data-view-mode="mgmt"] .mgmt-stack-chart,
body[data-view-mode="mgmt"] .mgmt-dual-chart {
  display: grid;
  gap: 12px;
}

body[data-view-mode="mgmt"] .mgmt-stack-row,
body[data-view-mode="mgmt"] .mgmt-dual-row {
  display: grid;
  grid-template-columns: minmax(80px, 120px) 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

body[data-view-mode="mgmt"] .mgmt-stack-row.clickable-data:hover,
body[data-view-mode="mgmt"] .mgmt-dual-row.clickable-data:hover,
body[data-view-mode="mgmt"] .bar-row.clickable-data:hover {
  background: #172231;
  border-radius: 8px;
}

body[data-view-mode="mgmt"] .mgmt-stack-track,
body[data-view-mode="mgmt"] .mgmt-dual-bars {
  display: flex;
  align-items: stretch;
  height: 10px;
  border-radius: 999px;
  background: #222a39;
  overflow: hidden;
}

body[data-view-mode="mgmt"] .mgmt-stack-track i,
body[data-view-mode="mgmt"] .mgmt-dual-bars b,
body[data-view-mode="mgmt"] .mgmt-inline-bar span {
  display: block;
  height: 100%;
}

body[data-view-mode="mgmt"] .mgmt-stack-track i.blue,
body[data-view-mode="mgmt"] .mgmt-inline-bar span {
  background: #5c6df6;
}

body[data-view-mode="mgmt"] .mgmt-stack-track i.green,
body[data-view-mode="mgmt"] .mgmt-dual-bars b.green {
  background: #55c69a;
}

body[data-view-mode="mgmt"] .mgmt-stack-track i.yellow {
  background: #efc14c;
}

body[data-view-mode="mgmt"] .mgmt-dual-bars {
  gap: 4px;
  background: transparent;
}

body[data-view-mode="mgmt"] .mgmt-dual-bars b {
  border-radius: 999px;
  opacity: 0.95;
}

body[data-view-mode="mgmt"] .mgmt-dual-bars b.red {
  background: #d77b7b;
}

body[data-view-mode="mgmt"] .mgmt-legend {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  color: #aeb9cc;
  font-size: 12px;
}

body[data-view-mode="mgmt"] .mgmt-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body[data-view-mode="mgmt"] .mgmt-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

body[data-view-mode="mgmt"] .mgmt-legend i.green {
  background: #55c69a;
}

body[data-view-mode="mgmt"] .mgmt-legend i.red {
  background: #d77b7b;
}

body[data-view-mode="mgmt"] .mgmt-donut-wrap {
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: 280px;
}

body[data-view-mode="mgmt"] .mgmt-donut {
  width: 210px;
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
}

body[data-view-mode="mgmt"] .mgmt-donut.clickable-data,
body[data-view-mode="mgmt"] .mgmt-donut[data-detail] {
  cursor: pointer;
}

body[data-view-mode="mgmt"] .mgmt-donut::after {
  content: "";
  position: absolute;
  inset: 48px;
  border-radius: 50%;
  background: #1c212d;
}

body[data-view-mode="mgmt"] .mgmt-donut-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: center;
  color: #c5d0df;
  font-size: 12px;
}

body[data-view-mode="mgmt"] .mgmt-donut-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body[data-view-mode="mgmt"] .mgmt-donut-legend span.clickable-data:hover {
  background: #172231;
  border-radius: 6px;
}

body[data-view-mode="mgmt"] .mgmt-donut-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

body[data-view-mode="mgmt"] .mgmt-inline-bar {
  width: 120px;
  height: 8px;
  border-radius: 999px;
  background: #222a39;
  overflow: hidden;
}

body[data-view-mode="mgmt"] .status-row,
body[data-view-mode="mgmt"] th,
body[data-view-mode="mgmt"] td {
  border-color: #2a3140;
}

body[data-view-mode="mgmt"] .metric-label,
body[data-view-mode="mgmt"] th {
  font-size: 11px;
  font-weight: 600;
  line-height: 16.5px;
  text-transform: uppercase;
  letter-spacing: 0;
  color: #6b7280;
}

body[data-view-mode="mgmt"] .metric-value {
  font-size: 30px;
  font-weight: 700;
  line-height: 30px;
}

body[data-view-mode="mgmt"] .panel-head h3 {
  font-size: 13px;
  font-weight: 600;
  line-height: 19.5px;
}

body[data-view-mode="mgmt"] .panel-subtitle,
body[data-view-mode="mgmt"] .source-note,
body[data-view-mode="mgmt"] td,
body[data-view-mode="mgmt"] .status-row,
body[data-view-mode="mgmt"] .compact-list,
body[data-view-mode="mgmt"] label,
body[data-view-mode="mgmt"] input,
body[data-view-mode="mgmt"] button {
  font-size: 12px;
  line-height: 18px;
}

body[data-view-mode="mgmt"] .range-toggle button {
  font-size: 12px;
  font-weight: 400;
}

body[data-view-mode="mgmt"] input {
  border-color: #384156;
  background: #141925;
}

@media (max-width: 1280px) {
  .command-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-view-mode="mgmt"] .metric-grid,
  body[data-view-mode="mgmt"] .mgmt-ds-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-view-mode="mgmt"] .mgmt-page-kpis-five,
  body[data-view-mode="mgmt"] .mgmt-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .visual-grid {
    grid-template-columns: 1fr;
  }

  .source-card-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  body[data-view-mode="mgmt"] .topbar {
    margin: 0 -16px;
    padding-inline: 16px;
  }

  body[data-view-mode="mgmt"] .topbar-meta {
    width: 100%;
    justify-content: space-between;
  }

  body[data-view-mode="mgmt"] .mgmt-main-grid {
    grid-template-columns: 1fr;
  }

  body[data-view-mode="mgmt"] .mgmt-stack-row,
  body[data-view-mode="mgmt"] .mgmt-dual-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .registry-toolbar,
  .asset-kpi-grid {
    grid-template-columns: 1fr;
  }

  .range-toggle button {
    min-width: 42px;
    padding-inline: 8px;
  }

  body[data-view-mode="mgmt"] .metric-grid,
  body[data-view-mode="mgmt"] .mgmt-ds-items {
    grid-template-columns: 1fr;
  }

  body[data-view-mode="mgmt"] .mgmt-page-kpis-five,
  body[data-view-mode="mgmt"] .mgmt-filters {
    grid-template-columns: 1fr;
  }
}
