/**
 * ============================================================================
 *  SETTINGS > USERS & TEAMS  (assets/css/settings-users.css)
 * ----------------------------------------------------------------------------
 *  Page-specific styles for settings-users.php.
 *  Extends settings.css for user views bar, quick filters, column editing modal,
 *  create user drawer, 3-step creation wizard, and seats/teams enhancements.
 * ============================================================================
 */

/* 1. TOP UPGRADE / USAGE BANNER --------------------------------------------- */
.ut-upgrade-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-4);
  font-size: 13.5px;
}

.ut-upgrade-banner__text {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.ut-upgrade-banner__text .icon {
  color: var(--brand);
  flex-shrink: 0;
}

/* 2. VIEWS BAR & ALL VIEWS FLYOUT ------------------------------------------- */
.ut-views-bar {
  display: flex;
  align-items: stretch;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.ut-views {
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}

.ut-views::-webkit-scrollbar {
  display: none;
}

.ut-view--add {
  color: var(--brand-ink);
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border-top: 0;
  border-left: 0;
}

.ut-view--add:hover {
  background: var(--surface-hover);
  color: var(--brand);
}

.ut-all-views {
  margin-left: auto;
  align-self: center;
  padding-right: var(--sp-3);
}

.ut-view--all {
  color: var(--brand-ink);
  font-weight: 600;
  border: 0;
  background: transparent;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.ut-view--all:hover {
  text-decoration: underline;
  background: var(--surface-hover);
}

.ut-all-views__menu {
  min-width: 580px;
  max-width: 90vw;
  padding: 16px;
  right: 0;
  left: auto;
}

.ut-all-views__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.ut-all-views__cat {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-subtle);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.ut-all-views__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  margin-bottom: 2px;
}

.ut-all-views__item:hover {
  background: var(--surface-hover);
}

.ut-all-views__item.is-active {
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
}

.ut-all-views__empty {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  padding: 6px 8px;
}

/* 3. QUICK FILTERS & VIEW ACTIONS ------------------------------------------- */
.ut-filters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  background: var(--surface);
}

.ut-filters-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.ut-dynamic-chips {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ut-filter-menu {
  min-width: 220px;
  padding: 8px 0;
}

.ut-filter-menu__header {
  padding: 6px 14px 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
  border-bottom: 1px solid var(--border);
}

.ut-filter-menu__list {
  padding: 6px 8px;
  max-height: 240px;
  overflow-y: auto;
}

.ut-filter-menu__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 4px;
  border-top: 1px solid var(--border);
}

.ut-view-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

/* 4. MODALS & DRAWERS (matching Contacts page lp-cols2, lp-modal--qf, lp-side) - */
dialog.lp-modal:not([open]),
dialog.set-modal:not([open]),
dialog:not([open]) {
  display: none !important;
}

dialog.lp-modal {
  margin: auto;
  border: 0;
  border-radius: 14px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-height: calc(100vh - 32px);
}

dialog.lp-modal[open] {
  display: flex !important;
  flex-direction: column;
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 10040;
}

dialog.lp-modal::backdrop {
  background: rgba(16, 24, 40, 0.45);
}

dialog.lp-modal .lp-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

dialog.lp-modal .lp-modal__head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

dialog.lp-modal .lp-modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

dialog.lp-modal .lp-modal__acts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

dialog.lp-modal--cols {
  width: min(1080px, calc(100vw - 32px)) !important;
  max-width: 1080px;
}

dialog.lp-modal--cols .lp-modal__body {
  padding: 0;
  overflow: visible;
}

.lp-cols2 {
  overflow: visible;
}

.lp-cols2__right {
  overflow: visible;
}

.lp-cols2__frz {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}

.lp-cols2__frz-select {
  min-width: 68px !important;
  width: 68px !important;
}

.lp-cols2__frz-select .custom-select__trigger {
  height: 32px;
  padding: 4px 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  border-radius: 6px;
  border-color: var(--border-strong);
}

.lp-cols2__frz-select .custom-select__dropdown {
  min-width: 68px;
  width: 68px;
  max-height: 180px;
  overflow-y: auto;
}

.lp-cols2__frz-select .custom-select__option {
  padding: 6px 10px;
  font-size: 13px;
  text-align: center;
}

/* Dynamic positioning & Dropup support for custom select */
.custom-select__dropdown {
  z-index: 10060 !important;
}

.custom-select-wrapper.is-dropup .custom-select__dropdown {
  top: auto !important;
  bottom: calc(100% + 4px) !important;
  box-shadow: 0 -8px 24px rgba(16, 24, 40, 0.15) !important;
}

dialog.lp-modal--cols .lp-modal__foot {
  flex-direction: row;
  justify-content: space-between;
  gap: 12px;
}

dialog.lp-modal--cols .lp-modal__acts {
  order: 1;
  flex-direction: row;
}

dialog.lp-modal--cols .lp-modal__left {
  order: 0;
}

dialog.lp-modal--qf {
  width: min(560px, calc(100vw - 32px)) !important;
  max-width: 560px;
}

dialog.lp-modal--qf .lp-modal__head {
  padding: 22px 24px;
}

dialog.lp-modal--qf .lp-modal__head h2 {
  font-size: 20px;
}

dialog.lp-modal--qf .lp-modal__body {
  padding-top: 20px;
}

dialog.lp-modal--qf .lp-modal__foot {
  justify-content: flex-start;
  border-top: 0;
  padding: 20px 24px 24px;
}

dialog.lp-modal--qf .lp-modal__acts {
  margin-left: 0;
}

/* Side drawer for Advanced Filters */
dialog.lp-side {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  margin: 0;
  width: min(480px, 100vw);
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: -12px 0 32px rgba(16, 24, 40, 0.18);
  display: flex;
  flex-direction: column;
}

dialog.lp-side:not([open]) {
  display: none;
}

dialog.lp-side::backdrop {
  background: rgba(16, 24, 40, 0.3);
}

dialog.lp-side .lp-side__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

dialog.lp-side .lp-side__head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

dialog.lp-side .lp-side__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px;
}

