/* UI-GROESSENVERTRAG stage 1: Hub customer workspace and user management. */

body.hub-shell-ready #customersView,
body.hub-shell-ready #userManagementPanel {
  --core-text-size: calc(13px * var(--hub-ui-scale, 1));
  --core-meta-size: calc(11px * var(--hub-ui-scale, 1));
  --core-label-size: calc(12px * var(--hub-ui-scale, 1));
  --core-control-height: calc(36px * var(--hub-ui-scale, 1));
  min-width: 0;
  font-size: var(--core-text-size);
}

/* Permission state wins over every responsive layout rule below. */
body[data-view="customers"].hub-shell-ready #customerAccessPanel.customer-access-card[hidden],
body.hub-shell-ready #userManagementPanel[hidden] {
  display: none !important;
}

body.hub-shell-ready #customersView .customer-layout {
  min-width: 0;
  container: hub-customer-workspace / inline-size;
}

body[data-view="customers"].hub-shell-ready #customerEditorIntro.customer-editor-card {
  display: grid !important;
  grid-template-columns: 56px minmax(240px, 1fr) minmax(260px, auto) !important;
  grid-template-areas:
    "logo main actions"
    ". context context" !important;
  align-items: center !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 12px 14px !important;
  gap: 10px 14px !important;
  overflow: visible !important;
  border-radius: 8px !important;
}

body[data-view="customers"].hub-shell-ready #customerEditorIntro .customer-context-tools {
  grid-area: context !important;
  display: grid !important;
  grid-template-columns: minmax(112px, 1fr) 180px !important;
  min-width: 0 !important;
  gap: 6px !important;
  align-self: center !important;
  align-content: center !important;
  align-items: center !important;
}

body[data-view="customers"].hub-shell-ready #customerEditorIntro #customerLinkTiles.customer-link-tiles {
  display: flex !important;
  min-width: 0 !important;
  width: 100% !important;
  gap: 5px !important;
  margin: 0 !important;
  padding: 0 0 3px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: thin;
}

body[data-view="customers"].hub-shell-ready #customerEditorIntro #customerLinkTiles.customer-link-tiles[hidden],
body[data-view="customers"].hub-shell-ready #customerEditorIntro #customerLinkTiles.customer-panel-inactive {
  display: none !important;
}

body[data-view="customers"].hub-shell-ready #customerEditorIntro .customer-link-tile {
  display: grid !important;
  grid-template-columns: 30px minmax(0, 1fr) !important;
  flex: 0 0 min(138px, 46%) !important;
  min-width: 112px !important;
  min-height: 42px !important;
  padding: 5px 7px !important;
  gap: 6px !important;
  border-radius: 6px !important;
}

body[data-view="customers"].hub-shell-ready #customerEditorIntro .customer-link-preview-media {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  border-radius: 5px !important;
}

body[data-view="customers"].hub-shell-ready #customerEditorIntro .customer-link-tile strong,
body[data-view="customers"].hub-shell-ready #customerEditorIntro .customer-link-tile em {
  font-size: var(--core-meta-size) !important;
  line-height: 1.15 !important;
}

body[data-view="customers"].hub-shell-ready #customerEditorIntro .customer-link-tile small {
  display: none !important;
}

body[data-view="customers"].hub-shell-ready #customerEditorIntro .customer-editor-logo {
  grid-area: logo !important;
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  margin: 0 !important;
  padding: 5px !important;
  border-radius: 7px !important;
  font-size: calc(22px * var(--hub-ui-scale, 1)) !important;
}

body[data-view="customers"].hub-shell-ready #customerEditorIntro .customer-editor-main {
  grid-area: main !important;
  align-self: center !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  gap: 2px !important;
}

body[data-view="customers"].hub-shell-ready #customerEditorIntro .customer-editor-main > span {
  font-size: var(--core-meta-size) !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
}

body[data-view="customers"].hub-shell-ready #customerEditorName {
  display: block !important;
  max-width: 100% !important;
  overflow: visible !important;
  color: #f8fafc !important;
  font-size: calc(23px * var(--hub-ui-scale, 1)) !important;
  line-height: 1.15 !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  -webkit-line-clamp: unset !important;
}

