/* Afledt af .agent-artifacts/mockups/realm-management-overview-demo.html
   Alle regler scoped under .rmo-scope så de ikke lækker ud i resten af Nexus. */

.rmo-scope {
  --rmo-bg-page: #f9fafb;
  --rmo-bg-module-tint: #fffbeb;
  --rmo-surface: #ffffff;
  --rmo-border: #e5e7eb;
  --rmo-text: #111827;
  --rmo-text-muted: #6b7280;
  --rmo-realm-accent: #f59e0b;
  --rmo-realm-accent-hover: #d97706;
  --rmo-primary: #2b5fd9;
  --rmo-primary-hover: #244eb4;
  --rmo-radius: 10px;
  --rmo-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  color: var(--rmo-text);
  background: var(--rmo-bg-page);
  line-height: 1.5;
  min-height: 100%;
  width: 100%;
}

.rmo-scope .rmo-main {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 8px 0 32px;
}

.rmo-scope .rmo-page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.rmo-scope .rmo-page-title-with-menu {
  align-items: center;
}

.rmo-scope .rmo-page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  flex-wrap: nowrap;
  min-width: 0;
}

.rmo-scope .rmo-page-title-row h2 {
  flex: 1;
  min-width: 0;
}

.rmo-scope .rmo-page-title h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.rmo-scope .rmo-page-title p {
  margin: 4px 0 0;
  color: var(--rmo-text-muted);
  font-size: 14px;
  max-width: 520px;
}

.rmo-scope .rmo-page-title-menu :deep(.mud-icon-button) {
  color: var(--rmo-text-muted);
}

.rmo-scope .rmo-page-title-menu :deep(.mud-icon-button:hover) {
  color: var(--rmo-text);
  background: rgba(0, 0, 0, 0.04);
}

.rmo-scope .rmo-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.rmo-scope .rmo-btn {
  border: 1px solid var(--rmo-border);
  background: var(--rmo-surface);
  color: var(--rmo-text);
  padding: 8px 14px;
  border-radius: var(--rmo-radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rmo-scope .rmo-btn:hover {
  background: #f3f4f6;
}

.rmo-scope .rmo-btn-primary {
  background: var(--rmo-primary);
  color: #fff;
  border-color: var(--rmo-primary);
}

.rmo-scope .rmo-btn-primary:hover {
  background: var(--rmo-primary-hover);
  border-color: var(--rmo-primary-hover);
}

.rmo-scope .rmo-context-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.rmo-scope .rmo-context-bar {
  background: var(--rmo-bg-module-tint);
  border: 1px solid #fde68a;
  border-radius: var(--rmo-radius);
  padding: 14px 16px;
  margin-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.rmo-scope .rmo-context-bar-sub {
  padding: 10px 14px;
  border-color: #e5e7eb;
  background: #fafafa;
}

.rmo-scope .rmo-filter-active-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--rmo-realm-accent-hover);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.rmo-scope .rmo-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.rmo-scope .rmo-filter-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

/* Aktive filter-piller (mockup .filter-pill) */
.rmo-scope .rmo-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 12px;
  border-radius: 999px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  font-size: 13px;
  color: var(--rmo-text);
  max-width: 100%;
}

.rmo-scope .rmo-filter-pill strong {
  font-weight: 600;
}

.rmo-scope .rmo-filter-pill .rmo-filter-pill-rm {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--rmo-text-muted);
  font-size: 18px;
  line-height: 1;
  padding: 2px 8px;
  border-radius: 6px;
}

.rmo-scope .rmo-filter-pill .rmo-filter-pill-rm:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--rmo-text);
}

.rmo-scope .rmo-drawer-section {
  margin-bottom: 22px;
}

.rmo-scope .rmo-drawer-section h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rmo-text-muted);
}

.rmo-scope .rmo-drawer-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  cursor: pointer;
}

.rmo-scope .rmo-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--rmo-border);
}

.rmo-scope .rmo-inline-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

/* Lande-fanen: indlejrede expansion panels */
.rmo-scope .rmo-lande-panels {
  background: transparent;
}

.rmo-scope .rmo-lande-panels .mud-expansion-panel {
  border: 1px solid var(--rmo-border);
  border-radius: var(--rmo-radius);
  margin-bottom: 8px;
  overflow: hidden;
}

.rmo-scope .rmo-lande-panels-nested {
  margin-top: 8px;
  margin-left: 12px;
  padding-left: 8px;
  border-left: 2px solid #e5e7eb;
}

.rmo-scope .rmo-lande-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.rmo-scope .rmo-slice-heading {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rmo-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rmo-scope .rmo-slice-section {
  margin-bottom: 0;
}

.rmo-scope .rmo-grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.rmo-scope .rmo-stat-card {
  background: var(--rmo-surface);
  border: 1px solid var(--rmo-border);
  border-radius: var(--rmo-radius);
  padding: 14px 16px;
  box-shadow: var(--rmo-shadow);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: left;
}

.rmo-scope .rmo-stat-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.rmo-scope .rmo-stat-card .rmo-n {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--rmo-text);
}