dialog.lp-side .lp-side__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.fk-sec__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.fk-sec__head:hover {
  background: var(--surface-hover);
}

.fk-sec__body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
}

.fk-active-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
}

/* 5. CREATE USER DRAWER EXTRAS ---------------------------------------------- */
.ut-drawer-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: 6px;
}

.ut-wizard-link {
  font-size: 12.5px;
  font-weight: 500;
}

.ut-upgrade-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: var(--sp-4);
}

.ut-upgrade-card__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 2px;
}

/* 6. CLASSIC 3-STEP USER CREATION WIZARD ------------------------------------ */
dialog.set-modal.ut-wizard-modal {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: var(--surface) !important;
  box-shadow: none !important;
  z-index: 100050 !important;
  overflow: hidden !important;
}

.ut-wizard-form {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  max-height: 100vh !important;
  background: var(--surface) !important;
}

.ut-wizard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.ut-wizard-head__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.ut-wizard-head__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ut-wizard-step-count {
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.ut-wizard-body {
  flex: 1;
  overflow-y: auto;
  padding: 48px 24px;
  display: flex;
  justify-content: center;
  background: var(--surface);
}

.ut-wizard-pane {
  display: none;
  width: 100%;
  max-width: 720px;
}

.ut-wizard-pane.is-active {
  display: block;
}

.ut-wizard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.ut-wizard-foot__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ut-wizard-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ut-wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.ut-wizard-step.is-active {
  color: var(--brand);
  font-weight: 700;
}

.ut-wizard-step.is-done {
  color: var(--text);
}

.ut-wizard-step__num {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-pill);
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.ut-wizard-step.is-active .ut-wizard-step__num {
  background: var(--brand);
  color: var(--surface);
  border-color: var(--brand);
}

.ut-wizard-step.is-done .ut-wizard-step__num {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand);
}

.ut-wizard-step__line {
  width: 36px;
  height: 2px;
  background: var(--border);
}

.ut-wizard-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-6);
}

.ut-wizard-pane {
  display: none;
}

.ut-wizard-pane.is-active {
  display: block;
}

.ut-wizard-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.ut-wizard-textarea {
  min-height: 120px;
  font-family: inherit;
  resize: vertical;
}

.ut-wizard-import-link {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: var(--sp-3);
}

.ut-wizard-acc {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-4);
  background: var(--surface);
  overflow: hidden;
}

.ut-wizard-acc__head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  font-size: 15px;
  background: var(--surface-2);
  border: 0;
  cursor: pointer;
  text-align: left;
}

.ut-wizard-acc__head .icon {
  transition: transform var(--fast) var(--ease);
}

.ut-wizard-acc.is-open .ut-wizard-acc__head .icon {
  transform: rotate(180deg);
}

.ut-wizard-acc__body {
  display: none;
  padding: 18px;
  border-top: 1px solid var(--border);
}

.ut-wizard-acc.is-open .ut-wizard-acc__body {
  display: block;
}

.ut-access-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.ut-access-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--fast) var(--ease);
  position: relative;
}

.ut-access-card:hover {
  border-color: var(--text-muted);
  background: var(--surface-hover);
}

.ut-access-card.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand);
}

.ut-access-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ut-access-card__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--brand);
  flex-shrink: 0;
}

.ut-access-card.is-selected .ut-access-card__icon {
  background: var(--brand);
  color: var(--surface);
}

.ut-access-card__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ut-access-card__content strong {
  font-size: 14px;
  color: var(--text);
}

.ut-access-card__content span {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.35;
}

.ut-review-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.ut-review-card .ut-review-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.ut-review-label {
  font-weight: 600;
  color: var(--text-muted);
}

.ut-review-value {
  color: var(--text);
}

.ut-wizard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.ut-wizard-foot__right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* 7. SEATS TAB ROW HOVER ACTIONS -------------------------------------------- */
.ss-seat-cell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 32px;
}

.ss-seat {
  font: inherit;
  color: var(--text);
  padding: 4px 8px;
  margin-left: -8px;
  border-radius: 6px;
  border: 1px dashed transparent;
  white-space: nowrap;
}