body[data-view="customers"].hub-shell-ready #customerEditorMeta {
  overflow: hidden !important;
  font-size: var(--core-meta-size) !important;
  line-height: 1.25 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-view="customers"].hub-shell-ready #customerEditorFacts {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  margin-top: 3px !important;
}

body[data-view="customers"].hub-shell-ready #customerEditorFacts span {
  max-width: 100% !important;
  padding: 3px 7px !important;
  border-radius: 999px !important;
  font-size: var(--core-meta-size) !important;
  line-height: 1.2 !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
}

body[data-view="customers"].hub-shell-ready #customerEditorIntro .customer-editor-actions {
  grid-area: actions !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
  width: auto !important;
  max-width: 360px !important;
  min-width: 0 !important;
  margin: 0 !important;
  gap: 6px !important;
}

body[data-view="customers"].hub-shell-ready #customerEditorIntro .customer-editor-actions button,
body[data-view="customers"].hub-shell-ready #customerAccessPanel button,
body[data-view="customers"].hub-shell-ready #customerAccessPanel summary {
  min-height: var(--core-control-height) !important;
  padding: 6px 11px !important;
  border-radius: 6px !important;
  font-size: var(--core-label-size) !important;
  line-height: 1.15 !important;
  white-space: normal !important;
}

body[data-view="customers"].hub-shell-ready #customerAccessPanel.customer-access-card {
  grid-column: 2 !important;
  grid-row: auto !important;
  align-self: center !important;
  justify-self: stretch !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  max-height: 44px !important;
  padding: 5px 6px !important;
  gap: 5px !important;
  overflow: hidden !important;
  border-radius: 7px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
}

body[data-view="customers"].hub-shell-ready #customerAccessPanel .customer-access-head {
  display: block !important;
  gap: 2px 6px !important;
  align-items: center !important;
}

body[data-view="customers"].hub-shell-ready #customerAccessPanel .customer-access-head span,
body[data-view="customers"].hub-shell-ready #customerAccessPanel .customer-access-head strong,
body[data-view="customers"].hub-shell-ready #customerAccessPanel .customer-access-head small,
body[data-view="customers"].hub-shell-ready #customerAccessPanel .customer-access-preview strong,
body[data-view="customers"].hub-shell-ready #customerAccessPanel .customer-access-preview small {
  min-width: 0 !important;
  font-size: var(--core-meta-size) !important;
  line-height: 1.2 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-view="customers"].hub-shell-ready #customerAccessPanel .customer-access-head strong {
  min-width: 0 !important;
  font-size: var(--core-text-size) !important;
}

body[data-view="customers"].hub-shell-ready #customerAccessPanel .customer-access-head small {
  display: none !important;
}

body[data-view="customers"].hub-shell-ready #customerAccessPanel .customer-access-list {
  display: none !important;
}

body[data-view="customers"].hub-shell-ready #customerAccessPanel .customer-access-preview {
  padding: 6px 8px !important;
  gap: 2px !important;
  border-radius: 6px !important;
}

body[data-view="customers"].hub-shell-ready #customerAccessPanel .customer-access-preview-users {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  min-width: 0 !important;
  gap: 2px !important;
}

body[data-view="customers"].hub-shell-ready #customerAccessPanel .customer-access-preview-user {
  display: inline-grid !important;
  width: 24px !important;
  height: 24px !important;
  place-items: center !important;
  border-radius: 50% !important;
  overflow: hidden !important;
}

body[data-view="customers"].hub-shell-ready #customerAccessPanel .customer-access-preview-user b,
body[data-view="customers"].hub-shell-ready #customerAccessPanel .customer-access-preview-users em {
  font-size: calc(9px * var(--hub-ui-scale, 1)) !important;
  line-height: 1 !important;
}

body[data-view="customers"].hub-shell-ready #customerAccessPanel .customer-access-manage,
body[data-view="customers"].hub-shell-ready #customerAccessPanel .customer-access-manage summary {
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
}

body[data-view="customers"].hub-shell-ready #customerAccessPanel .customer-access-manage summary {
  min-height: 32px !important;
  padding: 5px 9px !important;
  white-space: nowrap !important;
}

