/* CMDB V13: shared UI standards for controls, surfaces, density and responsive behavior. */
:root {
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 20px;
  --ui-control-height: 36px;
  --ui-control-height-compact: 32px;
  --ui-radius: 6px;
  --ui-radius-small: 4px;
  --ui-focus: 0 0 0 3px rgba(23, 107, 85, .14);
}

/* Base rhythm and form controls. */
body {
  font-size: 13px;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  border-radius: var(--ui-radius-small);
}

button {
  min-height: var(--ui-control-height);
  padding: 0 12px;
  font-size: 12px;
  line-height: 1;
}

input,
select,
textarea {
  min-height: var(--ui-control-height);
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1.35;
}

select {
  min-width: 0;
  padding-right: 30px;
}

textarea {
  min-height: 76px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
}

input[type="color"] {
  min-height: var(--ui-control-height);
  padding: 4px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--ui-focus);
}

label {
  gap: 6px;
  color: #53635b;
  font-size: 12px;
  font-weight: 650;
}

label > input,
label > select,
label > textarea,
label > .clearable-field,
label > .ci-resource-picker-search {
  min-width: 0;
}

.button-row,
.form-actions {
  display: flex;
  align-items: center;
  gap: var(--ui-space-2);
  flex-wrap: wrap;
}

.form-actions {
  justify-content: flex-end;
  margin-top: var(--ui-space-2);
}

.form-actions button,
.button-row button {
  flex: 0 0 auto;
}

.secondary,
.ghost,
.danger,
.primary {
  box-shadow: none;
}

.secondary {
  background: #fff;
}

.secondary:hover,
.ghost:hover {
  transform: none;
}

/* Consistent application frame. */
.app {
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  background: #fff;
}

.brand {
  min-height: 68px;
  padding: 14px 18px;
}

.sidebar-scroll {
  padding: 16px 12px;
}

.nav {
  gap: 16px;
}

.nav-item,
.nav-summary {
  min-height: 36px;
}

.nav-subitem {
  min-height: 34px;
}

.workspace {
  grid-template-rows: 62px minmax(0, 1fr);
}

.topbar {
  min-height: 62px;
  padding: 12px 30px;
}

.global-search {
  width: min(720px, 74vw);
}

.global-search input,
.global-search button {
  min-height: var(--ui-control-height);
}

.view {
  padding: 24px 30px 36px;
}

.view.active {
  gap: var(--ui-space-4);
}

.section-head {
  min-height: 48px;
  align-items: center;
}

.section-head h2 {
  font-size: 21px;
  letter-spacing: 0;
}

.section-note {
  max-width: 720px;
  color: #75827b;
  font-size: 12px;
}

.panel,
.metric,
.resource-type-rail,
.asset-rail,
.asset-commandbar,
.ci-center-layout,
.catalog-toolbar,
.catalog-table-panel,
.asset-table-panel {
  border-radius: var(--ui-radius);
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: var(--ui-space-4);
}

.panel-toolbar {
  min-height: 36px;
  margin-bottom: var(--ui-space-3);
  gap: var(--ui-space-3);
}

.panel-toolbar h3 {
  font-size: 14px;
}

.panel-toolbar small,
.section-status,
.muted-text {
  color: #78857e;
  font-size: 11px;
}

.metric {
  min-height: 92px;
  padding: 14px;
}

.metric span {
  font-size: 11px;
}

.metric strong {
  font-size: 24px;
}

/* Shared filter and toolbar standard. */
.filter-grid,
.report-filter,
.governance-filter,
.ci-view-toolbar,
.ci-instance-filter,
.ci-bulk-toolbar,
.topology-filters,
.catalog-toolbar {
  gap: var(--ui-space-3);
  padding: var(--ui-space-3);
  border: 1px solid var(--line);
  border-radius: var(--ui-radius);
  background: var(--surface-muted);
}

.filter-grid > label,
.report-filter > label,
.governance-filter > label,
.ci-view-toolbar > label,
.ci-instance-filter > label,
.topology-filters > label,
.catalog-toolbar > label {
  min-width: 0;
}

.filter-grid .form-actions,
.report-filter .form-actions,
.governance-filter .form-actions,
.ci-view-toolbar .form-actions,
.ci-instance-filter .form-actions,
.topology-filters .form-actions {
  margin-top: 0;
}

.ci-toolbar,
.ci-graph-toolbar,
.owner-toolbar,
.import-validation-toolbar,
.import-rules-toolbar,
.asset-commandbar,
.catalog-table-head,
.asset-table-head {
  gap: var(--ui-space-3);
}

.ci-toolbar,
.ci-graph-toolbar {
  min-height: 36px;
}