.ss-seat:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.ss-hover-actions {
  display: none;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ss-table tr:hover .ss-seat {
  display: none !important;
}

.ss-table tr:hover .ss-hover-actions {
  display: inline-flex !important;
}

.ss-hover-actions .btn-crm--sm {
  --btn-h: 28px;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

.ss-table td:nth-child(3),
.ss-table th:nth-child(3) {
  min-width: 240px !important;
}

/* 8. RESPONSIVE BREAKPOINTS ------------------------------------------------- */
@media (max-width: 767.98px) {
  .ut-access-cards {
    grid-template-columns: 1fr;
  }
  .ut-review-card .ut-review-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .ut-wizard-stepper {
    gap: 6px;
  }
  .ut-wizard-step__title {
    display: none;
  }
}

/* 9. VIEWS TABS BAR (Consistent with Contacts & Target Accounts) */
.ut-shell .lp-views {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 6px 16px 0;
  min-height: 44px;
}

.ut-upgrade-banner .btn-crm {
  height: 34px;
  padding: 0 16px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}

/* 10. ADD VIEW DROPDOWN POPOVER (Reused from target-accounts) */
.ta-addview-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  flex-shrink: 0;
}

.ta-add-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-ink, #4f46e5);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.ta-add-view-btn:hover {
  background: var(--brand-soft, #ede9fe);
  border-color: var(--brand);
  color: var(--brand);
}

.ta-allviews-link {
  color: var(--brand-ink, #4f46e5);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--radius-sm, 6px);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.ta-allviews-link:hover {
  text-decoration: underline;
  background: var(--surface-hover);
}

.ta-addview-pop {
  position: fixed;
  z-index: 10080;
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--border-strong, var(--border));
  border-radius: var(--radius-lg, 12px);
  box-shadow:
    0 14px 36px rgba(16, 24, 40, 0.18),
    0 2px 6px rgba(16, 24, 40, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: taPopFadeIn 0.12s ease-out;
}

@keyframes taPopFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ta-addview-pop[hidden] {
  display: none !important;
}

.ta-addview-pop__arrow {
  position: absolute;
  top: -6px;
  left: 28px;
  width: 12px;
  height: 12px;
  background: var(--surface);
  border-left: 1px solid var(--border-strong, var(--border));
  border-top: 1px solid var(--border-strong, var(--border));
  transform: rotate(45deg);
  pointer-events: none;
}

.ta-addview-pop__search {
  position: relative;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.ta-addview-search__input {
  width: 100%;
  height: 34px;
  padding: 0 32px 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  box-sizing: border-box;
}

.ta-addview-search__input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.ta-addview-search__icon {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.ta-addview-pop__body {
  display: flex;
  flex-direction: column;
  max-height: 340px;
  overflow-y: auto;
}

.ta-addview-cat {
  border-bottom: 1px solid var(--border);
}

.ta-addview-cat:last-child {
  border-bottom: none;
}

.ta-addview-cat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}

.ta-addview-cat__head:hover {
  background: var(--surface-hover);
}

.ta-addview-cat__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ta-addview-cat__icon {
  width: 14px;
  height: 14px;
  color: var(--brand);
}

.ta-addview-cat__arrow {
  color: var(--text-muted);
  display: inline-flex;
}

.ta-addview-cat__body {
  padding: 4px 8px 8px;
  background: var(--surface-hover);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ta-addview-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: var(--radius-sm, 6px);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}

.ta-addview-item:hover {
  background: var(--surface);
  color: var(--brand);
}

.ta-addview-item.is-active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.ta-addview-item svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ta-addview-pop__footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.ta-addview-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  border: 1px dashed var(--border-strong, var(--border));
  border-radius: var(--radius-sm, 6px);
  background: none;
  color: var(--brand);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  justify-content: center;
  transition:
    background 0.12s ease,
    border-color 0.12s ease;
}

.ta-addview-create-btn:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}

/* 11. CUSTOM SELECT INTEGRATION & MODAL DROPDOWNS */
.lp-cols2__frz {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lp-cols2__frz .custom-select-wrapper {
  min-width: 130px;
}

.custom-select-wrapper--sm .custom-select__trigger {
  height: 32px;
  padding: 4px 10px;
  font-size: 12.5px;
}

.ep-tool .custom-select-wrapper {
  min-width: 90px;
}

.set-drawer .custom-select-wrapper,
.set-modal .custom-select-wrapper {
  width: 100%;
}

.custom-select__dropdown {
  z-index: 10050 !important;
}

/* 12. TABLE LAYOUT & PAGINATION (Matching Contacts page lp-tablewrap & crm-pager) */
.settings__main:has(.ut-shell) {
  padding-bottom: 24px;
}

.ut-shell {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ut-shell .lp-tablewrap {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 260px;
  max-height: calc(100vh - 410px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 0 24px 16px;
  background: var(--surface);
}

.ut-shell [data-users-tablewrap] {
  margin-bottom: 0;
}

.ut-shell .lp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.ut-shell .lp-th {
  position: sticky;
  top: 0;
  z-index: 6;
  padding: 0;
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface-2, #f9fafb);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  min-width: 150px;
}

.ut-shell .lp-th__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 14px;
}

.ut-shell .lp-th__sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.ut-shell .lp-th__sort:hover {
  background: var(--surface-hover);
}

.ut-shell .lp-td {
  height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
}

.ut-shell .lp-tr:hover .lp-td {
  background: var(--surface-hover);
}

/* Sticky Checkbox and Name columns */
.ut-shell .lp-th--check,
.ut-shell .lp-td--check {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 44px;
  min-width: 44px;
  padding: 0;
  text-align: center;
  background: var(--surface);
}

.ut-shell .lp-th--check {
  z-index: 8;
  background: var(--surface-2, #f9fafb);
}

.ut-shell .lp-th--name,
.ut-shell .lp-td--name {
  position: sticky;
  left: 44px;
  z-index: 4;
  min-width: 260px;
  background: var(--surface);
  box-shadow: inset -1px 0 0 var(--border);
}

.ut-shell .lp-th--name {
  z-index: 8;
  background: var(--surface-2, #f9fafb);
}

.ut-shell .lp-tr:hover .lp-td--check,
.ut-shell .lp-tr:hover .lp-td--name {
  background: var(--surface-hover);
}

/* Centered pagination identical to Contacts page */
.ut-shell .crm-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 14px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 14px;
}

.ut-shell .crm-pager[hidden],
.ut-shell .crm-pager:empty {
  display: none !important;
}

/* Bottom bar matching Contacts page .vs-foot */
.ut-shell .vs-foot {
  position: static;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  padding: 10px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
}

.ut-shell .vs-foot__count {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  border-radius: var(--radius-pill, 999px);
  background: var(--surface-hover);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}

/* Custom Select filter triggers for Seats tab (HubSpot Frame 16 style) */
.ut-filter-pill {
  display: inline-block;
  position: relative;
}

.ut-filter-pill .custom-select__trigger {
  height: 34px !important;
  min-height: auto;
  padding: 0 10px !important;
  border-radius: var(--radius-sm) !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--text) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  transition:
    background 0.15s ease,
    color 0.15s ease !important;
}

.ut-filter-pill .custom-select__trigger:hover,
.ut-filter-pill.is-open .custom-select__trigger {
  background: var(--surface-hover) !important;
  color: var(--text) !important;
}

.ut-filter-pill.is-open .custom-select__trigger {
  background: var(--surface-3) !important;
}

.ut-filter-pill .custom-select__trigger .custom-select__arrow {
  margin-left: 2px;
  opacity: 0.7;
}

.ut-filter-pill .custom-select__dropdown {
  min-width: 210px !important;
  border-radius: var(--radius) !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
  padding: 6px 0 !important;
  z-index: 100050 !important;
}

.ut-filter-pill .custom-select__option {
  padding: 8px 14px !important;
  font-size: 13.5px !important;
  color: var(--text) !important;
  cursor: pointer !important;
  transition: background 0.12s ease !important;
}

.ut-filter-pill .custom-select__option:hover {
  background: var(--surface-hover) !important;
  color: var(--text) !important;
}

.ut-filter-pill .custom-select__option.is-selected {
  font-weight: 600 !important;
  color: var(--brand) !important;
  background: var(--surface-2) !important;
}

/* Seats tab header with Swap unassigned seats link */
.ut-seats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
}

/* ============================================================================
 *  SUBVIEWS: MANAGE USER ACCESS, PERMISSION SETS & PRESETS (user-teams.webm)
 * ============================================================================ */

/* Subview Container (Full Viewport Overlay matching Reference Video Frame 02, 06, 07, 24, 27) */
.ut-subview {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  background: var(--surface, #ffffff) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.ut-subview[hidden] {
  display: none !important;
}

body.ut-subview-open {
  overflow: hidden !important;
}

/* Subview Header (Dark Bar matching Frame 02) */
.ut-subview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 56px;
  background: #2e3f50;
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .ut-subview-head {
  background: #111827;
  border-bottom: 1px solid var(--border);
}

.ut-subview-head__left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.ut-subview-head__center {
  flex: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ut-subview-head__right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.ut-subview-back {
  color: #ffffff !important;
  background: transparent !important;
  border: none !important;
  font-family: inherit;
  font-size: 14px !important;
  font-weight: 500 !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm, 4px);
  transition: background 0.15s ease;
}

.ut-subview-back:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}

.ut-subview-title {
  color: #ffffff !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  margin: 0;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ut-subview-title-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ut-title-edit-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  transition:
    color 0.15s,
    background 0.15s;
}

.ut-title-edit-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

.ut-title-inline-input {
  max-width: 320px;
  font-size: 16px;
  font-weight: 600;
  height: 34px;
}

.ut-subview-save {
  background: #ffffff !important;
  color: #2e3f50 !important;
  font-family: inherit;
  font-weight: 600 !important;
  font-size: 14px !important;
  border-radius: 4px !important;
  padding: 7px 22px !important;
  border: none !important;
  cursor: pointer;
  transition:
    opacity 0.15s ease,
    background 0.15s ease;
}

.ut-subview-save:hover {
  background: var(--surface-hover) !important;
}

[data-theme="dark"] .ut-subview-save {
  background: var(--primary, #2563eb) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .ut-subview-save:hover {
  filter: brightness(1.1);
}

/* Subview Tabs (Centered matching Frame 02 & Frame 06) */
.ut-subview-tabs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 56px;
  z-index: 40;
}

.ut-subview-tab {
  background: none;
  border: none;
  padding: 16px 8px 14px 8px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}

.ut-subview-tab:hover {
  color: var(--text);
}

.ut-subview-tab.active {
  color: var(--text);
  font-weight: 600;
}

.ut-subview-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: #2e3f50;
  border-radius: 2px 2px 0 0;
}

[data-theme="dark"] .ut-subview-tab.active::after {
  background: var(--primary, #3b82f6);
}

/* Subview Body */
.ut-subview-body {
  flex: 1;
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 36px 32px 80px 32px;
  box-sizing: border-box;
}

.ut-subview-pane {
  display: none;
}

.ut-subview-pane.is-active {
  display: block;
}

.ut-pane-intro {
  margin-bottom: 28px;
}

.ut-pane-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px 0;
}

.ut-pane-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Accordions */
.ut-acc {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.ut-acc.is-open {
  border-color: var(--border-strong, #cbd5e1);
}

.ut-acc__head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border: none;
  cursor: pointer;
  text-align: left;
  user-select: none;
  font-family: inherit;
  gap: 12px;
}

.ut-acc__head:hover {
  background: var(--surface-hover);
}

.ut-acc__title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ut-acc__arrow {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.ut-acc.is-open .ut-acc__arrow {
  transform: rotate(0deg);
}

.ut-acc:not(.is-open) .ut-acc__arrow {
  transform: rotate(-90deg);
}

.ut-acc__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.ut-acc__badge {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.ut-acc__body {
  padding: 20px;
  border-top: 1px solid var(--border);
  display: none;
}

.ut-acc.is-open .ut-acc__body {
  display: block;
}

.ut-acc__body--nopad {
  padding: 0;
}

/* Seat assignment notes */
.ut-seat-note {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.5;
}

.ut-seat-link {
  font-size: 13.5px;
  margin-top: 8px;
}

/* 3 Access Mode Cards (Make Super Admin, Template, Scratch) */
.ut-access-cards--3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.ut-access-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.ut-access-card:hover {
  border-color: var(--border-strong, #94a3b8);
  background: var(--surface-hover);
}

.ut-access-card.is-selected {
  border-color: var(--brand, #008080);
  background: var(--surface);
  box-shadow: 0 0 0 2px rgba(0, 128, 128, 0.15);
}

.ut-access-card input[type="radio"] {
  position: absolute;
  top: 16px;
  right: 16px;
  accent-color: var(--brand, #008080);
}

.ut-access-card__art {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--brand);
  margin-bottom: 14px;
}

.ut-access-card__head {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.ut-access-card__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Permissions Editor (2-Column Category Sidebar + Permissions Panel) */
.ut-perm-editor {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 520px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.ut-perm-side {
  border-right: 1px solid var(--border);
  background: var(--surface-2);
  padding: 16px;
}

.ut-perm-search {
  width: 100%;
  margin-bottom: 12px;
}

.ut-perm-cats {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ut-perm-cat-grp {
  margin-bottom: 6px;
}

.ut-perm-cat-grp__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  cursor: pointer;
}

.ut-perm-cat-grp__items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 6px;
}

.ut-perm-cat {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.ut-perm-cat:hover {
  background: var(--surface-hover);
}

.ut-perm-cat.is-active {
  background: var(--surface);
  color: var(--brand, #008080);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.ut-perm-main {
  background: var(--surface);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
}

.ut-perm-top-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.ut-exp-icon {
  font-weight: 700;
  margin-right: 4px;
}

/* Permission Items List */
.ut-perm-items-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ut-perm-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.ut-perm-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface);
  gap: 14px;
}

.ut-perm-item__info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.ut-perm-item__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ut-perm-item__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  cursor: pointer;
}

.ut-perm-item__toggle-head {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ut-perm-item__arrow {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.ut-perm-item.is-open .ut-perm-item__arrow {
  transform: rotate(0deg);
}

.ut-perm-item:not(.is-open) .ut-perm-item__arrow {
  transform: rotate(-90deg);
}

.ut-perm-item__desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.ut-perm-item__status {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.ut-perm-item__acts {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ut-perm-item__body {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: none;
}

.ut-perm-item.is-open .ut-perm-item__body {
  display: block;
}

.ut-perm-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 13.5px;
  gap: 16px;
}

.ut-perm-subrow:last-child {
  border-bottom: none;
}

.ut-perm-subrow__lbl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text);
}

.ut-critical-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-pill, 999px);
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Switch styling helper */
.switch__state-label {
  margin-left: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Review Tab (Matching Reference Video Frame 06 & Frame 07) */
.ut-review-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.ut-review-toolbar .custom-select-wrapper {
  min-width: 180px;
}

.ut-review-search-wrap {
  position: relative;
  width: 280px;
}

.ut-review-search-input {
  width: 100%;
  padding-right: 32px !important;
  height: 36px;
  font-size: 13.5px;
  border-radius: var(--radius-sm, 4px);
}

.ut-review-search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.ut-review-groups {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ut-review-grp {
  margin-bottom: 4px;
}

.ut-review-grp__head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 6px 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  user-select: none;
  transition: color 0.15s ease;
}

.ut-review-grp__head:hover {
  color: var(--primary, #0073e6);
}

.ut-review-grp__arrow {
  transition: transform 0.2s ease;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ut-review-grp.is-collapsed .ut-review-grp__arrow {
  transform: rotate(-90deg);
}

.ut-review-grp.is-collapsed .ut-review-grp__list {
  display: none !important;
}

.ut-review-grp__list {
  padding-left: 22px;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ut-review-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  text-align: left !important;
  gap: 3px !important;
  width: 100% !important;
}

.ut-review-item__title {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--text) !important;
  line-height: 1.35 !important;
  text-align: left !important;
}

.ut-review-item__detail {
  font-size: 13px !important;
  color: var(--text-muted) !important;
  line-height: 1.35 !important;
  text-align: left !important;
}

/* Presets Email Signature Card (Matching Frame 27) */
.ut-sig-card {
  padding: 20px;
}

.ut-sig-card__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.ut-sig-card__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: var(--text);
}

.ut-sig-card__desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0;
  max-width: 600px;
  line-height: 1.5;
}

.ut-sig-card__editor {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Presets Users & Teams applies list */
.ut-preset-applies {
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  min-height: 60px;
  margin-top: 8px;
}

.ut-preset-applies-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-pill, 999px);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  margin: 4px 4px 4px 0;
}

.ut-preset-applies-pill button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--text-muted);
  display: inline-flex;
}

.ut-preset-applies-pill button:hover {
  color: var(--text);
}

/* Teams Table Row Hover Actions (Matching Frame 22) */
.tt-name-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tt-hover-actions {
  display: none;
  align-items: center;
  gap: 6px;
}

.lp-tr:hover .tt-hover-actions {
  display: inline-flex;
}

/* User Selection List in Permission Set Users pane */
.ut-pset-users-list {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.ut-pset-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.ut-pset-user-item:last-child {
  border-bottom: none;
}

/* Responsive Rules */
@media (max-width: 991px) {
  .ut-access-cards--3 {
    grid-template-columns: 1fr;
  }
  .ut-perm-editor {
    grid-template-columns: 1fr;
  }
  .ut-perm-side {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .ut-subview-head {
    padding: 12px 16px;
  }
  .ut-subview-body {
    padding: 16px;
  }
}

@media (max-width: 640px) {
  .ut-subview-head__left {
    gap: 8px;
  }
  .ut-subview-title {
    font-size: 15px;
  }
  .ut-acc__head {
    padding: 12px 14px;
  }
  .ut-acc__body {
    padding: 14px;
  }
  .ut-sig-card__main {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Icon sizing utilities */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.iconSize-12 {
  width: 12px;
  height: 12px;
}
.iconSize-14 {
  width: 14px;
  height: 14px;
}
.iconSize-16 {
  width: 16px;
  height: 16px;
}
.iconSize-18 {
  width: 18px;
  height: 18px;
}
.iconSize-20 {
  width: 20px;
  height: 20px;
}
.iconSize-24 {
  width: 24px;
  height: 24px;
}
.iconSize-28 {
  width: 28px;
  height: 28px;
}

/* Custom select triggers inside subview filters */
.ut-review-toolbar .custom-select-wrapper {
  min-width: 160px;
}

/* ============================================================================
 *  FULL VIEW MODE (Matching Reference Video Frame 02 - Hides Settings Nav)
 * ============================================================================ */
.settings.ut-subview-open {
  display: block !important;
}

.settings.ut-subview-open .settings-nav {
  display: none !important;
}

.settings.ut-subview-open .settings__main {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

.settings.ut-subview-open .ut-subview {
  border: none !important;
  border-radius: 0 !important;
  min-height: calc(100vh - 60px) !important;
  box-shadow: none !important;
  margin-bottom: 0 !important;
}

/* Standalone Full Page View */
.user-access-standalone {
  width: 100%;
  min-height: calc(100vh - 60px);
  background: var(--surface);
}

.user-access-standalone .ut-subview {
  display: flex !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin-bottom: 0 !important;
}

.user-access-standalone .ut-subview-head {
  padding: 16px 32px;
}

.user-access-standalone .ut-subview-tabs {
  padding: 0 32px;
}

.user-access-standalone .ut-subview-body {
  padding: 32px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ============================================================================
 *  ROW MENU DROPDOWN FIX (Users Table)
 * ============================================================================ */
.ut-shell .lp-tr.is-menu-open,
.ut-shell .lp-tr.is-menu-open .lp-td--name,
.ut-shell .lp-tr.is-menu-open .lp-td--check {
  z-index: 100 !important;
}

.row-menu__list {
  position: fixed !important;
  z-index: 100050 !important;
  min-width: 210px !important;
  width: max-content !important;
  max-width: 280px !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.14) !important;
  padding: 6px 0 !important;
  text-align: left !important;
  box-sizing: border-box !important;
}

.row-menu__list button.row-menu__item,
.row-menu__list .row-menu__item {
  display: block !important;
  width: 100% !important;
  padding: 8px 16px !important;
  font-family: inherit !important;
  font-size: 13.5px !important;
  font-weight: 400 !important;
  color: var(--text) !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  text-align: left !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition:
    background 0.12s ease,
    color 0.12s ease !important;
  box-sizing: border-box !important;
}

.row-menu__list button.row-menu__item:hover,
.row-menu__list .row-menu__item:hover {
  background: var(--surface-hover) !important;
  color: var(--text) !important;
}

.row-menu__list button.row-menu__item.ut-danger,
.row-menu__list .row-menu__item.ut-danger {
  color: var(--danger) !important;
}

.row-menu__list button.row-menu__item.ut-danger:hover,
.row-menu__list .row-menu__item.ut-danger:hover {
  background: var(--surface-hover) !important;
  color: var(--danger) !important;
}

.row-menu__sep {
  height: 1px !important;
  background: var(--border) !important;
  margin: 6px 0 !important;
}

/* ============================================================================
 *  PERMISSION SETS TABLE FIX
 * ============================================================================ */
/* Sequences SQ-4 (Q-20): the settings column is ~570px at 1280 and ~730px at 1440, so the
   old minimums (720px table, 360px Access) pushed Users and Edit/Delete out of view. The
   columns now fit: the name and the Access badges wrap, Users and Actions keep their size. */
.pp-table {
  width: 100% !important;
  min-width: 0 !important;
  /* The column widths below decide, not the longest name or badge row. */
  table-layout: fixed !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.pp-table .lp-th--name,
.pp-table .lp-td--name,
.pp-table td:first-child {
  position: static !important;
  left: auto !important;
  z-index: auto !important;
  box-shadow: none !important;
  min-width: 140px !important;
  width: 30% !important;
  white-space: normal !important;
}

.pp-table th:nth-child(2),
.pp-table td:nth-child(2) {
  min-width: 0 !important;
  width: auto !important;
  white-space: normal !important;
}

.pp-table .pp-users,
.pp-table th.pp-users {
  width: 96px !important;
  min-width: 96px !important;
  text-align: right !important;
}

.pp-table .col-actions,
.pp-table th.col-actions {
  width: 112px !important;
  min-width: 112px !important;
  text-align: right !important;
  white-space: nowrap !important;
}
.pp-table .ut-name__link {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}
.pp-table .ut-tag {
  white-space: nowrap;
}
.pp-table td.col-actions .link + .link {
  margin-left: var(--sp-3);
}

/* #460: at ~850px the settings column is narrower than these mins, so the name
   was clipped and Edit/Delete sat off-screen. Let the tables shrink and wrap. */
@media (max-width: 1100px) {
  .pp-table {
    min-width: 0 !important;
  }
  .pp-table .lp-th--name,
  .pp-table th:nth-child(2),
  .pp-table td:nth-child(2),
  .pp-table .pp-users,
  .pp-table th.pp-users {
    min-width: 0 !important;
    width: auto !important;
  }
  .pp-table th,
  .pp-table td {
    white-space: normal !important;
  }
  .pp-table .col-actions,
  .pp-table th.col-actions {
    white-space: nowrap !important;
  }
  [data-presets-tablewrap] .lp-table {
    min-width: 0;
  }
  .ut-shell .lp-th,
  .ut-shell .lp-td {
    min-width: 0;
    white-space: normal;
  }
  .ut-shell .col-actions {
    white-space: nowrap;
  }
}

.pp-access {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text, #33475b);
  white-space: normal;
  line-height: 1.4;
}

.pp-level {
  display: block;
  font-size: 12px;
  color: var(--text-muted, #7c98b6);
  margin-top: 2px;
}

/* ==========================================================================
   ENHANCED USER CREATION & SEAT MANAGEMENT STYLES (MATCHING REFERENCE)
   ========================================================================== */
/* Drawer Top Links (Wizard & Clone links stacked on top-right) */
.ut-drawer-top-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-bottom: var(--sp-4);
  text-align: right;
}

.ut-wizard-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--brand);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.ut-wizard-link:hover {
  text-decoration: underline;
}

.ut-clone-dropdown {
  position: relative;
}

.ut-clone-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--brand);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ut-clone-link:hover {
  text-decoration: underline;
}

#create-user.is-clone-open .set-modal__body,
#create-user:has([data-clone-dropdown].is-open) .set-modal__body {
  overflow-y: hidden !important;
}

.ut-clone-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  width: 280px;
  max-width: calc(100vw - 32px);
  padding: 12px;
  border-radius: var(--radius-lg, 12px);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow:
    0 10px 28px rgba(16, 24, 40, 0.14),
    0 4px 10px rgba(16, 24, 40, 0.06);
  z-index: 100;
  overflow: visible !important;
  max-height: none !important;
}

/* Speech-bubble arrow pointing to trigger */
.ut-clone-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 28px;
  width: 10px;
  height: 10px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
  z-index: 1;
}

.ut-clone-menu[hidden] {
  display: none !important;
}

.ut-clone-search-wrap {
  position: relative;
  margin-bottom: 8px;
}

.ut-clone-search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.ut-clone-search-input {
  width: 100%;
  height: 34px;
  padding: 6px 32px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  font-size: 13px;
  color: var(--text);
  box-sizing: border-box;
}

.ut-clone-search-input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 2px var(--brand-soft, rgba(36, 86, 230, 0.15));
}

.ut-clone-title {
  padding: 4px 6px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 0;
}

.ut-clone-list {
  max-height: 190px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 2px 0;
  margin: 0;
  scrollbar-width: thin;
}

.ut-clone-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm, 6px);
  border: none;
  background: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.ut-clone-item:hover {
  background: var(--surface-hover);
}

.ut-clone-item.is-selected {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--brand);
}

.ut-clone-item.is-hidden {
  display: none !important;
}

.ut-clone-avatar {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  font-size: 10px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ut-clone-item.is-selected .ut-clone-avatar {
  background: var(--brand);
  color: #ffffff;
}

.ut-clone-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Drawer Seat Custom Dropdown */
.ut-drawer-seat-wrap {
  position: relative;
  width: 100%;
}

.ut-drawer-seat-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 var(--sp-3);
  height: 38px;
  cursor: pointer;
  color: var(--text);
  font-size: 13.5px;
  box-sizing: border-box;
}

.ut-drawer-seat-trigger:focus,
.ut-drawer-seat-wrap.is-open .ut-drawer-seat-trigger {
  border-color: var(--brand);
  outline: none;
}

.ut-drawer-seat-icon {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.ut-drawer-seat-wrap.is-open .ut-drawer-seat-icon {
  transform: rotate(180deg);
}

.ut-drawer-seat-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 4px;
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
  box-sizing: border-box;
}

.ut-drawer-seat-menu[hidden] {
  display: none !important;
}

.ut-drawer-seat-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.ut-drawer-seat-opt:hover {
  background: var(--surface-hover);
}

.ut-drawer-seat-opt.is-selected {
  background: var(--surface-2);
}

.ut-drawer-seat-chk {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface);
  transition: all 0.15s ease;
}