body[data-view="customers"].hub-shell-ready[data-customer-tab="overview"] .customer-organigramm-inline-frame {
  height: clamp(320px, 46vh, 500px) !important;
  min-height: 320px !important;
}

body[data-view="customers"].hub-shell-ready[data-customer-tab="organization"] .customer-organigramm-inline-frame {
  height: clamp(430px, 68vh, 760px) !important;
  min-height: 430px !important;
}

body[data-view="customers"].hub-shell-ready #customerWorkspaceTabs.customer-workspace-tabs {
  position: sticky !important;
  top: 0 !important;
  z-index: 20 !important;
  display: flex !important;
  min-width: 0 !important;
  gap: 4px !important;
  margin: 8px 0 !important;
  padding: 4px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  border-radius: 7px !important;
}

body[data-view="customers"].hub-shell-ready #customerWorkspaceTabs button {
  flex: 1 0 max-content !important;
  min-height: var(--core-control-height) !important;
  padding: 6px 12px !important;
  border-radius: 5px !important;
  font-size: var(--core-label-size) !important;
  line-height: 1.15 !important;
}

body.hub-shell-ready #userManagementPanel {
  min-width: 0;
  container: hub-user-management / inline-size;
  padding: 14px !important;
  overflow: visible !important;
}

body.hub-shell-ready #userManagementPanel .section-head,
body.hub-shell-ready #userManagementPanel .user-admin-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 10px 16px !important;
  margin: 0 0 10px !important;
}

body.hub-shell-ready #userManagementPanel .user-admin-head {
  margin-top: 14px !important;
}

body.hub-shell-ready #userManagementPanel h3 {
  font-size: calc(17px * var(--hub-ui-scale, 1)) !important;
  line-height: 1.2 !important;
}

body.hub-shell-ready #userManagementPanel .section-head p,
body.hub-shell-ready #userManagementPanel .security-workflow span,
body.hub-shell-ready #userManagementPanel .tenant-user-scope span,
body.hub-shell-ready #userManagementPanel .tenant-user-scope small,
body.hub-shell-ready #userManagementPanel .user-row > span {
  font-size: var(--core-text-size) !important;
  line-height: 1.35 !important;
}

body.hub-shell-ready #userManagementPanel .security-form,
body.hub-shell-ready #userManagementPanel .tenant-user-scope,
body.hub-shell-ready #userManagementPanel .user-toolbar,
body.hub-shell-ready #userManagementPanel .user-form {
  min-width: 0 !important;
  gap: 10px !important;
  padding: 10px !important;
  border-radius: 7px !important;
}

body.hub-shell-ready #userManagementPanel .security-form {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto auto !important;
  align-items: end !important;
}

body.hub-shell-ready #userManagementPanel .tenant-user-scope {
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 0.7fr) !important;
  align-items: end !important;
  margin: 10px 0 !important;
}

body.hub-shell-ready #userManagementPanel .user-toolbar {
  grid-template-columns: minmax(220px, 1fr) auto !important;
  align-items: center !important;
  margin-top: 8px !important;
}

body.hub-shell-ready #userManagementPanel input:not([type="checkbox"]):not([type="radio"]),
body.hub-shell-ready #userManagementPanel select,
body.hub-shell-ready #userManagementPanel button {
  min-height: var(--core-control-height) !important;
  font-size: var(--core-text-size) !important;
}

body.hub-shell-ready #userManagementPanel label,
body.hub-shell-ready #userManagementPanel .user-quick-role {
  min-width: 0 !important;
  font-size: var(--core-label-size) !important;
  line-height: 1.25 !important;
  text-transform: none !important;
}

body.hub-shell-ready #userManagementPanel .user-list,
body.hub-shell-ready #userManagementPanel .user-form {
  max-height: none !important;
  overflow: visible !important;
}

body.hub-shell-ready #userManagementPanel .user-form {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  margin-top: 10px !important;
  align-items: start !important;
}

body.hub-shell-ready #userManagementPanel .user-form .wide,
body.hub-shell-ready #userManagementPanel .user-form > button[type="submit"],
body.hub-shell-ready #userManagementPanel .user-form > #cancelUserEditButton {
  grid-column: 1 / -1 !important;
}

