﻿@import url("https://rsms.me/inter/inter.css");

:root {
  --smxi-brand: #325d7f;
  --smxi-brand-rgb: 50, 93, 127;
  --smxi-primary: #48a884;
  --smxi-primary-hover: #3a8f6f;
  --smxi-save: #f59f00;
  --smxi-save-hover: #d98700;
  --smxi-navigation: var(--smxi-brand);
  --smxi-navigation-hover: #3d6e96;
  --smxi-dialog-header: #325d7f;
  --smxi-page-background: #f7f9fc;
  --smxi-surface: #ffffff;
  --smxi-border: #dce3ea;
  --smxi-text: #1f2937;
  --smxi-muted: #667382;
  --smxi-focus: rgba(72, 168, 132, 0.32);
  --smxi-shell-height: 3.75rem;
  --smxi-content-width: 1840px;
  --smxi-menu-font: "Inter var", Inter, -apple-system, BlinkMacSystemFont,
    "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --tblr-primary: var(--smxi-primary);
  --tblr-primary-rgb: 72, 168, 132;
  --tblr-primary-lt: rgba(72, 168, 132, 0.12);
  --tblr-primary-darken: var(--smxi-primary-hover);
  --tblr-font-sans-serif: "Inter var", Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  width: 100%;
  /* Remove WebCore's legacy document offset: it appears as a false left rail. */
  margin-left: 0 !important;
}

body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--smxi-text);
  background: var(--smxi-page-background);
  font-family: var(--tblr-font-sans-serif);
  -webkit-font-smoothing: antialiased;
}

body > #content {
  min-height: 100vh;
}

a,
button,
input,
select,
textarea {
  scroll-margin-top: 7.5rem;
}

:focus-visible {
  outline: 3px solid var(--smxi-focus);
  outline-offset: 2px;
}

.smxi-app-shell { min-height: 100vh; background: var(--smxi-page-background); }

/* Match the established desktop frame while retaining Tabler's responsive gutters. */
.smxi-app-shell .container-xl {
  max-width: min(100%, var(--smxi-content-width));
}

.smxi-shell-header {
  min-height: 5.25rem;
  color: #536274;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #e6ebf1;
  box-shadow: none;
}

.smxi-shell-header .container-xl {
  min-height: 5.25rem;
  gap: 1.25rem;
}

.smxi-shell-header .navbar-brand,
.smxi-shell-header .nav-link,
.smxi-shell-header .btn-link {
  color: #5e6d7c;
}