.rmo-scope .rmo-stat-card .rmo-l {
  font-size: 12px;
  color: var(--rmo-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rmo-scope .rmo-card {
  background: var(--rmo-surface);
  border: 1px solid var(--rmo-border);
  border-radius: var(--rmo-radius);
  box-shadow: var(--rmo-shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.rmo-scope .rmo-card-h {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rmo-border);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.rmo-scope .rmo-card-b {
  padding: 12px 16px 16px;
}

.rmo-scope .rmo-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #f3f4f6;
  color: var(--rmo-text-muted);
  white-space: nowrap;
}

.rmo-scope .rmo-entity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rmo-scope .rmo-entity-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
}

.rmo-scope .rmo-entity-list li:last-child {
  border-bottom: none;
}

.rmo-scope .rmo-entity-list li:hover {
  background: #fafafa;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 6px;
}

.rmo-scope .rmo-ico {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.rmo-scope .rmo-meta {
  flex: 1;
  min-width: 0;
}

.rmo-scope .rmo-meta .rmo-t {
  font-weight: 500;
}

.rmo-scope .rmo-meta .rmo-s {
  font-size: 13px;
  color: var(--rmo-text-muted);
}

.rmo-scope .rmo-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rmo-border);
  border-radius: var(--rmo-radius);
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 12px;
}

.rmo-scope .rmo-search:focus {
  outline: none;
  border-color: var(--rmo-primary);
  box-shadow: 0 0 0 3px rgba(43, 95, 217, 0.15);
}

.rmo-scope .rmo-entity-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid var(--rmo-border);
  border-radius: 8px;
}

.rmo-scope .rmo-entity-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--rmo-text-muted);
  margin: 0;
}

.rmo-scope .rmo-entity-toolbar select {
  font: inherit;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--rmo-border);
  background: var(--rmo-surface);
  min-width: 160px;
}

.rmo-scope .rmo-hint {
  font-size: 12px;
  color: var(--rmo-text-muted);
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid var(--rmo-realm-accent);
  margin: 0 0 14px;
}

/* MudTabs — match demo faner (hvid bar, aktiv = amber tint + blå underline) */
.rmo-scope .rmo-mudtabs :deep(.mud-tabs-toolbar) {
  background: var(--rmo-surface) !important;
  border-bottom: 1px solid var(--rmo-border) !important;
  border-radius: var(--rmo-radius) var(--rmo-radius) 0 0 !important;
  box-shadow: var(--rmo-shadow) !important;
  padding: 6px 8px 0 !important;
  flex-wrap: wrap !important;
}

.rmo-scope .rmo-mudtabs :deep(.mud-tab) {
  text-transform: none !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  min-height: 42px !important;
  border-radius: 8px 8px 0 0 !important;
  margin-bottom: -1px !important;
}

.rmo-scope .rmo-mudtabs :deep(.mud-tab.mud-tab-active) {
  color: var(--rmo-primary) !important;
  background: var(--rmo-bg-module-tint) !important;
}

.rmo-scope .rmo-mudtabs :deep(.mud-tabs-slider) {
  background-color: var(--rmo-primary) !important;
}

.rmo-scope .rmo-mudtabs :deep(.mud-tabs-panels) {
  background: transparent !important;
}

.rmo-scope .rmo-breadcrumb-wrap :deep(.mud-breadcrumbs) {
  font-size: 13px;
  color: var(--rmo-text-muted);
  margin-bottom: 16px;
}

.rmo-scope .rmo-breadcrumb-wrap :deep(.mud-breadcrumbs a) {
  color: var(--rmo-primary);
}

/*
  Filter-skuffe: 1:1 klasser og regler fra realm-management-overview-demo.html
  (scoped under .rmo-scope .filter-drawer — var() mappes til Nexus --rmo-*).
*/
.rmo-scope .filter-drawer.rmo-filter-flyout {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  height: 100vh;
  max-height: 100dvh;
  width: min(480px, 100vw);
  max-width: 100vw;
  z-index: 12001;
  box-shadow: -6px 0 32px rgba(0, 0, 0, 0.12);
}

.rmo-scope .filter-drawer {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  width: 100%;
  background: var(--rmo-surface);
  box-sizing: border-box;
}

.rmo-scope .filter-drawer .filter-drawer-h {
  padding: 16px 18px;
  border-bottom: 1px solid var(--rmo-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.rmo-scope .filter-drawer .filter-drawer-h h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--rmo-text);
}

.rmo-scope .filter-drawer .filter-drawer-b {
  flex: 1;
  overflow: auto;
  padding: 12px 18px 24px;
  min-height: 0;
}

.rmo-scope .filter-drawer .filter-drawer-global-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rmo-border);
}