body.hub-shell-ready #userManagementPanel .user-form > button[type="submit"],
body.hub-shell-ready #userManagementPanel .user-form > #cancelUserEditButton {
  position: static !important;
  width: min(100%, 240px) !important;
}

body.hub-shell-ready #userManagementPanel .user-access-panels {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

body.hub-shell-ready #userManagementPanel .user-access-panel {
  min-width: 0 !important;
  padding: 9px !important;
  border-radius: 7px !important;
}

body.hub-shell-ready #userManagementPanel .user-access-head {
  grid-template-columns: minmax(120px, auto) minmax(160px, 1fr) !important;
  gap: 8px !important;
}

body.hub-shell-ready #userManagementPanel .user-app-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  max-height: 230px !important;
}

body.hub-shell-ready #userManagementPanel .user-list {
  display: grid !important;
  gap: 7px !important;
  padding: 0 !important;
}

body.hub-shell-ready #userManagementPanel .user-row.user-card-row {
  display: grid !important;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, auto) !important;
  align-items: center !important;
  min-width: 0 !important;
  gap: 10px 14px !important;
  padding: 10px 12px !important;
  border-radius: 7px !important;
}

body.hub-shell-ready #userManagementPanel .user-row-main {
  min-width: 0 !important;
  gap: 5px !important;
}

body.hub-shell-ready #userManagementPanel .user-title-line {
  gap: 5px !important;
}

body.hub-shell-ready #userManagementPanel .user-title-line > strong {
  font-size: calc(14px * var(--hub-ui-scale, 1)) !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
}

body.hub-shell-ready #userManagementPanel .role-badge,
body.hub-shell-ready #userManagementPanel .user-status-pill,
body.hub-shell-ready #userManagementPanel .user-meta-grid small {
  padding: 3px 7px !important;
  font-size: var(--core-meta-size) !important;
  line-height: 1.2 !important;
}

body.hub-shell-ready #userManagementPanel .user-meta-grid {
  gap: 4px !important;
}

body.hub-shell-ready #userManagementPanel .user-row-actions {
  display: flex !important;
  align-items: end !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
  min-width: 0 !important;
  gap: 5px !important;
}

body.hub-shell-ready #userManagementPanel .user-quick-role {
  display: grid !important;
  flex: 1 1 145px !important;
  min-width: 135px !important;
  max-width: 175px !important;
  gap: 2px !important;
}

body.hub-shell-ready #userManagementPanel .user-quick-role select {
  min-height: var(--core-control-height) !important;
  padding: 5px 9px !important;
  border-radius: 6px !important;
  font-size: var(--core-text-size) !important;
}

body.hub-shell-ready #userManagementPanel :is(button, input, select, textarea):focus-visible,
body[data-view="customers"].hub-shell-ready #customerEditorIntro :is(button, input, select, textarea, summary):focus-visible,
body[data-view="customers"].hub-shell-ready #customerWorkspaceTabs button:focus-visible {
  outline: 3px solid #ffd166 !important;
  outline-offset: 2px !important;
}

@container hub-customer-workspace (max-width: 1000px) {
  body[data-view="customers"].hub-shell-ready #customerEditorIntro.customer-editor-card {
    grid-template-columns: 56px minmax(220px, 1fr) !important;
    grid-template-areas:
      "logo main"
      "actions actions"
      "context context" !important;
  }

  body[data-view="customers"].hub-shell-ready #customerEditorIntro .customer-editor-actions {
    justify-content: flex-start !important;
  }
}

@container hub-customer-workspace (max-width: 720px) {
  body[data-view="customers"].hub-shell-ready #customerEditorIntro.customer-editor-card {
    grid-template-columns: 50px minmax(0, 1fr) !important;
    grid-template-areas:
      "logo main"
      "actions actions"
      "context context" !important;
  }

  body[data-view="customers"].hub-shell-ready #customerEditorIntro .customer-editor-logo {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
  }

  body[data-view="customers"].hub-shell-ready #customerEditorIntro .customer-editor-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: none !important;
  }

  body[data-view="customers"].hub-shell-ready #customerEditorIntro .customer-context-tools {
    grid-template-columns: minmax(112px, 1fr) 180px !important;
    width: 100% !important;
  }
}