.ut-drawer-seat-opt.is-selected .ut-drawer-seat-chk {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.ut-drawer-seat-chk svg {
  width: 11px;
  height: 11px;
  display: none;
}

.ut-drawer-seat-opt.is-selected .ut-drawer-seat-chk svg {
  display: block;
}

.ut-drawer-seat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ut-drawer-seat-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}

.ut-drawer-seat-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

#create-user button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Seats Tab Row Hover Actions & Status */
.ss-name-cell {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.ss-change-btn {
  display: none;
  margin-left: 8px;
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.ss-table tr:hover .ss-change-btn {
  display: inline-flex;
  align-items: center;
}

.ss-status-wrap {
  display: inline-flex;
  flex-direction: column;
}

.ss-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

.ss-dot--accepted {
  background-color: var(--success);
}

.ss-dot--pending {
  background-color: var(--warning);
}

.ss-dot--bounced {
  background-color: var(--danger);
}

.ut-ext-btn {
  font: inherit;
  color: var(--brand);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  text-decoration: underline;
}

.ut-customize-invite {
  margin-left: var(--sp-2);
  font-size: 12.5px;
}

/* Teams Modals & Drawers Custom Select Fixes */
#move-team-dialog,
#move-team-dialog form,
#move-team-dialog .set-modal__body {
  overflow: visible !important;
}

#move-team-dialog .custom-select-wrapper {
  width: 100%;
  display: block;
  position: relative;
}