.smxi-shell-header .navbar-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  min-height: 5.25rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.smxi-brand-logo {
  display: block;
  width: 216px;
  height: 70px;
  max-width: 216px;
  max-height: 70px;
  object-fit: contain;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.smxi-brand-product {
  color: #fff;
  white-space: nowrap;
}

.smxi-shell-header .nav-link {
  border-radius: 0.375rem;
  opacity: 1;
}

.smxi-global-actions .nav-link,
.smxi-product-nav .nav-link {
  font-family: var(--smxi-menu-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

.smxi-shell-header .nav-link:hover,
.smxi-shell-header .nav-link:focus-visible {
  color: #325d7f;
  background: #f2f6fa;
  opacity: 1;
}

.smxi-global-search {
  position: relative;
  flex: 1 1 30rem;
  max-width: 34rem;
  min-width: 16rem;
  margin-left: auto;
}

.smxi-global-search .form-control {
  height: 2.7rem;
  padding-right: 5.7rem;
  color: #354357;
  border-color: #e1e7ee;
  border-radius: 0.45rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.smxi-global-search .form-control::placeholder { color: #9aa5b3; }

.smxi-global-search .btn {
  position: absolute;
  z-index: 1;
  top: 0.2rem;
  bottom: 0.2rem;
  display: grid;
  width: 2.35rem;
  padding: 0;
  place-items: center;
}

.smxi-global-search #CoreGlobalSearchClear { right: 2.45rem; color: #8390a0; }
.smxi-global-search #CoreGlobalSearchButton {
  right: 0.2rem;
  color: #fff;
  background: var(--smxi-brand);
  border-color: var(--smxi-brand);
  border-radius: 0.35rem;
}

.smxi-global-search[aria-disabled="true"] {
  opacity: 0.62;
}

.smxi-global-search .form-control:disabled {
  cursor: not-allowed;
}

.pagination .pagination_button {
  display: flex;
}

.pagination .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  line-height: 1;
  text-align: center;
}

.smxi-global-search-results {
  position: absolute;
  z-index: 1060;
  top: calc(100% + 0.4rem);
  right: 0;
  left: 0;
  overflow: hidden;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid #dbe3ec;
  border-radius: 0.45rem;
  box-shadow: 0 0.75rem 2rem rgba(15, 23, 42, 0.16);
}

.smxi-global-search-results[hidden] { display: none; }

.smxi-global-search-results-list {
  display: grid;
  gap: 0.15rem;
  max-height: 25rem;
  overflow-y: auto;
}

.smxi-global-search-result {
  display: grid;
  width: 100%;
  padding: 0.6rem 0.7rem;
  color: #24344a;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0.3rem;
}

.smxi-global-search-result:hover,
.smxi-global-search-result:focus-visible {
  color: #193a5a;
  background: #edf4fb;
  outline: none;
}

.smxi-global-search-result-name { font-weight: 600; }

.smxi-global-search-result-meta {
  overflow: hidden;
  color: #66758a;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smxi-global-search-add-person {
  grid-template-rows: auto auto;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.65rem;
  align-items: center;
}

.smxi-global-search-add-person .smxi-icon {
  grid-row: 1 / span 2;
  color: var(--smxi-primary);
}

.smxi-global-search-empty {
  margin: 0;
  padding: 0.75rem;
  color: #66758a;
}

.smxi-global-actions {
  display: flex;
  gap: 0.2rem;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.smxi-current-user .nav-link,
.smxi-user-identity {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.smxi-current-user-name,
.smxi-user-name {
  max-width: 14rem;
  overflow: hidden;
  font-size: 0.83rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smxi-user-identity {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  padding-right: 0.65rem;
  padding-left: 0.65rem;
}

.smxi-user-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  width: 2.45rem;
  height: 2.45rem;
  color: #fff;
  background: var(--smxi-brand);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  place-items: center;
}

.smxi-user-details { display: grid; gap: 0.05rem; min-width: 0; }
.smxi-user-tenant { color: var(--tblr-primary); font-size: 0.72rem; font-weight: 600; line-height: 1.1; }
.smxi-user-level { color: #7b8794; font-size: 0.72rem; line-height: 1.1; }

/* Tabler stacks navbar items by default. The signed-in identity is one
   inline control, so keep its avatar and details beside each other. */
.smxi-global-actions > .smxi-user-identity.nav-item {
  flex-direction: row;
  align-self: center;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.smxi-global-actions .smxi-user-details {
  justify-items: start;
  text-align: left;
}

.smxi-global-actions .smxi-user-avatar {
  width: 2.2rem;
  height: 2.2rem;
  font-size: 0.9rem;
}

.smxi-product-nav {
  min-height: 3.5rem;
  background: #fff;
  border-bottom: 1px solid #e6ebf1;
  box-shadow: none;
}

.smxi-product-nav .navbar-nav {
  gap: 0.4rem;
}

.smxi-product-nav .nav-link {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  min-height: 3.5rem;
  padding: 0.7rem 0.8rem;
  color: #687586;
  border-radius: 0;
  text-decoration: none;
}

[data-bs-theme="dark"] {
  --smxi-page-background: #111827;
  --smxi-surface: #1f2937;
  --smxi-border: #2e3c51;
  --smxi-text: #e5e7eb;
  --smxi-muted: #9ca3af;
  --smxi-navigation: #8eb8dc;
  --smxi-navigation-hover: #afd0eb;
}

[data-bs-theme="dark"] .smxi-shell-header,
[data-bs-theme="dark"] .smxi-product-nav {
  color: var(--smxi-text);
  background: var(--smxi-surface);
  border-bottom-color: var(--smxi-border);
}

[data-bs-theme="dark"] .smxi-shell-header .navbar-brand,
[data-bs-theme="dark"] .smxi-shell-header .nav-link,
[data-bs-theme="dark"] .smxi-shell-header .btn-link,
[data-bs-theme="dark"] .smxi-product-nav .nav-link,
[data-bs-theme="dark"] .smxi-user-tenant,
[data-bs-theme="dark"] .smxi-user-level {
  color: var(--smxi-muted);
}

[data-bs-theme="dark"] .smxi-shell-header .nav-link:hover,
[data-bs-theme="dark"] .smxi-shell-header .nav-link:focus-visible {
  color: var(--smxi-text);
  background: var(--tblr-tertiary-bg);
}

[data-bs-theme="dark"] .smxi-context-region {
  background: rgba(31, 41, 55, 0.92);
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .dashboard-shell .dashboard-panel,
[data-bs-theme="dark"] .dashboard-shell .dashboard-map-card,
[data-bs-theme="dark"] .dashboard-shell .dashboard-quick-actions,
[data-bs-theme="dark"] .dashboard-shell .dashboard-graph,
[data-bs-theme="dark"] .dashboard-shell .dashboard-table-panel,
[data-bs-theme="dark"] .dashboard-shell .dashboard-actions-panel,
[data-bs-theme="dark"] .dashboard-shell .dashboard-map-panel,
[data-bs-theme="dark"] .dashboard-shell .dashboard-stat,
[data-bs-theme="dark"] .smxi-task-panel,
[data-bs-theme="dark"] .smxi-task-tab,
[data-bs-theme="dark"] .smxi-task-item {
  color: var(--smxi-text);
  background: var(--smxi-surface) !important;
  border-color: var(--smxi-border) !important;
}

[data-bs-theme="dark"] .card-header {
  background: var(--tblr-tertiary-bg);
  border-bottom-color: var(--smxi-border);
}

[data-bs-theme="dark"] .card-title,
[data-bs-theme="dark"] .form-label,
[data-bs-theme="dark"] .dashboard-shell .dashboard-title,
[data-bs-theme="dark"] .dashboard-shell h1,
[data-bs-theme="dark"] .dashboard-shell h2,
[data-bs-theme="dark"] .dashboard-shell h3,
[data-bs-theme="dark"] .dashboard-shell .dashboard-stat > strong,
[data-bs-theme="dark"] .smxi-task-panel-title,
[data-bs-theme="dark"] .smxi-task-item-title,
[data-bs-theme="dark"] .smxi-task-empty {
  color: var(--smxi-text);
}

[data-bs-theme="dark"] .dashboard-shell .dashboard-stat > span,
[data-bs-theme="dark"] .dashboard-shell .dashboard-stat > small,
[data-bs-theme="dark"] .smxi-task-meta {
  color: var(--smxi-muted);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  color: var(--smxi-text);
  background-color: var(--tblr-tertiary-bg);
  border-color: var(--smxi-border);
}

[data-bs-theme="dark"] .smxi-global-search-results {
  background: #182433;
  border-color: #34445a;
}

[data-bs-theme="dark"] .smxi-global-search-result { color: #e8eef6; }

[data-bs-theme="dark"] .smxi-global-search-result:hover,
[data-bs-theme="dark"] .smxi-global-search-result:focus-visible {
  color: #fff;
  background: #24364b;
}

[data-bs-theme="dark"] .smxi-global-search-result-meta,
[data-bs-theme="dark"] .smxi-global-search-empty { color: #aebbd0; }

[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] .smxi-task-panel-footer,
[data-bs-theme="dark"] .smxi-task-tab.active {
  color: var(--smxi-text);
  background: var(--tblr-tertiary-bg);
  border-color: var(--smxi-border);
}

.smxi-product-nav .navbar-nav .nav-link {
  border-radius: 0;
}

.smxi-product-nav .nav-link:hover,
.smxi-product-nav .nav-link.active,
.smxi-product-nav .nav-link[aria-current="page"] {
  color: var(--smxi-brand);
  background: transparent;
}

.smxi-product-nav .nav-link.active,
.smxi-product-nav .nav-link[aria-current="page"] {
  box-shadow: inset 0 -3px 0 var(--smxi-brand);
}

.smxi-menu-toggle {
  color: #536274;
  border-color: #dce3ea;
}

.smxi-context-region {
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid var(--smxi-border);
}

.smxi-context-group {
  display: none;
}

.smxi-context-group.is-active {
  display: block;
}

.smxi-context-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.35rem 0;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: thin;
}

.smxi-context-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  color: var(--smxi-muted);
  border-radius: 0.45rem;
  font-size: 0.8rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.smxi-context-links a:hover,
.smxi-context-links a:focus-visible {
  color: var(--smxi-primary-hover);
  background: rgba(72, 168, 132, 0.1);
}

.smxi-context-select {
  display: none;
}

.smxi-main {
  padding: 1.5rem 0 2.5rem;
}

.smxi-main > .container-xl {
  min-height: calc(100vh - 10.5rem);
}

.smxi-page-header,
.task-management > .d-flex:first-child,
.membership-management > .d-flex:first-child,
.conversation-inbox > .d-flex:first-child {
  margin-bottom: 1.25rem;
}

.page-pretitle,
.smxi-pretitle,
.task-management .text-uppercase,
.membership-management .text-uppercase,
.conversation-inbox > .d-flex:first-child .text-uppercase {
  color: var(--smxi-primary-hover) !important;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.25;
}

.page-title,
.smxi-page-title,
.task-management h2,
.membership-management h2,
.conversation-inbox > .d-flex:first-child h2 {
  color: var(--smxi-text);
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.page-subtitle,
.smxi-page-subtitle {
  max-width: 52rem;
  color: var(--smxi-muted);
  line-height: 1.5;
}

.smxi-page-header > div:first-child > .page-pretitle,
.smxi-page .page-header .page-pretitle,
.task-management > .d-flex:first-child > div:first-child > .text-uppercase,
.membership-management > .d-flex:first-child > div:first-child > .text-uppercase,
.conversation-inbox > .d-flex:first-child > div:first-child > .text-uppercase {
  margin-bottom: 0.35rem;
}

.smxi-page-header > div:first-child > .page-title,
.smxi-page .page-header .page-title,
.task-management > .d-flex:first-child > div:first-child > h2,
.membership-management > .d-flex:first-child > div:first-child > h2,
.conversation-inbox > .d-flex:first-child > div:first-child > h2 {
  margin-top: 0;
  margin-bottom: 0.45rem !important;
}

.task-management > .d-flex:first-child > div:first-child > .text-muted:last-child,
.membership-management > .d-flex:first-child > div:first-child > .text-muted:last-child,
.conversation-inbox > .d-flex:first-child > div:first-child > .text-muted:last-child {
  line-height: 1.5;
}

.card {
  border-color: rgba(50, 93, 127, 0.14);
  border-radius: 0.75rem;
  box-shadow: 0 6px 20px rgba(31, 41, 55, 0.06);
}

.card-header {
  min-height: 3.25rem;
  border-bottom-color: rgba(50, 93, 127, 0.12);
  background: linear-gradient(180deg, #fff, #fbfcfd);
}

.card-title {
  color: #2c4055;
  font-weight: 700;
}

.card-sm .h1 {
  color: var(--smxi-navigation);
  font-weight: 750;
}

.row-cards {
  --tblr-gutter-y: 1rem;
}

.btn {
  min-height: 2.35rem;
  border-radius: 0.5rem;
  font-weight: 650;
}

.btn-primary {
  background: var(--smxi-primary);
  border-color: var(--smxi-primary);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background: var(--smxi-primary-hover);
  border-color: var(--smxi-primary-hover);
}

/* Save actions use the dedicated orange action colour across the application. */
button[id*="save" i]:not(:disabled),
button[id="essentials.baseedit.edit.button"]:not(:disabled) {
  --tblr-btn-bg: var(--smxi-save);
  --tblr-btn-border-color: var(--smxi-save);
  --tblr-btn-hover-bg: var(--smxi-save-hover);
  --tblr-btn-hover-border-color: var(--smxi-save-hover);
  background: var(--smxi-save);
  border-color: var(--smxi-save);
  color: #fff;
}

button[id*="save" i]:not(:disabled):hover,
button[id*="save" i]:not(:disabled):focus,
button[id*="save" i]:not(:disabled):active,
button[id="essentials.baseedit.edit.button"]:not(:disabled):hover,
button[id="essentials.baseedit.edit.button"]:not(:disabled):focus,
button[id="essentials.baseedit.edit.button"]:not(:disabled):active {
  background: var(--smxi-save-hover);
  border-color: var(--smxi-save-hover);
  color: #fff;
}

.btn-outline-secondary {
  color: #4f6071;
  border-color: #bac5d0;
}

.form-label {
  color: #33475b;
  font-size: 0.82rem;
  font-weight: 700;
}

.form-control,
.form-select {
  min-height: 2.45rem;
  border-color: #cbd5df;
  border-radius: 0.5rem;
  background-color: #fff;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--smxi-primary);
  box-shadow: 0 0 0 0.2rem var(--smxi-focus);
}

.form-control.is-invalid,
.form-select.is-invalid {
  border-color: var(--tblr-danger);
}

.table-responsive {
  border-radius: 0 0 0.75rem 0.75rem;
}

.table {
  margin-bottom: 0;
}

.table thead th {
  color: #526475;
  background: #f5f8fa;
  border-bottom-width: 1px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table tbody tr {
  transition: background-color 0.15s ease;
}

.table tbody tr:hover {
  background: rgba(72, 168, 132, 0.055);
}

.badge {
  border-radius: 999px;
  font-weight: 700;
}

.modal-content {
  overflow: hidden;
  border: 0;
  border-radius: 0.85rem;
  background: var(--smxi-surface);
  box-shadow: 0 24px 70px rgba(31, 41, 55, 0.26);
}

/* TWebMessageDlg adds Bootstrap spacing directly to modal-content, which
   otherwise renders as a thick white frame around the actual dialog. */
.modal-content.shadow-lg.p-3.mb-5.bg-body {
  margin-bottom: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0.85rem !important;
}

/* Keep confirmation/message dialogs in the viewport centre and remove the
   legacy spacing frame even when TMS adds its full class list. */
.modal.show > .modal-dialog {
  display: flex;
  align-items: center;
  min-height: calc(100% - 2rem);
  margin: 1rem auto;
}

.modal.show > .modal-dialog > .modal-content.shadow-lg.p-3.mb-5.bg-body.text-body.rounded {
  margin-bottom: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0.85rem !important;
}

@media (min-width: 576px) {
  .modal.show > .modal-dialog {
    min-height: calc(100% - 3.5rem);
    margin: 1.75rem auto;
  }
}

/* TWebMessageDlg renders its message as an h6. Let the dialog content use the
   configured body typography instead of Tabler's deliberately small h6 size. */
.modal-content.shadow-lg.p-3.mb-5.bg-body > .modal-body > h6 {
  font-size: inherit;
}

.modal-header {
  color: #fff;
  background: var(--smxi-dialog-header);
}

.modal-header .modal-title {
  color: #fff;
}

.modal-header .btn-close {
  opacity: 1;
  filter: brightness(0) invert(1) !important;
}

.smxi-task-panel-header .btn-close {
  opacity: 1;
  filter: brightness(0) invert(1) !important;
}

.modal-header .btn-close:hover,
.modal-header .btn-close:focus-visible {
  opacity: 1;
}

/* Group editor forms are injected by TMS WEB Core, so their layout rules must
   live in the shared stylesheet rather than in the dynamically loaded HTML. */
body > span[style*="z-index: 998"]:has(.group-edit-popup) {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
  background: rgba(15, 23, 42, 0.48) !important;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

body > span[style*="z-index: 998"] > .group-edit-popup {
  position: relative !important;
  inset: auto !important;
  width: min(860px, calc(100vw - 48px)) !important;
  height: auto !important;
  max-height: calc(100dvh - 48px) !important;
  margin: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.group-edit-popup > .group-edit-content {
  display: flex !important;
  flex-direction: column;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: calc(100dvh - 48px) !important;
  padding: 0 !important;
  overflow: hidden;
  border: 0;
}

.group-edit-content > .modal-header {
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
}

.group-edit-content > .modal-body {
  flex: 0 1 auto;
  min-height: 0 !important;
  padding: 1rem;
  overflow-y: auto;
}

.group-edit-content > .modal-footer {
  min-height: auto;
  padding: 0.75rem 1rem;
}

.group-edit-content .form-label {
  margin-bottom: 0.25rem;
}

.group-edit-content .btn {
  min-height: 2.25rem;
  padding: 0.375rem 0.75rem;
}

#group-query-section {
  margin-top: 1rem !important;
}

#group-query-section > h6 {
  margin-bottom: 0.2rem;
  font-size: inherit;
}

#group-query-section > p {
  margin-bottom: 0.75rem;
}

#group-query-host .sq-shell {
  color: inherit;
  background: transparent;
}

#group-query-host select,
#group-query-host input {
  min-height: 2.25rem;
  padding: 0.375rem 0.625rem;
  color: var(--tblr-body-color);
  background: var(--tblr-bg-forms, var(--tblr-bg-surface));
  border: 1px solid var(--tblr-border-color);
  border-radius: var(--tblr-border-radius);
}

#group-query-host button {
  min-height: 2.25rem;
  padding: 0.375rem 0.75rem;
  color: var(--smxi-primary);
  background: transparent;
  border: 1px solid var(--smxi-primary);
  border-radius: var(--tblr-border-radius);
}

#group-query-host .sq-shell header,
#group-query-host .actions,
#group-query-host .output {
  display: none;
}

#group-query-host .sq-shell main {
  padding: 0;
}

#group-query-host .builder {
  display: block;
}

#group-query-host .builder aside {
  display: none;
}

#group-query-host .builder article {
  width: 100%;
}

#group-query-host .filter-row,
#group-query-host .sort-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
}

#group-query-host #filterList {
  width: 100%;
  min-height: 5rem;
  margin-top: 0.75rem;
  border-color: var(--tblr-border-color);
}

@media (max-width: 760px) {
  body > span[style*="z-index: 998"]:has(.group-edit-popup) {
    padding: 8px !important;
  }

  body > span[style*="z-index: 998"] > .group-edit-popup,
  .group-edit-popup > .group-edit-content {
    width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
  }
}

.membership-panel {
  scroll-margin-top: 9rem;
}

.membership-list-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.membership-groups-sidebar {
  position: sticky;
  top: 1rem;
  max-height: calc(100dvh - 12rem);
  overflow: hidden;
}

.membership-groups-sidebar > .card-body {
  min-height: 0;
  overflow-y: auto;
}

.membership-group-list {
  display: grid;
  gap: 0.5rem;
}

.membership-group-item {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 3.75rem;
  padding: 0.7rem 0.75rem;
  color: var(--smxi-text);
  text-align: left;
  background: var(--smxi-surface);
  border: 1px solid var(--smxi-border);
  border-radius: 0.65rem;
}

.membership-group-item:hover {
  border-color: #9eb0c1;
  box-shadow: 0 2px 7px rgba(31, 41, 55, 0.07);
}

.membership-group-item.is-child {
  width: calc(100% - 0.75rem);
  margin-left: 0.75rem;
}

.membership-group-item.is-active {
  background: rgba(72, 168, 132, 0.1);
  border-color: var(--smxi-primary);
  box-shadow: 0 0 0 1px rgba(72, 168, 132, 0.12);
}

.membership-group-name {
  display: block;
  font-weight: 700;
}

.membership-group-kind {
  display: block;
  margin-top: 0.1rem;
  color: var(--smxi-muted);
  font-size: 0.76rem;
}

.membership-group-count {
  min-width: 1.8rem;
  padding: 0.15rem 0.4rem;
  color: var(--smxi-primary);
  text-align: center;
  background: rgba(72, 168, 132, 0.12);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.membership-list-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--smxi-border);
}