@container hub-user-management (max-width: 1040px) {
  body.hub-shell-ready #userManagementPanel .security-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.hub-shell-ready #userManagementPanel .user-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.hub-shell-ready #userManagementPanel .user-row.user-card-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.hub-shell-ready #userManagementPanel .user-row-actions {
    justify-content: flex-start !important;
  }
}

@container hub-user-management (max-width: 700px) {
  body.hub-shell-ready #userManagementPanel .security-form,
  body.hub-shell-ready #userManagementPanel .tenant-user-scope,
  body.hub-shell-ready #userManagementPanel .user-toolbar,
  body.hub-shell-ready #userManagementPanel .user-form,
  body.hub-shell-ready #userManagementPanel .user-access-panels,
  body.hub-shell-ready #userManagementPanel .user-access-head {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.hub-shell-ready #userManagementPanel .user-toolbar span {
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }

  body.hub-shell-ready #userManagementPanel .user-row-actions,
  body.hub-shell-ready #userManagementPanel .access-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
  }

  body.hub-shell-ready #userManagementPanel .user-quick-role {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
  }
}

@media screen and (min-width: 681px) and (max-width: 1120px) {
  html body.hub-shell-ready[data-view="customers"] .topbar.hub-shell-header .hub-header-context,
  html body.hub-shell-ready[data-view="settings"] .topbar.hub-shell-header .hub-header-context,
  html body.hub-shell-ready[data-view="customers"] .topbar.hub-shell-header #sessionStatus,
  html body.hub-shell-ready[data-view="settings"] .topbar.hub-shell-header #sessionStatus {
    display: none !important;
  }
}

@media screen and (max-width: 680px) {
  body.hub-shell-ready #customersView,
  body.hub-shell-ready #userManagementPanel {
    --core-text-size: calc(14px * var(--hub-ui-scale, 1));
    --core-meta-size: calc(12px * var(--hub-ui-scale, 1));
    --core-label-size: calc(13px * var(--hub-ui-scale, 1));
    --core-control-height: 44px;
  }

  body[data-view="customers"].hub-shell-ready #customerEditorName {
    font-size: calc(20px * var(--hub-ui-scale, 1)) !important;
  }

  body[data-view="customers"].hub-shell-ready #customerEditorIntro .customer-editor-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-view="customers"].hub-shell-ready #customerEditorIntro .customer-editor-actions > :first-child {
    grid-column: 1 / -1 !important;
  }

  body[data-view="customers"].hub-shell-ready #customerAccessPanel.customer-access-card {
    max-height: 44px !important;
  }

  body[data-view="customers"].hub-shell-ready[data-customer-tab="overview"] .customer-organigramm-inline-frame,
  body[data-view="customers"].hub-shell-ready[data-customer-tab="organization"] .customer-organigramm-inline-frame {
    height: 58vh !important;
    min-height: 360px !important;
  }

  body[data-view="customers"].hub-shell-ready #customerWorkspaceTabs button {
    min-height: 44px !important;
  }

  body.hub-shell-ready #userManagementPanel {
    padding: 10px !important;
  }

  body.hub-shell-ready #userManagementPanel .section-head,
  body.hub-shell-ready #userManagementPanel .user-admin-head {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  body.hub-shell-ready #userManagementPanel .section-head button,
  body.hub-shell-ready #userManagementPanel .user-admin-head button,
  body.hub-shell-ready #userManagementPanel .user-row-actions button,
  body.hub-shell-ready #userManagementPanel .access-actions button {
    min-height: 44px !important;
  }

  /* The generic compact sheet uses a selector with html/body and otherwise
     wins despite being loaded earlier. Stage 1 owns this mobile layout. */
  html body.hub-shell-ready[data-view="customers"] .shell > main.content > .topbar.hub-shell-header,
  html body.hub-shell-ready[data-view="settings"] .shell > main.content > .topbar.hub-shell-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 0 !important;
    min-height: 80px !important;
    height: 80px !important;
    max-height: 80px !important;
    padding: 7px 8px !important;
    overflow: hidden !important;
  }

  html body.hub-shell-ready[data-view="customers"] .shell > main.content > .topbar.hub-shell-header .hub-header-customer,
  html body.hub-shell-ready[data-view="settings"] .shell > main.content > .topbar.hub-shell-header .hub-header-customer,
  html body.hub-shell-ready[data-view="customers"] .shell > main.content > .topbar.hub-shell-header .hub-header-context,
  html body.hub-shell-ready[data-view="settings"] .shell > main.content > .topbar.hub-shell-header .hub-header-context,
  html body.hub-shell-ready[data-view="customers"] .shell > main.content > .topbar.hub-shell-header #sessionStatus,
  html body.hub-shell-ready[data-view="settings"] .shell > main.content > .topbar.hub-shell-header #sessionStatus {
    display: none !important;
  }

  html body.hub-shell-ready[data-view="customers"] .shell > main.content > .topbar.hub-shell-header .topbar-actions,
  html body.hub-shell-ready[data-view="settings"] .shell > main.content > .topbar.hub-shell-header .topbar-actions {
    position: static !important;
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 44px !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    overflow: hidden !important;
  }

  html body.hub-shell-ready[data-view="customers"] .shell > main.content > .topbar.hub-shell-header #logoutButton,
  html body.hub-shell-ready[data-view="settings"] .shell > main.content > .topbar.hub-shell-header #logoutButton {
    min-height: 44px !important;
  }
}