.ci-toolbar select,
.ci-toolbar input,
.ci-graph-toolbar select,
.ci-graph-toolbar input,
.owner-toolbar select,
.owner-toolbar input,
.import-validation-toolbar select,
.import-rules-toolbar select {
  min-height: var(--ui-control-height-compact);
}

/* Tables: predictable density and action alignment. */
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--ui-radius-small);
}

table {
  width: 100%;
  min-width: 680px;
  font-size: 12px;
}

th,
td {
  min-height: 40px;
  padding: 9px 10px;
  vertical-align: middle;
}

th {
  height: 36px;
  color: #64736b;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

td {
  color: #2c3c34;
}

td .button-row {
  flex-wrap: nowrap;
  gap: 6px;
}

#governance-issues td:last-child {
  min-width: 132px;
}

#governance-issues td .button-row button {
  flex: 0 0 auto;
  min-width: 56px;
}

td button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 11px;
}

.table-pagination,
.catalog-pagination,
.ci-api-pagination {
  gap: var(--ui-space-3);
  min-height: 42px;
  padding: 9px 0 0;
  font-size: 11px;
}

.status-chip,
.type-chip,
.severity-chip {
  min-height: 22px;
  padding: 2px 8px;
  border-radius: var(--ui-radius-small);
  font-size: 11px;
}

/* Forms and dialogs. */
.asset-form,
.owner-form-grid,
.ci-form-grid {
  gap: var(--ui-space-3);
}

.asset-form-panel,
.ci-modal-panel,
.modal-panel {
  border-radius: var(--ui-radius);
}

.modal-backdrop {
  padding: 20px;
}

.modal-panel {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.modal-head {
  min-height: 34px;
  margin-bottom: var(--ui-space-4);
  padding-bottom: var(--ui-space-3);
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  font-size: 15px;
}

.ci-form-divider {
  margin-top: var(--ui-space-2);
  padding-top: var(--ui-space-3);
  border-top-color: var(--line);
}

.ci-check-group {
  gap: var(--ui-space-3);
  padding: var(--ui-space-2) 0;
}

.ci-check-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  color: #47584f;
  font-size: 12px;
  font-weight: 600;
}

.prebox,
.code-area {
  border-radius: var(--ui-radius-small);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

/* Model governance and immutable CI history. */
.ci-attribute-table-wrap table {
  min-width: 1080px;
}

.ci-check-group {
  flex-wrap: wrap;
}

.ci-form-divider > button {
  flex: 0 0 auto;
  min-height: 30px;
}

.ci-dynamic-fields {
  display: block;
}

.ci-dynamic-group + .ci-dynamic-group {
  margin-top: 18px;
}

.ci-dynamic-group-title {
  margin-bottom: 9px;
  padding-bottom: 7px;
  border-bottom: 1px solid #d8e2e7;
  color: #2f4854;
  font-size: 12px;
  font-weight: 760;
}

.ci-dynamic-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 14px;
}

.ci-dynamic-group-grid .ci-wide-field {
  grid-column: 1 / -1;
}

.ci-sensitive-field {
  min-width: 0;
}

.ci-sensitive-field > label {
  display: block;
}

.ci-sensitive-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 26px;
  color: #667780;
  font-size: 11px;
}

.ci-sensitive-clear {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #a33b32;
  white-space: nowrap;
}

.ci-sensitive-clear input {
  width: 15px;
  height: 15px;
  min-height: 15px;
  padding: 0;
  accent-color: #b7473d;
}

.ci-sensitive-value {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid #c7d0dc;
  border-radius: 5px;
  color: #445466;
  background: #f1f4f8;
  font-size: 11px;
  font-weight: 700;
}

.ci-history-modal-panel {
  width: min(1120px, 100%);
}