#move-team-dialog .custom-select__trigger {
  width: 100%;
  color: var(--text);
  font-size: 14px;
}

#move-team-dialog .custom-select__dropdown {
  width: 100%;
  min-width: 100%;
  z-index: 1100;
  max-height: 220px;
}

#team-drawer .custom-select-wrapper {
  width: 100%;
  display: block;
}

#team-drawer .custom-select-wrapper.is-open {
  position: relative;
  z-index: 1050;
}

#team-drawer .custom-select__trigger {
  width: 100%;
  color: var(--text);
  font-size: 14px;
}

#team-drawer .custom-select__dropdown {
  width: 100%;
  min-width: 100%;
  z-index: 1100;
  max-height: 220px;
}

.custom-select-wrapper.is-open {
  z-index: 1050;
}

.custom-select-wrapper.is-open .custom-select__trigger {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 2px var(--brand-soft, rgba(36, 86, 230, 0.15)) !important;
}

.custom-select__option:hover {
  background: var(--surface-hover) !important;
  color: var(--text) !important;
}

.custom-select__option.is-selected {
  background: var(--surface-2) !important;
  color: var(--brand) !important;
  font-weight: 600;
}

/* Responsive main tabs More dropdown */
.os-tabbar .os-tab-more {
  flex: none;
  position: relative;
  display: inline-flex;
}