/* V2 administration workspace: large, searchable user and activity management. */
body.admin-workspace-open {
  overflow: hidden !important;
}

body.hub-shell-ready #userManagementPanel .admin-workspace-launcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 183, 0, 0.34);
  border-radius: 7px;
  background: #151a21;
}

body.hub-shell-ready #userManagementPanel .admin-workspace-launcher > div {
  display: grid;
  gap: 4px;
}

body.hub-shell-ready #userManagementPanel .admin-workspace-launcher span {
  color: #aeb7c4;
}

body.hub-shell-ready #adminWorkspaceDialog.admin-workspace-dialog {
  width: min(1500px, calc(100vw - 24px));
  height: calc(100dvh - 24px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: #f5f7fa;
  border: 1px solid rgba(255, 183, 0, 0.58);
  border-radius: 8px;
  background: #10151b;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72);
}

body.hub-shell-ready #adminWorkspaceDialog::backdrop {
  background: rgba(3, 6, 10, 0.82);
  backdrop-filter: blur(4px);
}

body.hub-shell-ready #adminWorkspaceDialog .admin-workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  background: #10151b;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px 13px;
  border-bottom: 1px solid rgba(255, 183, 0, 0.28);
  background: #151b23;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-workspace-header > div {
  display: grid;
  gap: 3px;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-workspace-header h2,
body.hub-shell-ready #adminWorkspaceDialog .admin-workspace-header p {
  margin: 0;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-workspace-header h2 {
  font-size: calc(22px * var(--hub-ui-scale, 1)) !important;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-workspace-header p {
  color: #aeb7c4;
  font-size: calc(13px * var(--hub-ui-scale, 1)) !important;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-workspace-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 18px;
  border-bottom: 1px solid #2b333e;
  background: #121820;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-workspace-tabs button {
  min-width: 150px;
  color: #c9d0d9;
  border-color: transparent;
  background: transparent;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-workspace-tabs button.active {
  color: #101317;
  border-color: #ffb700;
  background: #ffb700;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-workspace-panel {
  min-width: 0;
  min-height: 0;
  padding: 14px 18px 20px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

body.hub-shell-ready #adminWorkspaceDialog [data-admin-workspace-panel="users"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 10px;
}

body.hub-shell-ready #adminWorkspaceDialog [data-admin-workspace-panel="users"][hidden],
body.hub-shell-ready #adminWorkspaceDialog [data-admin-workspace-panel="activities"][hidden] {
  display: none !important;
}

body.hub-shell-ready #adminWorkspaceDialog .tenant-user-scope,
body.hub-shell-ready #adminWorkspaceDialog .user-admin-head,
body.hub-shell-ready #adminWorkspaceDialog .user-toolbar,
body.hub-shell-ready #adminWorkspaceDialog .user-credential-result {
  grid-column: 1 / -1;
}