.ci-modal-summary {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.ci-history-table-wrap table {
  min-width: 980px;
}

.ci-history-table-wrap th:nth-child(5),
.ci-history-table-wrap td:nth-child(5) {
  width: 38%;
}

.ci-history-changes {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ci-history-changes li {
  display: grid;
  grid-template-columns: minmax(88px, 120px) minmax(0, 1fr);
  align-items: start;
  gap: 7px;
}

.ci-history-changes strong {
  overflow: hidden;
  color: #344b56;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ci-history-changes li > span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #596b74;
  font-size: 11px;
}

.ci-history-value,
.ci-history-empty {
  display: inline;
}

.ci-history-empty,
.ci-history-no-change {
  color: #87959c;
  font-size: 11px;
}

@media (max-width: 760px) {
  .ci-dynamic-group-grid {
    grid-template-columns: 1fr;
  }

  .ci-dynamic-group-grid .ci-wide-field {
    grid-column: auto;
  }

  .ci-sensitive-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

/* Resource, model and topology workbenches use the same density. */
.resource-type-heading,
.ci-rail-head,
.ci-model-header,
.topology-panel-head,
.asset-form-head {
  min-height: 42px;
  padding: 10px 14px;
}

.catalog-facets,
.asset-tabs {
  gap: 4px;
  padding: 8px;
}

.catalog-facet,
.asset-tab,
.ci-model-item,
.ci-tab {
  min-height: 36px;
  border-radius: var(--ui-radius-small);
}

.ci-model-list {
  gap: 3px;
  padding: 8px;
}

.ci-tabs {
  min-height: 42px;
  gap: 4px;
  padding: 4px;
  border-radius: var(--ui-radius-small);
}

.ci-tab {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.topology-filters {
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(120px, 1fr)) auto;
}

.topology-canvas-toolbar,
.topology-canvas-footer {
  min-height: 42px;
  padding: 9px 12px;
}

.topology-tool-select select {
  min-height: var(--ui-control-height);
}

/* Login is an authentication workspace, not a marketing page. */
.login-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 68px minmax(0, 1fr) 44px;
  place-items: stretch;
  overflow: hidden;
  padding: 0;
  background: #eef2f0;
  color: var(--text);
}

.login-header {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 5vw, 72px);
  border-bottom: 1px solid #d8e0dc;
  background: rgba(255, 255, 255, .86);
}

.login-brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.login-brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: var(--ui-radius-small);
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.login-brand-lockup strong,
.login-brand-lockup small {
  display: block;
}

.login-brand-lockup strong {
  color: #17251f;
  font-size: 15px;
}

.login-brand-lockup small {
  margin-top: 1px;
  color: #7a8780;
  font-size: 10.5px;
}

.login-header-meta {
  color: #78857e;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-stage {
  width: min(1080px, calc(100vw - 64px));
  min-height: 0;
  align-self: center;
  justify-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: center;
  gap: 112px;
  padding: 48px 0;
}

.login-identity {
  min-height: 0;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.login-product-code {
  min-height: 0;
  padding: 0 0 12px;
  border: 0;
  border-radius: 0;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-identity h1 {
  max-width: none;
  color: #133c31;
  font-size: 58px;
  line-height: 1;
  font-weight: 800;
}

.login-product-name {
  margin-top: 14px;
  color: #263830;
  font-size: 21px;
  font-weight: 700;
}

.login-edition {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
  color: #74827b;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.login-edition i {
  width: 18px;
  height: 1px;
  background: #a9b5af;
}

.login-panel {
  width: 420px;
  max-width: 100%;
  margin: 0;
  align-self: center;
  justify-self: end;
  display: grid;
  gap: 22px;
  padding: 32px;
  border: 1px solid #d3dcd7;
  border-top: 3px solid var(--primary);
  border-radius: var(--ui-radius);
  background: #fff;
  box-shadow: 0 14px 38px rgba(31, 48, 41, .10);
}

.login-panel-heading {
  display: grid;
  gap: 5px;
}

.login-panel-index {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-panel h2 {
  margin: 0;
  color: #1a2922;
  font-size: 24px;
}

.login-panel-heading p {
  color: #74817a;
  font-size: 12px;
}

.login-panel .stack {
  gap: 14px;
}

.login-panel input,
.login-panel button[type="submit"] {
  min-height: 40px;
}

.login-panel input {
  border-color: #cdd7d2;
  background: #fbfcfb;
}

.login-panel input:focus {
  background: #fff;
}

.login-panel button[type="submit"] {
  width: 100%;
  margin-top: 2px;
}

.login-panel .input-clear {
  display: none;
}

.login-panel .clearable-field input {
  padding-right: 10px;
}

.login-panel .form-error {
  min-height: 18px;
  margin: -2px 0 0;
  font-size: 11px;
}

.login-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #e4e9e6;
  color: #89958f;
  font-size: 10px;
  font-weight: 650;
}

.login-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(24px, 5vw, 72px);
  border-top: 1px solid #dbe2de;
  color: #89958f;
  font-size: 9.5px;
  text-transform: uppercase;
}

@media (max-width: 1280px) {
  .app {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  .topbar {
    padding-inline: 24px;
  }

  .view {
    padding-inline: 24px;
  }

  .topology-filters {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .view {
    padding-inline: 20px;
  }

  .topology-filters {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .login-stage {
    width: min(920px, calc(100vw - 48px));
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 56px;
  }
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .topbar {
    min-height: 54px;
    padding: 8px 12px;
  }

  .global-search {
    width: 100%;
  }

  .view {
    padding: 16px 12px 26px;
  }

  .panel {
    padding: 14px;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .section-head > .button-row,
  .section-head > button {
    align-self: flex-start;
  }

  .filter-grid,
  .report-filter,
  .governance-filter,
  .ci-view-toolbar,
  .ci-instance-filter,
  .ci-bulk-toolbar,
  .topology-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-grid .button-row,
  .report-filter .button-row,
  .governance-filter .button-row,
  .ci-instance-filter .ci-filter-actions,
  .topology-filters .button-row {
    grid-column: 1 / -1;
  }

  .form-actions {
    justify-content: flex-start;
  }

  .form-actions button {
    min-width: 96px;
  }

  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal-panel {
    max-height: calc(100vh - 24px);
  }

  .login-shell {
    grid-template-rows: 58px minmax(0, 1fr) 40px;
    overflow: auto;
  }

  .login-header {
    padding: 0 18px;
  }

  .login-header-meta {
    display: none;
  }

  .login-stage {
    width: min(420px, calc(100vw - 28px));
    grid-template-columns: 1fr;
    align-content: center;
    gap: 26px;
    padding: 30px 0 34px;
  }

  .login-identity {
    justify-items: start;
  }

  .login-product-code {
    padding-bottom: 8px;
  }

  .login-identity h1 {
    font-size: 42px;
  }

  .login-product-name {
    margin-top: 9px;
    font-size: 17px;
  }

  .login-edition {
    margin-top: 14px;
    font-size: 9.5px;
  }

  .login-panel {
    width: 100%;
    justify-self: stretch;
    gap: 18px;
    padding: 24px;
  }

  .login-panel h2 {
    font-size: 21px;
  }

  .login-footer {
    padding: 0 18px;
  }
}

/* Controlled integration approvals. */
.nav-item[data-view="sync-approvals"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nav-count {
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 10px;
  background: #b33b34;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.sync-approval-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: var(--ui-space-3);
}

.sync-approval-metric {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-top: 3px solid #84928b;
  border-radius: var(--ui-radius);
  background: var(--surface);
}

.sync-approval-metric-pending { border-top-color: #c58b2a; }
.sync-approval-metric-applying { border-top-color: #3673a4; }
.sync-approval-metric-applied { border-top-color: #25775f; }
.sync-approval-metric-failed { border-top-color: #b64b45; }

.sync-approval-metric span,
.sync-approval-metric small {
  color: var(--muted);
  font-size: 11.5px;
}

.sync-approval-metric strong {
  color: var(--text);
  font-size: 25px;
  line-height: 1.15;
}

.sync-approval-toolbar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-3);
  margin-bottom: var(--ui-space-3);
}

.sync-approval-toolbar h3 {
  margin: 0;
}

.sync-approval-toolbar small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.sync-approval-filters {
  display: grid;
  grid-template-columns: 150px 170px;
  gap: 8px;
}

.sync-approval-table-wrap table {
  min-width: 980px;
}

.sync-business-key {
  color: #334a40;
  font-size: 11.5px;
  white-space: nowrap;
}

.sync-approval-status {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: var(--ui-radius-small);
  background: #eef2f0;
  color: #52625a;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 750;
}

.sync-approval-status-pending { color: #825d1d; background: #fff2d8; }
.sync-approval-status-applying { color: #275f8b; background: #e6f1f8; }
.sync-approval-status-applied { color: #1c6a52; background: #e2f2eb; }
.sync-approval-status-partial-applied { color: #785c20; background: #f7edcf; }
.sync-approval-status-rejected,
.sync-approval-status-failed { color: #963a35; background: #f8e6e4; }

.sync-approval-modal-panel {
  width: min(1120px, calc(100vw - 40px));
}

.sync-approval-detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--ui-radius-small);
  background: var(--line);
}

.sync-approval-detail-meta > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  background: var(--surface);
}

.sync-approval-detail-meta span,
.sync-approval-detail-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-approval-detail-meta span {
  color: var(--muted);
  font-size: 10.5px;
}

.sync-approval-detail-meta strong {
  color: var(--text);
  font-size: 12px;
}

.sync-approval-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  gap: var(--ui-space-4);
  margin-top: var(--ui-space-4);
}

.sync-approval-payload,
.sync-approval-result {
  min-width: 0;
}

.sync-approval-block-head {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sync-approval-block-head small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
}

.sync-approval-detail-grid .prebox {
  height: clamp(220px, 34vh, 400px);
  margin: 0;
  overflow: auto;
  white-space: pre;
}

#sync-approval-note-field {
  margin-top: var(--ui-space-4);
}

#sync-approval-note {
  min-height: 76px;
  resize: vertical;
}

.sync-approval-note-readonly {
  display: none;
}

.sync-approval-actions {
  min-height: 40px;
}

#sync-approval-detail-error {
  min-height: 18px;
  margin: 8px 0 0;
}

.admin-user-summary {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.admin-users-table-wrap table {
  min-width: 1080px;
}

@media (max-width: 1100px) {
  .sync-approval-detail-grid {
    grid-template-columns: 1fr;
  }

  .sync-approval-detail-grid .prebox {
    height: 260px;
  }
}

@media (max-width: 760px) {
  .sync-approval-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sync-approval-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .sync-approval-filters,
  .sync-approval-detail-meta {
    grid-template-columns: 1fr;
  }

  .sync-approval-modal-panel {
    width: 100%;
  }

  .sync-approval-detail-grid .prebox {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

/* Dashboard: diverse operational views over the existing summary contract. */
.dashboard-overview-band {
  min-width: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  border-block: 1px solid var(--line);
  background: #fff;
}

.dashboard-overview-total {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
  background: #f5f8f6;
}

.dashboard-overview-label,
.dashboard-primary-metric > span,
.dashboard-capacity-metric > span {
  color: #68766f;
  font-size: 11px;
  font-weight: 750;
}

.dashboard-overview-value {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.dashboard-overview-value strong {
  color: #183b32;
  font-size: 36px;
  line-height: 1;
}

.dashboard-overview-value span,
.dashboard-overview-total small {
  color: var(--muted);
  font-size: 11px;
}

.dashboard-primary-metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-primary-metric {
  position: relative;
  min-width: 0;
  min-height: 116px;
  display: grid;
  align-content: center;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}

.dashboard-primary-metric:last-child {
  border-right: 0;
}

.dashboard-primary-metric::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22px;
  width: 3px;
  height: 30px;
  background: #177f70;
}

.dashboard-primary-metric[data-metric-tone="server"]::before { background: #2c74b3; }
.dashboard-primary-metric[data-metric-tone="center"]::before { background: #7651a8; }
.dashboard-primary-metric[data-metric-tone="network"]::before { background: #b66b1b; }

.dashboard-primary-metric strong {
  margin-top: 8px;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.dashboard-primary-metric small {
  min-width: 0;
  margin-top: 7px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
}

.dashboard-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr);
  gap: 14px;
  align-items: stretch;
}

.dashboard-panel-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fafbfa;
}

.dashboard-panel-head h3 {
  margin: 0;
  color: #26362f;
  font-size: 14px;
}

.dashboard-panel-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.dashboard-panel-stat {
  flex: 0 0 auto;
  color: #53635b;
  font-size: 11px;
  font-weight: 750;
}

.dashboard-health-grid {
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 196px;
}

.dashboard-health-score {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px 18px;
  border-right: 1px solid var(--line);
}

.dashboard-score-ring,
.dashboard-donut {
  flex: 0 0 auto;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.dashboard-score-ring {
  width: 112px;
  height: 112px;
  background: conic-gradient(var(--health-color) var(--health-score), #e6ece8 0);
}

.dashboard-score-ring > div,
.dashboard-donut > div {
  position: absolute;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: #fff;
}

.dashboard-score-ring > div { inset: 9px; }
.dashboard-score-ring strong { color: var(--text); font-size: 27px; line-height: 1; }
.dashboard-score-ring span { margin-top: 4px; color: var(--muted); font-size: 10px; }

.dashboard-score-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.dashboard-score-copy strong { color: #177f70; font-size: 14px; }
.dashboard-score-copy strong[data-tone="attention"] { color: #9a5d0c; }
.dashboard-score-copy strong[data-tone="critical"] { color: #a23b36; }
.dashboard-score-copy span { color: var(--muted); font-size: 10.5px; line-height: 1.45; }

.dashboard-health-dimensions {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-health-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dashboard-health-row:nth-child(2n) { border-right: 0; }
.dashboard-health-row:nth-last-child(-n + 2) { border-bottom: 0; }
.dashboard-health-row > span { min-width: 0; color: #53635b; font-size: 11px; font-weight: 750; }
.dashboard-health-row small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 9.5px; font-weight: 500; }
.dashboard-health-row strong { flex: 0 0 auto; color: #177f70; font-size: 20px; }
.dashboard-health-row[data-health-tone="attention"] strong { color: #b66b1b; }
.dashboard-health-row[data-health-tone="critical"] strong { color: #b5413c; }

.dashboard-mix-panel,
.dashboard-capacity-panel,
.dashboard-analysis-panel {
  padding: 0;
  overflow: hidden;
}

.dashboard-asset-mix {
  min-height: 196px;
  display: grid;
  grid-template-columns: 146px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.dashboard-donut {
  width: 126px;
  height: 126px;
}

.dashboard-donut > div { inset: 19px; }
.dashboard-donut strong { color: var(--text); font-size: 20px; line-height: 1; }
.dashboard-donut span { margin-top: 4px; color: var(--muted); font-size: 9.5px; }

.dashboard-mix-legend,
.dashboard-status-legend {
  min-width: 0;
  display: grid;
}

.dashboard-mix-legend > div,
.dashboard-status-legend > div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(72px, 1fr) auto 32px;
  align-items: center;
  gap: 7px;
  padding: 7px 0;
  border-bottom: 1px solid #edf0ee;
  font-size: 10.5px;
}

.dashboard-mix-legend > div:last-child,
.dashboard-status-legend > div:last-child { border-bottom: 0; }
.dashboard-mix-legend span,
.dashboard-status-legend span { min-width: 0; overflow: hidden; color: #53635b; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-mix-legend i,
.dashboard-status-legend i,
.dashboard-provider-row i { width: 8px; height: 8px; display: inline-block; margin-right: 6px; border-radius: 2px; }
.dashboard-mix-legend strong,
.dashboard-status-legend strong { color: var(--text); text-align: right; }
.dashboard-mix-legend small,
.dashboard-status-legend small { color: var(--muted); text-align: right; }

.dashboard-resource-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-capacity-metric {
  position: relative;
  min-width: 0;
  min-height: 104px;
  padding: 15px 18px;
  border-right: 1px solid var(--line);
}

.dashboard-capacity-metric:last-child { border-right: 0; }
.dashboard-capacity-metric::after { content: ""; position: absolute; left: 18px; bottom: 0; width: 34px; height: 3px; background: #177f70; }
.dashboard-capacity-metric[data-capacity-tone="memory"]::after { background: #2c74b3; }
.dashboard-capacity-metric[data-capacity-tone="storage"]::after { background: #7651a8; }
.dashboard-capacity-metric[data-capacity-tone="network"]::after { background: #b66b1b; }
.dashboard-capacity-metric strong { display: block; margin-top: 9px; color: var(--text); font-size: 24px; line-height: 1; }
.dashboard-capacity-metric strong em { color: var(--muted); font-size: 10px; font-style: normal; font-weight: 650; }
.dashboard-capacity-metric small { display: block; margin-top: 8px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }

.dashboard-analysis-grid {
  display: grid;
  grid-template-columns: minmax(250px, .82fr) minmax(280px, .95fr) minmax(360px, 1.35fr);
  gap: 14px;
  align-items: stretch;
}

.dashboard-status-overview,
.dashboard-provider-distribution,
.dashboard-center-distribution {
  min-height: 238px;
  padding: 16px;
}

.dashboard-status-summary { display: flex; align-items: baseline; gap: 7px; }
.dashboard-status-summary strong { color: #177f70; font-size: 28px; line-height: 1; }
.dashboard-status-summary span { color: var(--muted); font-size: 10.5px; }
.dashboard-status-stack { height: 14px; display: flex; margin: 16px 0 12px; overflow: hidden; border-radius: 4px; background: #edf1ef; }
.dashboard-status-stack i { min-width: 3px; height: 100%; display: block; }

.dashboard-provider-distribution,
.dashboard-center-distribution { display: grid; align-content: center; gap: 12px; }
.dashboard-provider-row { min-width: 0; display: grid; gap: 5px; }
.dashboard-provider-row > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10.5px; }
.dashboard-provider-row > div:first-child span { min-width: 0; overflow: hidden; color: #53635b; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-provider-row > div:first-child strong { flex: 0 0 auto; color: var(--text); }
.dashboard-provider-row > small { color: var(--muted); font-size: 9.5px; }
.dashboard-provider-track,
.dashboard-center-scale > div { height: 6px; overflow: hidden; border-radius: 3px; background: #e9eeeb; }
.dashboard-provider-track i,
.dashboard-center-scale > div i { height: 100%; display: block; border-radius: 3px; }

.dashboard-center-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(96px, .9fr) minmax(130px, 1.35fr) 46px;
  align-items: center;
  gap: 10px;
}

.dashboard-center-name,
.dashboard-center-scale { min-width: 0; }
.dashboard-center-name > span { display: block; overflow: hidden; color: #42534b; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 700; }
.dashboard-center-name small,
.dashboard-center-scale small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.dashboard-center-scale > div i { background: #1e8f99; }
.dashboard-center-row > strong { color: var(--text); text-align: right; font-size: 11px; }

.dashboard-chart-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-rank-panel { padding: 0; overflow: hidden; }
.dashboard-rank-panel .table-wrap { margin: 0 14px 14px; }

@media (max-width: 1280px) {
  .dashboard-command-grid { grid-template-columns: 1fr; }
  .dashboard-analysis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-center-panel { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .dashboard-overview-band { grid-template-columns: 1fr; }
  .dashboard-overview-total { border-right: 0; border-bottom: 1px solid var(--line); }
  .dashboard-primary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-primary-metric:nth-child(2) { border-right: 0; }
  .dashboard-primary-metric:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .dashboard-health-grid { grid-template-columns: 1fr; }
  .dashboard-health-score { border-right: 0; border-bottom: 1px solid var(--line); }
  .dashboard-analysis-grid { grid-template-columns: 1fr; }
  .dashboard-center-panel { grid-column: auto; }
}

@media (max-width: 760px) {
  .dashboard-overview-total { padding: 15px 16px; }
  .dashboard-primary-metric { min-height: 104px; padding: 14px; }
  .dashboard-primary-metric::before { top: 18px; }
  .dashboard-primary-metric strong { font-size: 25px; }
  .dashboard-health-dimensions { grid-template-columns: 1fr; }
  .dashboard-health-row,
  .dashboard-health-row:nth-child(2n),
  .dashboard-health-row:nth-last-child(-n + 2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .dashboard-health-row:last-child { border-bottom: 0; }
  .dashboard-resource-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-capacity-metric:nth-child(2) { border-right: 0; }
  .dashboard-capacity-metric:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 520px) {
  .dashboard-overview-value strong { font-size: 31px; }
  .dashboard-asset-mix { grid-template-columns: 1fr; justify-items: center; }
  .dashboard-mix-legend { width: 100%; }
  .dashboard-health-score { flex-direction: column; text-align: center; }
  .dashboard-center-row { grid-template-columns: minmax(82px, .9fr) minmax(92px, 1.1fr) 42px; gap: 6px; }
  .dashboard-center-scale small { display: none; }
}

@media (max-width: 520px) {
  .filter-grid,
  .report-filter,
  .governance-filter,
  .ci-view-toolbar,
  .ci-instance-filter,
  .ci-bulk-toolbar,
  .topology-filters {
    grid-template-columns: 1fr;
  }

  .filter-grid .button-row,
  .report-filter .button-row,
  .governance-filter .button-row,
  .ci-instance-filter .ci-filter-actions,
  .topology-filters .button-row {
    grid-column: auto;
  }

  .button-row,
  .form-actions {
    width: 100%;
  }

  .button-row button,
  .form-actions button {
    flex: 1 1 0;
    min-width: 0;
  }

  .global-search button {
    min-width: 72px;
  }

  .modal-head {
    margin-bottom: var(--ui-space-3);
  }

  .login-brand-lockup small,
  .login-footer span:last-child {
    display: none;
  }

  .login-stage {
    width: calc(100vw - 24px);
  }

  .login-panel {
    padding: 22px;
  }
}

/* Account and access administration. */
.sidebar-account-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.sidebar-account-action,
.sidebar-logout {
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid #d6ddda;
  border-radius: var(--ui-radius-small);
  background: #fff;
  color: #65736c;
  font-size: 11.5px;
  cursor: pointer;
}

.sidebar-account-action:hover,
.sidebar-logout:hover {
  border-color: #b9c6c0;
  background: #f3f6f4;
  color: #2f443a;
}

.admin-user-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: var(--ui-space-3);
  margin-bottom: var(--ui-space-4);
}

.admin-user-metric {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: var(--ui-radius);
  background: var(--surface);
}

.admin-user-metric span,
.admin-user-metric small {
  color: var(--muted);
  font-size: 11.5px;
}

.admin-user-metric strong {
  color: var(--text);
  font-size: 25px;
  line-height: 1.15;
}

.admin-access-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(360px, .75fr);
  gap: var(--ui-space-4);
  align-items: start;
}

.admin-user-directory,
.admin-role-panel {
  min-width: 0;
}

.admin-role-panel {
  position: sticky;
  top: 76px;
}

.admin-user-toolbar,
.admin-role-heading {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-3);
  margin-bottom: var(--ui-space-3);
}

.admin-user-toolbar h3,
.admin-role-heading h3 {
  margin: 0;
}

.admin-user-toolbar small,
.admin-role-heading small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.admin-user-filters {
  width: min(620px, 68%);
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 132px 124px;
  gap: 8px;
}

.admin-users-table-wrap table {
  min-width: 980px;
}

.admin-role-table-wrap table {
  min-width: 590px;
}

.admin-role-table-wrap th,
.admin-role-table-wrap td {
  text-align: center;
}

.admin-role-table-wrap th:first-child,
.admin-role-table-wrap td:first-child {
  text-align: left;
}

.account-identity {
  display: grid;
  gap: 2px;
}

.account-identity strong {
  color: var(--text);
  font-size: 12.5px;
}

.account-identity small {
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 700;
}

.account-role,
.account-status,
.account-protection,
.permission-grant,
.permission-deny {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: var(--ui-radius-small);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}

.account-role-admin {
  color: #8d2b27;
  background: #f9e8e6;
}

.account-role-operator {
  color: #0d6757;
  background: #e3f3ee;
}

.account-role-auditor {
  color: #285e91;
  background: #e7f0f8;
}

.account-role-viewer {
  color: #53646e;
  background: #edf1f3;
}

.account-status-enabled {
  color: #146c43;
  background: #e5f4eb;
}

.account-status-locked {
  color: #8a570c;
  background: #fff1d6;
}

.account-status-disabled {
  color: #6c7880;
  background: #eceff1;
}

.account-protection {
  padding-left: 0;
  color: var(--muted);
  font-weight: 600;
}

.account-protection-warning,
.account-protection-locked {
  color: #9b5f0a;
}

.permission-grant {
  color: #0d6757;
  background: #e3f3ee;
}

.permission-deny {
  color: #8a959b;
  background: #f1f3f4;
}

.account-row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.account-row-actions button {
  min-height: 29px;
  padding: 0 8px;
  font-size: 11px;
}

.account-revoke-button {
  color: #9d302b;
  background: #fff;
}

.admin-user-modal-panel {
  width: min(720px, calc(100vw - 32px));
}

.admin-password-modal-panel {
  width: min(520px, calc(100vw - 32px));
}

.admin-user-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ui-space-3);
}

.admin-password-form {
  display: grid;
  gap: var(--ui-space-3);
}

.admin-user-form input[readonly] {
  color: #65747c;
  background: #f1f4f5;
  cursor: not-allowed;
}

.admin-toggle-field {
  display: grid;
  align-content: end;
  gap: 6px;
}

.admin-toggle-control {
  min-height: var(--ui-control-height);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--ui-radius-small);
  background: #fff;
  color: var(--text);
  font-size: 12px;
}

.admin-toggle-control input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.admin-form-error,
.admin-form-actions {
  grid-column: 1 / -1;
}

.admin-form-error {
  min-height: 18px;
  margin: 0;
}

.admin-form-actions {
  justify-content: flex-end;
  margin-top: 2px;
}

@media (max-width: 1679px) {
  .admin-access-layout {
    grid-template-columns: 1fr;
  }

  .admin-role-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .sidebar-account-actions {
    display: flex;
    justify-content: flex-end;
  }

  .sidebar-account-action,
  .sidebar-logout {
    display: block;
    width: auto;
    min-width: 48px;
    padding: 0 7px;
  }

  .admin-user-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-user-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-user-filters {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .admin-user-form {
    grid-template-columns: 1fr;
  }

  .admin-form-error,
  .admin-form-actions {
    grid-column: auto;
  }
}

@media (min-width: 761px) {
  .admin-user-summary {
    grid-template-columns: repeat(5, minmax(130px, 1fr));
  }
}

/* Audit workspaces: recent records stay lightweight; filters opt into history. */
.audit-stack {
  display: grid;
  gap: var(--ui-space-4);
}

.audit-panel {
  min-width: 0;
}

.audit-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-3);
  margin-bottom: var(--ui-space-3);
}

.audit-panel-head h3 {
  margin: 0;
  font-size: 15px;
}

.audit-panel-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.audit-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: var(--ui-space-3);
  align-items: end;
  margin-bottom: var(--ui-space-3);
  padding: var(--ui-space-3);
  border: 1px solid var(--line);
  border-radius: var(--ui-radius);
  background: var(--surface-muted);
}

.audit-filter-actions {
  align-self: end;
  min-height: var(--ui-control-height);
}

.audit-pagination {
  padding-top: var(--ui-space-3);
}

.audit-pagination-controls {
  flex-wrap: wrap;
}

.audit-pagination-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.audit-pagination-controls select {
  width: auto;
  min-width: 78px;
  min-height: var(--ui-control-height-compact);
}

.audit-pagination-controls button {
  min-width: 68px;
}

@media (max-width: 760px) {
  .audit-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audit-filter-actions {
    grid-column: 1 / -1;
  }

  .audit-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .audit-pagination-controls {
    justify-content: space-between;
  }
}