.os-tabbar .os-tab-more > .os-tab {
  border-top-right-radius: var(--radius-sm);
}

.os-tabbar .os-pop--menu {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  z-index: 1200;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg, 0 10px 28px rgba(0, 0, 0, 0.14));
  padding: 6px;
}

.os-tabbar .os-menu__item {
  display: flex;
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s ease;
}

.os-tabbar .os-menu__item:hover,
.os-tabbar .os-menu__item:focus-visible {
  background: var(--surface-hover);
  outline: none;
}

.os-tabbar .os-menu__item.is-active {
  font-weight: 600;
  color: var(--brand);
  background: var(--surface-2);
}

/* React Users tab: CustomSelect inside quick-filter chips */
.ut-filters-row .lp-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.ut-filters-row .lp-chip .custom-select,
.ut-filters-row .lp-chip .lp-chip__select {
  min-width: 0;
}

.ut-filters-row .lp-chip .custom-select__trigger,
.ut-filters-row .lp-chip .custom-select-trigger {
  border: 0;
  background: transparent;
  box-shadow: none;
  min-height: 28px;
  padding-inline: 8px 6px;
  font-size: 13px;
}

/* Create team: one person per row, name and email (#456). */
.ut-team-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 280px;
  margin-top: 8px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}
.ut-member {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.ut-member:hover {
  background: var(--surface-2);
}
.ut-member input {
  flex: none;
  margin-top: 3px;
}
.ut-member__name {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.ut-member__email {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}