.membership-list-toolbar .form-control {
  width: min(100%, 26rem);
}

@media (max-width: 900px) {
  .membership-list-layout {
    grid-template-columns: 1fr;
  }

  .membership-groups-sidebar {
    position: static;
    max-height: none;
  }
}

/* Keep the new-contact editor within the popup viewport. The inherited
   conversations control has no element in this template and WebCore would
   otherwise place it in normal flow above the modal. */
body:has(.crm-contact-new-content) > span[style*="z-index: 998"] {
  box-sizing: border-box;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.52) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.smx-edit-form-scroll:has(.crm-contact-new-content),
.modal-dialog:has(.crm-contact-new-content) {
  width: calc(100vw - 48px) !important;
  max-width: 920px !important;
  height: min(900px, calc(100dvh - 48px)) !important;
  max-height: calc(100dvh - 48px) !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.smx-edit-form-scroll:has(.crm-contact-new-content) > #crm-contact-open-conversations {
  display: none !important;
}

.crm-contact-new-content {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  resize: none !important;
  overflow: hidden !important;
}

.crm-contact-new-body {
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

@media (max-width: 760px) {
  body:has(.crm-contact-new-content) > span[style*="z-index: 998"] {
    padding: 8px;
  }

  .smx-edit-form-scroll:has(.crm-contact-new-content),
  .modal-dialog:has(.crm-contact-new-content) {
    width: calc(100vw - 16px) !important;
    height: calc(100dvh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
  }
}

.modal-footer,
.card-footer {
  background: var(--tblr-bg-surface-secondary, #f8fafb);
  border-top-color: rgba(50, 93, 127, 0.12);
}

.membership-group-select {
  display: flex;
  flex: 1 1 auto;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}

.membership-group-settings {
  display: inline-grid;
  flex: 0 0 auto;
  width: 2.35rem;
  min-height: 2.35rem;
  padding: 0;
  color: var(--smxi-muted);
  background: var(--smxi-surface);
  border-color: var(--smxi-border);
  place-items: center;
}

.membership-group-settings:hover {
  color: var(--smxi-navigation);
  border-color: #9eb0c1;
}

[data-bs-theme="dark"] .modal-footer,
[data-bs-theme="dark"] .card-footer {
  color: var(--smxi-text);
  background: var(--tblr-tertiary-bg);
  border-top-color: var(--smxi-border);
}

.alert {
  border: 0;
  border-radius: 0.65rem;
}

.nav-tabs {
  gap: 0.2rem;
  border-bottom-color: var(--smxi-border);
}

.nav-tabs .nav-link {
  color: #536579;
  border-radius: 0.5rem 0.5rem 0 0;
  font-weight: 650;
}

.nav-tabs .nav-link.active {
  color: var(--smxi-primary-hover);
  border-bottom-color: var(--smxi-primary);
}

.menudetail {
  padding: 0.65rem 0 !important;
  border-bottom: 1px solid var(--smxi-border);
  background: transparent;
}

.menudetail .nav-link {
  border-radius: 0.45rem;
  font-weight: 650;
}

.task-management > .card {
  margin-bottom: 1rem;
}

.membership-management tr[role="button"] {
  cursor: pointer;
}

.membership-management tr[role="button"]:hover td {
  background: rgba(var(--smxi-brand-rgb), 0.06);
}

.dashboard-shell {
  color: var(--smxi-text);
}

.dashboard-shell .dashboard-panel,
.dashboard-shell .dashboard-map-card,
.dashboard-shell .dashboard-quick-actions,
.dashboard-shell .dashboard-graph,
.dashboard-shell .dashboard-table-panel,
.dashboard-shell .dashboard-actions-panel,
.dashboard-shell .dashboard-map-panel {
  border-color: rgba(50, 93, 127, 0.14) !important;
  border-radius: 0.75rem !important;
  background: #fff;
  box-shadow: 0 6px 20px rgba(31, 41, 55, 0.06) !important;
}

.dashboard-shell .dashboard-stat {
  position: relative;
  min-height: 9.2rem;
  overflow: hidden;
  padding: 1.25rem 1.4rem 1.5rem !important;
  border: 1px solid #e5ebf2 !important;
  border-radius: 0.6rem !important;
  background: #fff;
  box-shadow: 0 2px 8px rgba(31, 41, 55, 0.045) !important;
}

.dashboard-shell .dashboard-stat > span {
  display: block;
  color: #687586;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.dashboard-shell .dashboard-stat > strong {
  display: block;
  margin: 0.2rem 0 0.45rem;
  color: #2c3e52;
  font-size: 2rem;
  font-weight: 650;
  line-height: 1.1;
}

.dashboard-shell .dashboard-stat > small {
  display: block;
  color: #7b8794;
  font-size: 0.8rem;
}

.dashboard-kpi-accent {
  position: absolute;
  right: 1.4rem;
  bottom: 1rem;
  left: 1.4rem;
  height: 0.26rem;
  background: #45505d;
  border-radius: 999px;
}

.dashboard-stat-blue .dashboard-kpi-accent { background: var(--smxi-brand); }
.dashboard-stat-green .dashboard-kpi-accent { background: #48a884; }
.dashboard-stat-amber .dashboard-kpi-accent { background: #f5a623; }
.dashboard-stat-neutral .dashboard-kpi-accent { background: #45505d; }

.dashboard-shell .dashboard-title,
.dashboard-shell h1,
.dashboard-shell h2,
.dashboard-shell h3 {
  color: #243548;
}

.smxi-task-backdrop {
  position: fixed;
  z-index: 1070;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.28);
}

.smxi-task-popup-host {
  width: 0 !important;
  height: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.smxi-task-backdrop.d-none {
  display: none;
}

.smxi-task-panel {
  width: min(640px, 100vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid #dce3ea;
  box-shadow: -12px 0 32px rgba(15, 23, 42, 0.18);
  animation: smxi-task-panel-in 0.22s ease;
}

.smxi-task-panel-header {
  flex: 0 0 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  color: #fff;
  background: var(--smxi-dialog-header);
  border-bottom: 1px solid var(--smxi-dialog-header);
}

.smxi-task-panel-title {
  margin: 0;
  color: inherit;
  font-size: 1.25rem;
  font-weight: 600;
}

.smxi-task-panel-header .smxi-task-panel-title {
  color: #fff;
}

.smxi-task-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 24px 28px;
  overflow-y: auto;
}

.smxi-task-panel-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 18px 28px;
  background: #f4f8fa;
  border-top: 1px solid #dce3ea;
}

.smxi-task-list-footer {
  justify-content: space-between;
  align-items: center;
}

.smxi-task-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.smxi-task-tab {
  padding: 0.55rem 1.1rem;
  color: #1f2933;
  background: #fff;
  border: 1px solid #cfd9e2;
  border-radius: 0.5rem;
}

.smxi-task-tab.active {
  background: #d9e1e7;
  border-color: #d9e1e7;
}

.smxi-task-item {
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  background: #fff;
  border: 1px solid #dce3ea;
  border-radius: 0.5rem;
}

.smxi-task-item-title {
  margin-bottom: 0.35rem;
  overflow-wrap: anywhere;
  color: #111827;
  font-weight: 600;
}

.smxi-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  color: #5f6b76;
  font-size: 0.75rem;
}

.smxi-task-empty {
  min-height: 24rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #1f2933;
  text-align: center;
}

.smxi-task-empty-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: #fff;
  background: var(--tblr-primary);
  border-radius: 50%;
  font-weight: 700;
}

#task-editor {
  z-index: 1080;
}

.smxi-task-editor-panel {
  width: min(760px, 100vw);
}

@keyframes smxi-task-panel-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@media (max-width: 575.98px) {
  .smxi-brand-logo {
    width: 156px;
    height: 50px;
    max-width: 156px;
    max-height: 50px;
  }

  .smxi-brand-product {
    display: none;
  }

  .smxi-task-panel-header {
    padding: 0 18px;
  }

  .smxi-task-panel-body {
    padding: 18px;
  }

  .smxi-task-panel-footer {
    padding: 16px 18px;
  }
}

/* Sortable table headers expose their state without adding icons to
   non-data columns such as Actions. */
table thead th.sorting,
table thead th.sorting_asc,
table thead th.sorting_desc,
table thead td.sorting,
table thead td.sorting_asc,
table thead td.sorting_desc {
  position: relative;
  padding-right: 2rem !important;
}

table thead .sorting::after,
table thead .sorting_asc::after,
table thead .sorting_desc::after {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  color: currentColor;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
}

table thead .sorting::after {
  content: "\2195";
  opacity: 0.45;
}

table thead .sorting_asc::after {
  content: "\2191";
  opacity: 0.9;
}

table thead .sorting_desc::after {
  content: "\2193";
  opacity: 0.9;
}

@media (prefers-reduced-motion: reduce) {
  .smxi-task-panel {
    animation: none;
  }
}

.smxi-icon,
.fad,
.fas,
.far,
.fa {
  --smxi-icon-url: none;
  display: inline-block;
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  background-color: currentColor;
  mask: var(--smxi-icon-url) center / contain no-repeat;
  -webkit-mask: var(--smxi-icon-url) center / contain no-repeat;
  vertical-align: -0.18em;
}

.smxi-icon-dashboard,
.fa-tachometer-alt {
  --smxi-icon-url: url("assets/icons/tabler/dashboard.svg");
}

.smxi-icon-contacts,
.smxi-icon-address-book,
.fa-address-book {
  --smxi-icon-url: url("assets/icons/tabler/address-book.svg");
}

.smxi-icon-heart {
  --smxi-icon-url: url("assets/icons/tabler/heart.svg");
}

.smxi-icon-message-2-bolt {
  --smxi-icon-url: url("assets/icons/tabler/message-2-bolt.svg");
}

.smxi-icon-calendar {
  --smxi-icon-url: url("assets/icons/tabler/calendar.svg");
}

.smxi-icon-memberships,
.smxi-icon-id,
.fa-id-card {
  --smxi-icon-url: url("assets/icons/tabler/id.svg");
}

.smxi-icon-tasks,
.smxi-icon-list-check,
.fa-tasks {
  --smxi-icon-url: url("assets/icons/tabler/list-check.svg");
}

.smxi-icon-settings,
.fa-tools {
  --smxi-icon-url: url("assets/icons/tabler/settings.svg");
}

.smxi-icon-phone,
.fa-phone {
  --smxi-icon-url: url("assets/icons/tabler/phone.svg");
}

.smxi-icon-file {
  --smxi-icon-url: url("assets/icons/tabler/file.svg");
}

.smxi-icon-adjustments {
  --smxi-icon-url: url("assets/icons/tabler/adjustments.svg");
}

/* TWebDBTableControl applies the selected colour to the row, while Tabler's
   striped table backgrounds are painted on the cells. Let selected contact
   cells inherit the row colours so the white selection text stays legible. */
.crm-contacts-table > tbody > tr[style*="background-color"] > th,
.crm-contacts-table > tbody > tr[style*="background-color"] > td {
  color: inherit !important;
  background-color: inherit !important;
}

.smxi-icon-moon {
  --smxi-icon-url: url("assets/icons/tabler/moon.svg");
}

.smxi-icon-sun {
  --smxi-icon-url: url("assets/icons/tabler/sun.svg");
}

.smxi-theme-icon-day {
  display: none;
}

[data-bs-theme="dark"] .smxi-theme-icon-night {
  display: none;
}

[data-bs-theme="dark"] .smxi-theme-icon-day {
  display: inline-block;
}

.smxi-icon-user,
.fa-user-circle {
  --smxi-icon-url: url("assets/icons/tabler/user-circle.svg");
}

.smxi-icon-users,
.fa-users {
  --smxi-icon-url: url("assets/icons/tabler/users.svg");
}

.smxi-icon-logout,
.fa-sign-out-alt {
  --smxi-icon-url: url("assets/icons/tabler/logout.svg");
}

.smxi-icon-switch,
.fa-exchange-alt {
  --smxi-icon-url: url("assets/icons/tabler/switch-horizontal.svg");
}

.smxi-icon-building,
.fa-building {
  --smxi-icon-url: url("assets/icons/tabler/building.svg");
}

.smxi-icon-products,
.fa-boxes {
  --smxi-icon-url: url("assets/icons/tabler/packages.svg");
}

.smxi-icon-apps,
.fa-window-restore {
  --smxi-icon-url: url("assets/icons/tabler/apps.svg");
}

.smxi-icon-key,
.fa-key {
  --smxi-icon-url: url("assets/icons/tabler/key.svg");
}

/* CRM group navigator. Kept in the versioned shell stylesheet so cached
   WebCore form templates receive the current list treatment immediately. */
.smxi-page .crm-groups-layout {
  display: grid;
  grid-template-columns: 21rem minmax(0, 1fr);
  gap: 1rem;
}

.crm-groups-sidebar {
  align-self: start;
  position: sticky;
  top: 1rem;
}

.crm-groups-sidebar .crm-groups-header .dropdown-toggle {
  min-width: 4.75rem;
}

.crm-groups-sidebar .crm-groups-header .dropdown-menu {
  min-width: 9rem;
}

.crm-groups-sidebar .crm-groups-body {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.crm-groups-sidebar .crm-group-search {
  min-height: 2.55rem;
}

.crm-groups-sidebar .group-tree {
  min-height: 12rem;
  max-height: calc(100vh - 24rem);
  overflow: auto;
  padding: 0;
  background: transparent;
  border: 0;
}

.crm-groups-sidebar .group-tree > .TVUL {
  margin: 0;
  padding-left: 0;
}

.crm-groups-sidebar .group-tree .TVUL {
  display: grid;
  gap: 0.15rem;
  list-style: none;
}

.crm-groups-sidebar .group-tree .TVCARET::before {
  display: none;
}

.crm-groups-sidebar .group-tree .TVCARET > .group-tree-node::before {
  content: "";
  flex: 0 0 0.45rem;
  width: 0.45rem;
  height: 0.45rem;
  margin: 0 0.2rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.crm-groups-sidebar .group-tree .TVCARET-DOWN > .group-tree-node::before {
  transform: rotate(45deg);
}

.crm-groups-sidebar .group-tree .TVNESTED {
  display: none;
  margin: 0.1rem 0 0 0.65rem;
  padding: 0 0 0 0.65rem;
  border-left: 0;
}

.crm-groups-sidebar .group-tree .TVNESTED.TVACTIVE {
  display: grid;
}

.crm-groups-sidebar .group-tree .TVNESTED > li::before {
  display: none;
  content: none;
  border: 0;
}

.crm-groups-sidebar .group-tree .group-tree-node {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 2.5rem;
  margin: 0;
  padding: 0.35rem 0.4rem;
  color: var(--smxi-text);
  cursor: pointer;
  user-select: none;
  background: var(--smxi-surface);
  border: 1px solid var(--smxi-border);
  border-radius: 0.3rem;
  font-weight: 400;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.crm-groups-sidebar .group-tree .group-tree-node-owner,
.crm-groups-sidebar .group-tree .group-tree-node-static,
.crm-groups-sidebar .group-tree .group-tree-node-dynamic {
  color: var(--smxi-text);
  background: var(--smxi-surface);
}

.crm-groups-sidebar .group-tree .group-tree-node:hover {
  background: rgba(var(--smxi-brand-rgb), 0.05);
  border-color: #9eb0c1;
}

.crm-groups-sidebar .group-tree .group-tree-node.TVSELECTED {
  background: rgba(var(--smxi-brand-rgb), 0.08);
  border-color: var(--smxi-brand);
}

.crm-groups-sidebar .crm-group-row-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  text-align: left;
}

.crm-groups-sidebar .crm-group-row-title {
  overflow: hidden;
  color: var(--smxi-text);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-groups-sidebar .crm-group-row-meta {
  display: none;
}

.crm-groups-sidebar .crm-group-settings {
  display: inline-grid;
  visibility: visible;
  opacity: 1;
  flex: 0 0 auto;
  width: 1.45rem;
  min-height: 1.45rem;
  padding: 0;
  color: var(--smxi-muted);
  background: transparent;
  border: 0;
  box-shadow: none;
  place-items: center;
}

.crm-groups-sidebar .crm-group-settings:hover {
  color: var(--smxi-navigation);
  border-color: #9eb0c1;
}

.crm-groups-sidebar .group-tree .group-drop-target {
  background: rgba(72, 168, 132, 0.18);
  outline: 2px dashed #48a884;
}

@media (max-width: 900px) {
  .smxi-page .crm-groups-layout {
    grid-template-columns: 1fr;
  }

  .crm-groups-sidebar {
    position: static;
  }

  .crm-groups-sidebar .group-tree {
    max-height: 22rem;
  }
}

.smxi-icon-mail,
.fa-envelope {
  --smxi-icon-url: url("assets/icons/tabler/mail.svg");
}

.smxi-icon-view,
.fa-eye {
  --smxi-icon-url: url("assets/icons/tabler/eye.svg");
}

.smxi-icon-conversations,
.fa-comments {
  --smxi-icon-url: url("assets/icons/tabler/messages.svg");
  color: var(--smxi-primary);
}

.smxi-icon-edit,
.fa-edit {
  --smxi-icon-url: url("assets/icons/tabler/edit.svg");
}

.smxi-icon-delete,
.fa-trash,
.fa-trash-alt {
  --smxi-icon-url: url("assets/icons/tabler/trash.svg");
}

.smxi-icon-disable,
.fa-ban {
  --smxi-icon-url: url("assets/icons/tabler/ban.svg");
}

.smxi-icon-enable,
.fa-check-circle {
  --smxi-icon-url: url("assets/icons/tabler/circle-check.svg");
}

.smxi-icon-login,
.fa-sign-in {
  --smxi-icon-url: url("assets/icons/tabler/login.svg");
}

.smxi-icon-menu {
  --smxi-icon-url: url("assets/icons/tabler/menu-2.svg");
}

.smxi-icon-search {
  --smxi-icon-url: url("assets/icons/tabler/search.svg");
}

.smxi-icon-save {
  --smxi-icon-url: url("assets/icons/tabler/circle-check.svg");
}

.crm-groups-sidebar .crm-group-row-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.35rem;
  align-items: center;
}

.crm-groups-sidebar .membership-subgroup-toggle .smxi-icon-chevron-down {
  display: block;
  width: .65rem;
  height: .65rem;
  background: transparent;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  mask: none;
  -webkit-mask: none;
}

.crm-groups-sidebar .membership-subgroup-toggle.is-expanded .smxi-icon-chevron-down {
  transform: rotate(225deg) translate(-1px, -1px);
}

.crm-groups-sidebar .crm-group-count {
  min-width: 1.8rem;
  padding: 0.15rem 0.4rem;
  color: var(--smxi-primary);
  text-align: center;
  background: rgba(72, 168, 132, 0.12);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.smxi-icon-x {
  --smxi-icon-url: url("assets/icons/tabler/x.svg");
}

@media (min-width: 992px) {
  .smxi-context-group[data-layout="rail"].is-active {
    display: block;
    padding: 0.65rem 0;
  }

  .smxi-context-group[data-layout="rail"] .smxi-context-links {
    min-height: auto;
  }

  .crm-contact-tabs {
    gap: 0;
  }

  .crm-contact-tabs > .nav-tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.2rem;
    padding: 0 0.25rem;
    border-bottom: 1px solid var(--smxi-border);
    border-radius: 0;
    background: transparent;
  }

  .crm-contact-tabs > .nav-tabs .nav-link {
    width: auto;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0.35rem 0.35rem 0 0;
    text-align: center;
  }

  .crm-contact-tabs > .nav-tabs .nav-link.active {
    color: var(--smxi-primary-hover);
    background: transparent;
    border-bottom-color: var(--smxi-primary);
  }
}

.smx-richtext-visual,
.smx-richtext-markdown,
.smx-richtext-preview {
  box-sizing: border-box;
  height: 300px;
  min-height: 300px;
  max-height: 300px;
  overflow-y: auto;
}

.smx-richtext-markdown {
  resize: none;
}

.smx-richtext-toolbar .smx-richtext-tool {
  align-items: center;
  display: inline-flex;
  flex: 0 0 36px !important;
  height: 34px;
  justify-content: center;
  max-width: 36px;
  min-width: 36px;
  padding: 0;
  width: 36px;
}

.smx-richtext-toolbar .smx-richtext-clear {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto !important;
  height: 34px;
  justify-content: center;
  min-width: 54px;
}

@media (max-width: 991.98px) {
  .smxi-current-user-name,
  .smxi-user-name {
    max-width: 9rem;
  }

  .smxi-main {
    padding-top: 1rem;
  }
}

@media (max-width: 767.98px) {
  .smxi-shell-header .container-xl {
    flex-wrap: wrap;
  }

  .smxi-global-actions {
    gap: 0;
  }

  .smxi-global-actions .nav-link {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
  }

  .smxi-current-user-level,
  .smxi-action-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  .smxi-product-nav .navbar-collapse {
    padding: 0.5rem 0 0.75rem;
  }

  .smxi-product-nav .navbar-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .smxi-product-nav .nav-link {
    width: 100%;
  }

  .smxi-context-links {
    display: none;
  }

  .smxi-context-select {
    display: block;
    margin: 0.5rem 0;
  }

  .card-header {
    align-items: stretch !important;
  }

  .card-header .form-control,
  .card-header .form-select {
    width: 100% !important;
    max-width: none !important;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
.smxi-lowercase-input {
  text-transform: lowercase;
}

/* Dashboard metrics with registered navigation destinations. */
.dashboard-shell button.dashboard-stat-link { width: 100%; text-align: left; font: inherit; cursor: pointer; }
.dashboard-shell button.dashboard-stat-link:hover { border-color: var(--smxi-brand); }
.dashboard-shell button.dashboard-stat-link:focus-visible { outline: 3px solid var(--smxi-brand); outline-offset: 3px; }


/* The contact registration popup loads a form fragment, so keep its surface
   styles here rather than relying on the fragment's head styles. */
.PopUpForm.smxi-event-registration-host {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  width: min(1100px, calc(100vw - 32px)) !important;
  height: calc(100vh - 48px) !important;
  max-height: 900px;
  overflow: auto !important;
  background: #fff !important;
  opacity: 1 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .35) !important;
}
.smxi-event-registration-host #events-page {
  min-height: 100%;
  background: #fff !important;
  color: #182433;
}
.smxi-event-registration-host #events-page > .d-flex:first-child {
  position: sticky;
  top: -1px;
  z-index: 5;
  padding: 12px 0;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  gap: 12px;
}
.smxi-event-registration-host #events-page h1 { font-size: 1.35rem; }
.smxi-event-registration-host #events-page > .d-flex:first-child > div:last-child {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}
.smxi-event-registration-host #ev-registration-close {
  min-height: 42px;
  min-width: 80px;
  background: #182f48 !important;
  border-color: #182f48 !important;
  color: #fff !important;
  font-weight: 600;
}

/* Payment tasks keep method selection visible while changing the task below. */
.smxi-payment-tabs { gap: .25rem; flex-wrap: wrap; }
.smxi-payment-tabs .nav-link { padding: .75rem 1rem; font-weight: 600; }
.smxi-payment-tabs .nav-link[hidden] { display: none !important; }
.smxi-payment-method { background: #f8fafc; }
.smxi-payment-method > .mb-3 { margin-bottom: .5rem !important; }
.PopUpForm.smxi-donation-payment-host {
  position: fixed !important; left: 50% !important; top: 50% !important;
  transform: translate(-50%, -50%) !important; width: min(940px, calc(100vw - 24px)) !important;
  height: min(840px, calc(100vh - 24px)) !important; overflow: auto !important;
  background: #fff !important; border-radius: 12px; box-shadow: 0 20px 60px #0f172a40;
  z-index: 2100 !important;
}
#donation-payment-page { background: #fff !important; min-height: 100%; }
.smxi-payment-popup-header { position: sticky; top: -1rem; padding: 1rem 0; background: #fff; z-index: 5; border-bottom: 1px solid #dce1e7; }

/* WebCore wraps each popup in its own stacking context. */
body > span:has(#donation-payment-page) {
  z-index: 2200 !important;
  background: rgba(15, 23, 42, .35) !important;
}