body.hub-shell-ready #adminWorkspaceDialog .user-toolbar {
  display: grid !important;
  grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(150px, 0.7fr)) auto !important;
  position: sticky;
  z-index: 4;
  top: -14px;
  margin: 0 !important;
  padding: 10px !important;
  background: #151b23 !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

body.hub-shell-ready #adminWorkspaceDialog .user-list {
  grid-column: 1 / -1;
  align-content: start;
}

body.hub-shell-ready #adminWorkspaceDialog.is-user-editing [data-admin-workspace-panel="users"] {
  grid-template-columns: minmax(460px, 0.95fr) minmax(520px, 1.05fr);
}

body.hub-shell-ready #adminWorkspaceDialog.is-user-editing .user-form {
  grid-column: 1;
  position: sticky;
  top: 66px;
  align-self: start;
  max-height: calc(100dvh - 245px) !important;
  overflow: auto !important;
  scrollbar-gutter: stable;
}

body.hub-shell-ready #adminWorkspaceDialog.is-user-editing .user-list {
  grid-column: 2;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-toolbar {
  display: grid;
  grid-template-columns: minmax(230px, 1.4fr) repeat(3, minmax(150px, 0.8fr)) repeat(3, minmax(135px, 0.65fr));
  gap: 9px;
  position: sticky;
  z-index: 4;
  top: -14px;
  padding: 12px;
  border: 1px solid #303844;
  border-radius: 7px;
  background: #151b23;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-toolbar label {
  display: grid;
  min-width: 0;
  gap: 4px;
  color: #b7c0cc;
  font-size: calc(12px * var(--hub-ui-scale, 1)) !important;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 8px;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-summary {
  margin: 10px 0;
  color: #aeb7c4;
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-list {
  display: grid;
  gap: 7px;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) minmax(150px, auto);
  align-items: start;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid #303844;
  border-left: 4px solid #4a9eff;
  border-radius: 7px;
  background: #171d25;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-row.is-warning {
  border-left-color: #ef5350;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-time,
body.hub-shell-ready #adminWorkspaceDialog .admin-activity-main,
body.hub-shell-ready #adminWorkspaceDialog .admin-activity-title,
body.hub-shell-ready #adminWorkspaceDialog .admin-activity-meta {
  display: grid;
  min-width: 0;
  gap: 3px;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-time span,
body.hub-shell-ready #adminWorkspaceDialog .admin-activity-meta,
body.hub-shell-ready #adminWorkspaceDialog .admin-activity-row-actions > span {
  color: #aeb7c4;
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-title {
  grid-template-columns: minmax(180px, auto) minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-title span {
  color: #c3cad4;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-meta {
  grid-template-columns: repeat(3, max-content);
  margin-top: 4px;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-meta span {
  padding: 2px 6px;
  border-radius: 4px;
  background: #252d37;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-meta .is-reversible {
  color: #b9f5d7;
  background: #123f2e;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-row details {
  margin-top: 7px;
  color: #cbd2db;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-changes {
  display: grid;
  gap: 4px;
  margin-top: 7px;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-changes > div {
  display: grid;
  grid-template-columns: 150px minmax(120px, 1fr) 20px minmax(120px, 1fr);
  gap: 7px;
  padding: 6px 8px;
  border-radius: 5px;
  background: #10151b;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-changes i {
  color: #ffb700;
  text-align: center;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-row-actions {
  display: flex;
  justify-content: flex-end;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-empty {
  padding: 28px;
  color: #aeb7c4;
  border: 1px dashed #3b4552;
  border-radius: 7px;
  text-align: center;
}

body.hub-shell-ready #adminWorkspaceDialog .admin-activity-empty.error {
  color: #ffc4c4;
  border-color: #8c3434;
  background: #2d1718;
}

@media screen and (max-width: 1100px) {
  body.hub-shell-ready #adminWorkspaceDialog .user-toolbar,
  body.hub-shell-ready #adminWorkspaceDialog .admin-activity-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.hub-shell-ready #adminWorkspaceDialog.is-user-editing [data-admin-workspace-panel="users"] {
    grid-template-columns: minmax(0, 1fr);
  }

  body.hub-shell-ready #adminWorkspaceDialog.is-user-editing .user-form,
  body.hub-shell-ready #adminWorkspaceDialog.is-user-editing .user-list {
    grid-column: 1;
    position: static;
    max-height: none !important;
  }

  body.hub-shell-ready #adminWorkspaceDialog .admin-activity-row {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  body.hub-shell-ready #adminWorkspaceDialog .admin-activity-row-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media screen and (max-width: 680px) {
  body.hub-shell-ready #userManagementPanel .admin-workspace-launcher,
  body.hub-shell-ready #adminWorkspaceDialog .admin-workspace-header {
    align-items: stretch;
    flex-direction: column;
  }

  body.hub-shell-ready #adminWorkspaceDialog.admin-workspace-dialog {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  body.hub-shell-ready #adminWorkspaceDialog .admin-workspace-tabs button {
    flex: 1;
    min-width: 0;
  }

  body.hub-shell-ready #adminWorkspaceDialog .admin-workspace-panel {
    padding: 10px;
  }

  body.hub-shell-ready #adminWorkspaceDialog .user-toolbar,
  body.hub-shell-ready #adminWorkspaceDialog .admin-activity-toolbar,
  body.hub-shell-ready #adminWorkspaceDialog .admin-activity-row,
  body.hub-shell-ready #adminWorkspaceDialog .admin-activity-changes > div {
    grid-template-columns: minmax(0, 1fr) !important;
    position: static;
  }

  body.hub-shell-ready #adminWorkspaceDialog .admin-activity-row-actions {
    grid-column: 1;
  }

  body.hub-shell-ready #adminWorkspaceDialog .admin-activity-meta,
  body.hub-shell-ready #adminWorkspaceDialog .admin-activity-title {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Customer portfolio density: status cards are scanning controls, not large
   feature tiles. Keep values readable without letting empty states dominate. */