.rmo-scope .filter-drawer .filter-drawer-global-actions .btn {
  font-size: 12px;
  padding: 6px 12px;
}

.rmo-scope .filter-drawer .filter-group {
  margin-bottom: 20px;
}

.rmo-scope .filter-drawer .filter-group > h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rmo-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rmo-scope .filter-drawer .filter-group-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.rmo-scope .filter-drawer .filter-group-h h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--rmo-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rmo-scope .filter-drawer .filter-group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rmo-scope .filter-drawer .filter-group-actions .btn {
  font-size: 11px;
  padding: 4px 10px;
}

/* Kolonne-liste som i demoen — tving ét felt pr. række (undgår Mud/global multi-kolonne) */
.rmo-scope .filter-drawer .filter-options {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 6px;
  width: 100%;
}

.rmo-scope .filter-drawer .filter-options label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px;
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--rmo-border);
  cursor: pointer;
  font-size: 14px;
  color: var(--rmo-text);
  margin: 0;
}

.rmo-scope .filter-drawer .filter-options label:hover {
  background: #f9fafb;
}

.rmo-scope .filter-drawer .filter-options input {
  accent-color: var(--rmo-primary);
}

.rmo-scope .filter-drawer .filter-options label > span {
  min-width: 0;
  flex: 1;
  word-break: break-word;
}

.rmo-scope .filter-drawer .filter-options-scroll {
  max-height: min(38vh, 280px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.rmo-scope .filter-drawer .filter-drawer-empty {
  margin: 0;
  font-size: 13px;
  color: var(--rmo-text-muted);
}

.rmo-scope .filter-drawer .filter-drawer-ft {
  padding: 14px 18px;
  border-top: 1px solid var(--rmo-border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  background: #fafafa;
  flex-shrink: 0;
}

.rmo-scope .filter-drawer .btn {
  border: 1px solid var(--rmo-border);
  background: var(--rmo-surface);
  color: var(--rmo-text);
  padding: 8px 14px;
  border-radius: var(--rmo-radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.rmo-scope .filter-drawer .btn:hover {
  background: #f3f4f6;
}

.rmo-scope .filter-drawer .btn-primary {
  background: var(--rmo-primary);
  color: #fff;
  border-color: var(--rmo-primary);
}

.rmo-scope .filter-drawer .btn-primary:hover {
  background: var(--rmo-primary-hover);
  border-color: var(--rmo-primary-hover);
}

.rmo-scope .filter-drawer .filter-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rmo-border);
  border-radius: var(--rmo-radius);
  font-family: inherit;
  font-size: 14px;
  background: var(--rmo-surface);
  color: var(--rmo-text);
}

.rmo-scope .filter-drawer .filter-select:focus {
  outline: none;
  border-color: var(--rmo-primary);
  box-shadow: 0 0 0 3px rgba(43, 95, 217, 0.15);
}

.rmo-scope .filter-drawer .search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rmo-border);
  border-radius: var(--rmo-radius);
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.rmo-scope .filter-drawer .search:focus {
  outline: none;
  border-color: var(--rmo-primary);
  box-shadow: 0 0 0 3px rgba(43, 95, 217, 0.15);
}

.rmo-scope .filter-drawer .hint {
  font-size: 12px;
  color: var(--rmo-text-muted);
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid var(--rmo-realm-accent);
}

.rmo-scope .filter-drawer .type-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: #eef2ff;
  color: #3730a3;
  font-family: ui-monospace, monospace;
  margin-left: 6px;
}

.rmo-scope .filter-drawer .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Multi-row tab nav (erstatter MudTabs) */
.rmo-scope .rmo-tab-nav {
  background: #ffffff;
  border: 1px solid var(--rmo-border);
  border-radius: var(--rmo-radius);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rmo-scope .rmo-tab-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
}

.rmo-scope .rmo-tab-row-primary {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rmo-border);
}

.rmo-scope .rmo-tab-row-secondary {
  padding-top: 10px;
}

.rmo-scope .rmo-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  font-family: inherit;
  white-space: nowrap;
}

.rmo-scope .rmo-tab:hover {
  background: #f3f4f6;
  color: var(--rmo-text);
}

.rmo-scope .rmo-tab.primary {
  color: var(--rmo-text);
  font-weight: 700;
}

.rmo-scope .rmo-tab .rmo-tab-ico {
  font-size: 18px;
  color: inherit;
  width: 18px;
  height: 18px;
}

.rmo-scope .rmo-tab.active {
  background: #ffffff;
  color: var(--rmo-text);
  border-color: var(--rmo-realm-accent);
  box-shadow: 0 1px 2px rgba(245, 158, 11, 0.15);
}

.rmo-scope .rmo-tab.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 3px;
  background: var(--rmo-realm-accent);
  border-radius: 2px 2px 0 0;
}

.rmo-scope .rmo-tab-content {
  margin-top: 16px;
}