body[data-view="customers"].hub-shell-ready .customer-app-group {
  margin-inline: 0 !important;
  padding: 10px 8px !important;
}

body[data-view="customers"].hub-shell-ready .customer-app-group:first-child {
  padding-top: 7px !important;
}

body[data-view="customers"].hub-shell-ready .customer-app-group-head {
  gap: 10px !important;
  margin-bottom: 7px !important;
  padding-left: 8px !important;
  border-left-width: 3px !important;
}

body[data-view="customers"].hub-shell-ready .customer-app-group-head span {
  font-size: calc(14px * var(--hub-ui-scale, 1)) !important;
}

body[data-view="customers"].hub-shell-ready .customer-app-group-head small {
  font-size: calc(10px * var(--hub-ui-scale, 1)) !important;
}

body[data-view="customers"].hub-shell-ready .customer-app-group-summary {
  grid-template-columns: 42px auto !important;
  gap: 7px !important;
}

body[data-view="customers"].hub-shell-ready .customer-app-group-ring {
  width: 40px !important;
  height: 40px !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--group-accent) 34%, transparent) !important;
}

body[data-view="customers"].hub-shell-ready .customer-app-group-ring::after {
  inset: 6px !important;
}

body[data-view="customers"].hub-shell-ready .customer-app-group-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)) !important;
  gap: 7px !important;
}

body[data-view="customers"].hub-shell-ready .open-point-app {
  min-height: 74px !important;
  padding: 8px 9px !important;
  column-gap: 7px !important;
}

body[data-view="customers"].hub-shell-ready .open-point-app strong {
  font-size: calc(12px * var(--hub-ui-scale, 1)) !important;
  line-height: 1.2 !important;
}

body[data-view="customers"].hub-shell-ready .open-point-app > em {
  max-width: none !important;
  padding: 2px 5px !important;
  font-size: calc(13px * var(--hub-ui-scale, 1)) !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}

body[data-view="customers"].hub-shell-ready .open-point-app small {
  margin-top: 2px !important;
  min-height: 1.2em !important;
  font-size: calc(10px * var(--hub-ui-scale, 1)) !important;
  line-height: 1.2 !important;
}

body[data-view="customers"].hub-shell-ready .open-point-app b {
  height: 5px !important;
  margin-top: 5px !important;
}
