.searchable-select-native {
  position: absolute !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  inset-inline-start: 0;
  inset-block-end: 0;
}

.searchable-select-shell {
  position: relative;
  inline-size: 100%;
  min-inline-size: 0;
  font: inherit;
}

.searchable-select-trigger {
  inline-size: 100%;
  min-block-size: 2rem;
  block-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .25rem .75rem;
  border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
  border-radius: .5rem;
  background: color-mix(in srgb, var(--gray-900, #18181b) 82%, transparent);
  color: var(--gray-100, #f4f4f5);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
  cursor: pointer;
  text-align: start;
  font: inherit;
  font-size: .8125rem;
  line-height: 1.25rem;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.searchable-select-trigger:hover,
.searchable-select-shell.is-open .searchable-select-trigger {
  border-color: var(--primary-500, #c9a84c);
}

.searchable-select-shell.is-open .searchable-select-trigger {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-500, #c9a84c) 18%, transparent);
}

.searchable-select-trigger-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-trigger-icon {
  flex: 0 0 auto;
  inline-size: .6rem;
  block-size: .6rem;
  border-inline-end: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: .7;
  transition: transform .18s ease;
}

.searchable-select-shell.is-open .searchable-select-trigger-icon {
  transform: rotate(225deg) translate(-2px, -2px);
}

.searchable-select-dropdown {
  position: absolute;
  z-index: 2500;
  inset-inline: 0;
  inset-block-start: calc(100% + .35rem);
  display: none;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  border-radius: .65rem;
  background: var(--gray-950, #09090b);
  color: var(--gray-100, #f4f4f5);
  box-shadow: 0 18px 45px rgba(0, 0, 0, .34);
}

.searchable-select-shell.is-open .searchable-select-dropdown {
  display: block;
}

.searchable-select-search-wrap {
  padding: .35rem;
  border-block-end: 1px solid color-mix(in srgb, currentColor 10%, transparent);
}

.searchable-select-search {
  inline-size: 100%;
  min-block-size: 2rem;
  block-size: 2rem;
  border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
  border-radius: .45rem;
  background: color-mix(in srgb, var(--gray-900, #18181b) 88%, transparent);
  color: inherit;
  padding: .25rem .7rem;
  outline: none;
  font: inherit;
}

.searchable-select-search:focus {
  border-color: var(--primary-500, #c9a84c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-500, #c9a84c) 15%, transparent);
}

.searchable-select-options {
  max-block-size: 13rem;
  overflow-y: auto;
  padding: .2rem;
}

.searchable-select-option {
  inline-size: 100%;
  min-block-size: 1.5rem;
  display: flex;
  align-items: center;
  padding: .2rem .55rem;
  border: 0;
  border-radius: .42rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: start;
  font: inherit;
  font-size: .75rem;
  line-height: 1rem;
}

.searchable-select-option:hover,
.searchable-select-option.is-selected {
  background: color-mix(in srgb, var(--primary-500, #c9a84c) 16%, transparent);
  color: var(--primary-300, #dfc36a);
}

.searchable-select-empty {
  padding: .85rem;
  color: var(--gray-400, #a1a1aa);
  text-align: center;
  font-size: .875rem;
}

.phone-field-grid {
  display: grid;
  grid-template-columns: minmax(6.25rem, 3fr) minmax(0, 7fr);
  gap: .5rem;
  align-items: end;
}

.phone-field-grid > * {
  min-inline-size: 0;
}

html.light .searchable-select-trigger,
html:not(.dark) .fi-simple-layout .searchable-select-trigger {
  background: #fff;
  color: #18181b;
  border-color: #d4d4d8;
}

html.light .searchable-select-dropdown,
html:not(.dark) .fi-simple-layout .searchable-select-dropdown {
  background: #fff;
  color: #18181b;
  border-color: #e4e4e7;
}

html.light .searchable-select-search,
html:not(.dark) .fi-simple-layout .searchable-select-search {
  background: #fafafa;
  color: #18181b;
  border-color: #d4d4d8;
}

@media (max-width: 640px) {
  .phone-field-grid {
    grid-template-columns: minmax(5.75rem, 3fr) minmax(0, 7fr);
    gap: .4rem;
  }
}

/* Every Filament international-phone control stays in one 30/70 row on all widths. */
.international-phone-grid {
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
  align-items: start !important;
  min-inline-size: 0;
}

.international-phone-grid > * {
  min-inline-size: 0;
}

/* Slightly increase the complete Filament UI scale without affecting the public site. */
html:has(body.fi-body) {
  font-size: 17px;
}

/* Keep selected/placeholder text vertically centered in every Filament dropdown. */
.fi-select-input .fi-select-input-btn,
.fi-select-input [role='combobox'] {
  display: flex !important;
  align-items: center !important;
}

.fi-select-input .fi-select-input-value-ctn {
  display: flex !important;
  align-items: center !important;
  block-size: 100% !important;
  min-block-size: 0 !important;
}

.fi-select-input .fi-select-input-value-label,
.fi-select-input .fi-select-input-placeholder {
  display: flex !important;
  align-items: center !important;
  min-block-size: 0 !important;
  line-height: 1.25rem !important;
}

/* Match every Filament select trigger to the compact 2rem text-input height. */
.fi-select-input,
select.fi-select-input,
.fi-select-input div[x-ref='select'],
.fi-select-input .fi-select-input-btn,
.fi-select-input [role='combobox'] {
  min-block-size: 2rem !important;
  block-size: 2rem !important;
  padding-block: 0 !important;
  font-size: .8125rem !important;
  line-height: 1.25rem !important;
}

.fi-select-input .fi-select-input-value-ctn,
.fi-select-input .fi-select-input-value-label {
  line-height: 1.25rem !important;
  align-items: center !important;
}

.fi-select-input:has(.fi-select-input-value-badges-ctn) div[x-ref='select'],
.fi-select-input:has(.fi-select-input-value-badges-ctn) .fi-select-input-btn,
.fi-select-input:has(.fi-select-input-value-badges-ctn) [role='combobox'] {
  block-size: auto !important;
  min-block-size: 2rem !important;
}

/* The selected phone country is always rendered as a compact LTR calling code. */
.searchable-select-shell[data-trigger-direction='ltr'] .searchable-select-trigger,
.searchable-select-shell[data-trigger-direction='ltr'] .searchable-select-trigger-text {
  direction: ltr;
  text-align: left;
}

.phone-country-code-select .fi-select-input-btn,
.phone-country-code-select [role='combobox'],
.phone-country-code-select .fi-select-input-value-ctn,
.phone-country-code-select .fi-select-input-value-label {
  direction: ltr !important;
  text-align: left !important;
}

.phone-country-code-select .fi-select-input-value-ctn {
  justify-content: center !important;
  inline-size: 100% !important;
}

/* Keep the dropdown panel and every option row compact without shrinking the field. */
.fi-select-input .fi-select-input-search-ctn {
  padding: .3rem !important;
}

.fi-select-input .fi-select-input-options-ctn {
  max-block-size: 13rem !important;
  padding: .15rem !important;
}

.fi-dropdown-list-item,
.fi-select-input .fi-select-input-option {
  display: flex !important;
  align-items: center !important;
  min-block-size: 1.5rem !important;
  padding-block: .125rem !important;
  padding-inline: .4rem !important;
  font-size: .75rem !important;
  line-height: 1rem !important;
}

.fi-dropdown-list-item-label,
.fi-select-input .fi-select-input-option > span,
.fi-select-input .fi-select-input-option-label {
  font-size: .75rem !important;
  line-height: 1rem !important;
}

.fi-select-input .fi-select-input-option svg,
.fi-dropdown-list-item svg {
  inline-size: 1rem !important;
  block-size: 1rem !important;
}

/* Explicit light/dark colors for custom searchable selects used inside Filament/auth pages. */
html.dark .searchable-select-trigger,
html.dark .searchable-select-search {
  background: rgb(17, 24, 39);
  color: rgb(243, 244, 246);
  border-color: rgba(255, 255, 255, .14);
}

html.dark .searchable-select-dropdown {
  background: rgb(17, 24, 39);
  color: rgb(243, 244, 246);
  border-color: rgba(255, 255, 255, .14);
}

html.dark .searchable-select-option:hover,
html.dark .searchable-select-option.is-selected {
  background: rgba(201, 168, 76, .16);
  color: rgb(230, 195, 103);
}



/* Phone controls always keep the country code on the physical left. */
.phone-field-grid {
  direction: ltr !important;
}

.international-phone-grid {
  direction: inherit !important;
}

html[dir='rtl'] .phone-field-grid > *,
html[dir='rtl'] .international-phone-grid > * {
  direction: rtl;
  text-align: right;
}

html[dir='ltr'] .phone-field-grid > *,
html[dir='ltr'] .international-phone-grid > * {
  direction: ltr;
  text-align: left;
}

.phone-field-grid input[type='tel'],
.international-phone-grid input[type='tel'],
.phone-field-grid [inputmode='tel'],
.international-phone-grid [inputmode='tel'] {
  direction: ltr !important;
  text-align: left !important;
}

/* Slightly taller dropdown rows without changing the closed selected control. */
.searchable-select-option {
  min-block-size: 2.125rem;
  padding-block: .4375rem;
  padding-inline: .75rem;
  font-size: .8125rem;
  line-height: 1.25rem;
}

/* Light-mode items use black text; the selected item keeps its existing accent style. */
html:not(.dark) .searchable-select-option:not(.is-selected) {
  color: #111827;
}

html:not(.dark) .searchable-select-option:not(.is-selected):hover,
html:not(.dark) .searchable-select-option:not(.is-selected):focus-visible {
  color: #111827;
}

/* Selected custom-select text follows the active theme. */
html:not(.dark) .searchable-select-trigger,
html:not(.dark) .searchable-select-trigger-text,
html:not(.dark) .searchable-select-option.is-selected,
html:not(.dark) .searchable-select-option[aria-selected='true'] {
  color: #111827 !important;
}

html.dark .searchable-select-trigger,
html.dark .searchable-select-trigger-text,
html.dark .searchable-select-option.is-selected,
html.dark .searchable-select-option[aria-selected='true'] {
  color: #ffffff !important;
}


/* International phone country options: full name in the open list, code only when selected. */
.phone-country-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  inline-size: 100%;
  min-inline-size: 0;
}

.phone-country-option-name {
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-country-option-code {
  direction: ltr;
  unicode-bidi: isolate;
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Closed country selector must display only +code, never the country name. */
.phone-country-code-select .fi-select-input-value-label .phone-country-option-name {
  display: none !important;
}

.phone-country-code-select .fi-select-input-value-label .phone-country-option-row {
  display: inline-flex !important;
  justify-content: center !important;
  inline-size: auto !important;
}

/* The country search/list popup is intentionally wider than the compact code field. */
.fi-dropdown-panel[role='listbox']:has(.phone-country-option-row) {
  width: min(22rem, calc(100vw - 1.5rem)) !important;
  max-width: calc(100vw - 1.5rem) !important;
}

.fi-dropdown-panel[role='listbox']:has(.phone-country-option-row) .fi-select-input-search-ctn,
.fi-dropdown-panel[role='listbox']:has(.phone-country-option-row) .fi-select-input-search-ctn .fi-input {
  inline-size: 100% !important;
}

/* International phone row: align the compact country selector with the phone input. */
.international-phone-grid .phone-country-code-column,
.international-phone-grid .phone-national-column {
  align-self: start !important;
  min-inline-size: 0 !important;
}

/* The country label is accessibility-only. Reserve exactly one normal label row
   so its select trigger starts at the same vertical position as the phone input. */
.international-phone-grid .phone-country-code-column {
  padding-block-start: 1.625rem !important;
}

/* Keep both phone controls at exactly the same height and baseline. */
.international-phone-grid .phone-country-code-select .fi-select-input,
.international-phone-grid .phone-country-code-select .fi-select-input-btn,
.international-phone-grid .phone-country-code-select [role='combobox'],
.international-phone-grid .phone-national-column .fi-input-wrp,
.international-phone-grid .phone-national-column input {
  min-block-size: 2.5rem !important;
  block-size: 2.5rem !important;
}

/* Country code is centered while a dedicated chevron stays visible at the edge. */
.phone-country-code-select .fi-select-input-btn,
.phone-country-code-select [role='combobox'] {
  position: relative !important;
  justify-content: center !important;
  padding-inline: 1.75rem !important;
  overflow: visible !important;
}

.phone-country-code-select .fi-select-input-btn > svg:last-child,
.phone-country-code-select [role='combobox'] > svg:last-child {
  display: none !important;
}

.phone-country-code-select .fi-select-input-btn::after,
.phone-country-code-select [role='combobox']::after {
  content: '';
  position: absolute;
  inset-inline-end: .65rem;
  inset-block-start: 50%;
  inline-size: .42rem;
  block-size: .42rem;
  border-inline-end: 1.5px solid currentColor;
  border-block-end: 1.5px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  opacity: .7;
  pointer-events: none;
}

.phone-country-code-select .fi-select-input-value-label,
.phone-country-code-select .phone-country-option-code {
  text-align: center !important;
}


/* Phone placement is controlled by Filament columnStart() in PHP.
   Preserve the page direction so RTL grid line numbering remains correct. */
.international-phone-grid {
  direction: inherit !important;
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
}

/* Filament panel integration: data-searchable-select is used only for option lists
   backed by records/large dynamic datasets. Fixed option selects remain normal Filament selects. */
html:not(.dark) .searchable-select-trigger {
  background: #fff;
  color: rgb(17 24 39);
  border-color: rgb(209 213 219);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
}

html:not(.dark) .searchable-select-trigger:hover,
html:not(.dark) .searchable-select-trigger:focus-visible {
  border-color: rgb(156 163 175);
}

html:not(.dark) .searchable-select-dropdown {
  background: #fff;
  color: rgb(17 24 39);
  border-color: rgb(229 231 235);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
}

html:not(.dark) .searchable-select-search {
  background: #fff;
  color: rgb(17 24 39);
  border-color: rgb(209 213 219);
}

html:not(.dark) .searchable-select-option:hover,
html:not(.dark) .searchable-select-option.is-highlighted,
html:not(.dark) .searchable-select-option.is-selected {
  background: rgb(249 250 251);
  color: rgb(17 24 39);
}

html.dark .searchable-select-trigger {
  background: rgb(17 24 39);
  color: rgb(243 244 246);
  border-color: rgb(75 85 99);
}

html.dark .searchable-select-trigger:hover,
html.dark .searchable-select-trigger:focus-visible {
  border-color: rgb(107 114 128);
}

html.dark .searchable-select-dropdown {
  background: rgb(17 24 39);
  color: rgb(243 244 246);
  border-color: rgb(55 65 81);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / .35), 0 4px 6px -4px rgb(0 0 0 / .3);
}

html.dark .searchable-select-search {
  background: rgb(31 41 55);
  color: rgb(243 244 246);
  border-color: rgb(75 85 99);
}

html.dark .searchable-select-option:hover,
html.dark .searchable-select-option.is-highlighted,
html.dark .searchable-select-option.is-selected {
  background: rgb(31 41 55);
  color: rgb(255 255 255);
}

/* Unified Follow-up filter header (Table + Kanban).
   Use a single Filament-like surface with real inner padding so fields never
   touch the shell edges and both views keep the same visual hierarchy. */
.crm-followup-filter-surface,
.crm-followups-flat-table .fi-ta-filters-above-content-ctn {
  inline-size: 100%;
  min-inline-size: 0;
  margin: 0 !important;
  padding: 1rem !important;
  border: 1px solid rgb(229 231 235) !important;
  border-radius: .75rem !important;
  background: rgb(255 255 255) !important;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05) !important;
  overflow: visible !important;
}

.dark .crm-followup-filter-surface,
.dark .crm-followups-flat-table .fi-ta-filters-above-content-ctn {
  border-color: rgb(55 65 81) !important;
  background: rgb(17 24 39) !important;
}

.crm-followup-filter-utility-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  min-inline-size: 0;
  margin: 0 0 .6rem;
}

.crm-followup-filter-utility-row-end {
  justify-content: flex-end;
}

.crm-followup-filter-utility-label {
  min-inline-size: 0;
  color: rgb(75 85 99);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1rem;
}

.crm-followups-flat-table .fi-ta-filters-above-content-ctn .fi-fo-field-wrp {
  min-inline-size: 0;
  row-gap: .35rem !important;
}

.crm-followups-flat-table .fi-ta-filters-above-content-ctn .fi-fo-field-label,
.crm-followups-flat-table .fi-ta-filters-above-content-ctn .fi-fo-field-label-content,
.crm-kanban-field label {
  font-size: .75rem !important;
  font-weight: 700 !important;
  line-height: 1rem !important;
}

.dark .crm-followup-filter-utility-label {
  color: rgb(209 213 219);
}

/* Follow-up primary filters share one responsive contract in Table and Kanban.
   Auto-fit prevents the table header from forcing too many controls into a
   narrow content width (for example when the Filament sidebar is open). */
.crm-followup-filter-grid,
.crm-kanban-filter-grid,
.crm-primary-filter-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(12.75rem, 1fr)) !important;
  gap: .75rem !important;
  align-items: end !important;
  inline-size: 100% !important;
  max-inline-size: 100% !important;
  min-inline-size: 0 !important;
}

.crm-followup-filter-grid > *,
.crm-kanban-filter-grid > *,
.crm-primary-filter-grid > * {
  min-inline-size: 0 !important;
  max-inline-size: 100% !important;
}

/* Advanced filters follow the same width-aware behavior, but use a slightly
   wider minimum because these labels are generally longer. */
.crm-followup-advanced-grid,
.crm-kanban-advanced-grid,
.crm-inline-filter-section .fi-sc-grid,
.crm-inline-filter-section .fi-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(12.75rem, 1fr)) !important;
  gap: .75rem !important;
  align-items: end !important;
  inline-size: 100% !important;
  max-inline-size: 100% !important;
  min-inline-size: 0 !important;
}

.crm-followup-advanced-grid > *,
.crm-kanban-advanced-grid > *,
.crm-inline-filter-section .fi-sc-grid > *,
.crm-inline-filter-section .fi-grid > * {
  min-inline-size: 0 !important;
  max-inline-size: 100% !important;
}

@media (max-width: 639.98px) {
  .crm-followup-filter-surface,
  .crm-followups-flat-table .fi-ta-filters-above-content-ctn {
    padding: .75rem !important;
  }

  .crm-followup-filter-grid,
  .crm-kanban-filter-grid,
  .crm-primary-filter-grid,
  .crm-followup-advanced-grid,
  .crm-kanban-advanced-grid,
  .crm-inline-filter-section .fi-sc-grid,
  .crm-inline-filter-section .fi-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .crm-followup-filter-utility-row {
    align-items: stretch;
    flex-direction: column;
    gap: .45rem;
  }

  .crm-followup-filter-utility-row .fi-btn {
    inline-size: 100%;
    justify-content: center;
  }

  .crm-filter-divider {
    gap: .35rem;
  }

  .crm-filter-divider-line {
    min-inline-size: .65rem;
  }

  .crm-filter-divider-button,
  .crm-inline-filter-section .fi-section-header-text-ctn {
    max-inline-size: calc(100vw - 3rem);
  }

  .crm-followup-advanced-toggle,
  .crm-inline-filter-section .fi-section-header-heading {
    white-space: normal !important;
    text-align: center;
  }
}

/* Compact Follow-up filter layout. The advanced area stays on the same surface:
   primary inputs -> dashed divider/button -> advanced inputs. */
.crm-primary-filter-grid {
  gap: .6rem !important;
  align-items: end !important;
  inline-size: 100% !important;
  min-inline-size: 0 !important;
}

.crm-filter-divider {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-block: .55rem .35rem;
  inline-size: 100%;
}

.crm-filter-divider-line {
  flex: 1 1 auto;
  min-inline-size: 1.25rem;
  border-block-start: 1px dashed rgb(209 213 219);
}

.dark .crm-filter-divider-line {
  border-color: rgb(75 85 99);
}

.crm-filter-divider-button {
  flex: 0 0 auto;
}

.crm-followup-advanced-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  min-block-size: 1.8rem;
  max-inline-size: min(100%, 18rem);
  padding: .28rem .6rem;
  border: 1px solid rgb(229 231 235);
  border-radius: .5rem;
  background: rgb(255 255 255);
  color: rgb(63 63 70);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1rem;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.crm-followup-advanced-toggle:hover,
.crm-followup-advanced-toggle:focus-visible {
  border-color: rgb(161 161 170);
  color: rgb(24 24 27);
  outline: none;
}

.dark .crm-followup-advanced-toggle {
  border-color: rgb(75 85 99);
  background: rgb(17 24 39);
  color: rgb(229 231 235);
}

.dark .crm-followup-advanced-toggle:hover,
.dark .crm-followup-advanced-toggle:focus-visible {
  border-color: rgb(107 114 128);
  color: rgb(255 255 255);
}

.crm-inline-filter-section.fi-section,
.crm-inline-filter-section .fi-section {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  --tw-ring-color: transparent !important;
  --tw-ring-shadow: 0 0 #0000 !important;
}

.crm-inline-filter-section.fi-section > .fi-section-header,
.crm-inline-filter-section .fi-section > .fi-section-header {
  display: flex !important;
  align-items: center !important;
  gap: .5rem !important;
  padding: .35rem 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.crm-inline-filter-section.fi-section > .fi-section-header::before,
.crm-inline-filter-section.fi-section > .fi-section-header::after,
.crm-inline-filter-section .fi-section > .fi-section-header::before,
.crm-inline-filter-section .fi-section > .fi-section-header::after {
  content: '';
  flex: 1 1 auto;
  min-inline-size: 1.25rem;
  border-block-start: 1px dashed rgb(209 213 219);
}

.dark .crm-inline-filter-section.fi-section > .fi-section-header::before,
.dark .crm-inline-filter-section.fi-section > .fi-section-header::after,
.dark .crm-inline-filter-section .fi-section > .fi-section-header::before,
.dark .crm-inline-filter-section .fi-section > .fi-section-header::after {
  border-color: rgb(75 85 99);
}

.crm-inline-filter-section.fi-section > .fi-section-header .fi-section-header-text-ctn,
.crm-inline-filter-section .fi-section > .fi-section-header .fi-section-header-text-ctn {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-block-size: 1.8rem;
  max-inline-size: min(100%, 18rem);
  margin: 0 !important;
  padding: .28rem .6rem;
  border: 1px solid rgb(229 231 235);
  border-radius: .5rem;
  background: rgb(255 255 255);
  color: rgb(63 63 70);
  text-align: center;
}

.dark .crm-inline-filter-section.fi-section > .fi-section-header .fi-section-header-text-ctn,
.dark .crm-inline-filter-section .fi-section > .fi-section-header .fi-section-header-text-ctn {
  border-color: rgb(75 85 99);
  background: rgb(17 24 39);
}

.crm-inline-filter-section .fi-section-header-heading {
  color: inherit !important;
  font-size: .75rem !important;
  font-weight: 700 !important;
  line-height: 1rem !important;
  white-space: nowrap;
}

.crm-inline-filter-section.fi-collapsed .fi-section-header-heading::before,
.crm-inline-filter-section .fi-section.fi-collapsed .fi-section-header-heading::before {
  content: '+ ';
}

.crm-inline-filter-section.fi-section:not(.fi-collapsed) .fi-section-header-heading::before,
.crm-inline-filter-section .fi-section:not(.fi-collapsed) .fi-section-header-heading::before {
  content: '− ';
}

.crm-inline-filter-section .fi-section-collapse-btn {
  display: none !important;
}

.crm-inline-filter-section .fi-section-content-ctn,
.crm-inline-filter-section .fi-section-content {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.crm-inline-filter-section .fi-section-content {
  padding: .4rem 0 0 !important;
}

.crm-inline-filter-section .fi-sc-grid,
.crm-inline-filter-section .fi-grid {
  gap: .6rem !important;
}

.crm-inline-filter-section.fi-section > .fi-section-header,
.crm-inline-filter-section .fi-section > .fi-section-header {
  cursor: pointer;
}


/* Follow-up helper hints: keep explanatory text beside the field title and
   reveal it on hover/focus instead of taking permanent vertical space. */
.crm-followup-field-label {
  display: inline-flex !important;
  align-items: center !important;
  gap: .25rem !important;
  max-inline-size: 100%;
}

.crm-followup-help-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  inline-size: 1rem;
  block-size: 1rem;
  color: rgb(156 163 175);
  cursor: help;
  outline: none;
}

.crm-followup-help-icon:hover,
.crm-followup-help-icon:focus-visible {
  color: rgb(75 85 99);
}

.dark .crm-followup-help-icon {
  color: rgb(107 114 128);
}

.dark .crm-followup-help-icon:hover,
.dark .crm-followup-help-icon:focus-visible {
  color: rgb(209 213 219);
}

/* Table and Kanban advanced controls use the exact same responsive grid class. */
.crm-inline-filter-section .crm-followup-advanced-grid,
.crm-followup-advanced-panel .crm-followup-advanced-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(12.75rem, 1fr)) !important;
  gap: .6rem !important;
  align-items: end !important;
  inline-size: 100% !important;
  max-inline-size: 100% !important;
  min-inline-size: 0 !important;
}

.crm-inline-filter-section .crm-followup-advanced-grid > *,
.crm-followup-advanced-panel .crm-followup-advanced-grid > * {
  min-inline-size: 0 !important;
  max-inline-size: 100% !important;
}

.crm-followup-advanced-panel {
  padding-block-end: .45rem;
}

.crm-inline-filter-section.fi-section:not(.fi-collapsed) .fi-section-content,
.crm-inline-filter-section .fi-section:not(.fi-collapsed) .fi-section-content {
  padding-block-end: .45rem !important;
}


/* Keep the Follow-up table itself consistent with Filament's normal card shell.
   The filter panel above has its own matching padded surface. */
.crm-followups-flat-table .fi-ta-ctn {
  border: 1px solid rgb(229 231 235) !important;
  border-radius: .75rem !important;
  background: rgb(255 255 255) !important;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05) !important;
  overflow: hidden !important;
}

.dark .crm-followups-flat-table .fi-ta-ctn {
  border-color: rgb(55 65 81) !important;
  background: rgb(17 24 39) !important;
}

.crm-followups-flat-table .fi-ta-filters-above-content-ctn {
  margin: 0 !important;
}

/* Follow-up Table filter header mirrors Kanban instead of Filament's split filter panel. */
.crm-followups-flat-table .fi-ta-filters-above-content-ctn,
.crm-followups-flat-table .fi-ta-filters,
.crm-followups-flat-table .fi-ta-filters > form,
.crm-followups-flat-table .fi-ta-filters form,
.crm-followups-flat-table .fi-ta-filters .fi-sc,
.crm-followups-flat-table .fi-ta-filters .fi-grid {
  inline-size: 100% !important;
  max-inline-size: none !important;
  min-inline-size: 0 !important;
}

.crm-followups-flat-table .fi-ta-filters {
  row-gap: .6rem !important;
}

.crm-followups-flat-table .fi-ta-filters .fi-ta-filters-header {
  min-block-size: 2rem;
  justify-content: flex-end !important;
  gap: .6rem !important;
}

.crm-followups-flat-table .fi-ta-filters .fi-ta-filters-heading {
  display: none !important;
}

.crm-followups-flat-table .fi-ta-filters .fi-ta-filters-actions-ctn {
  margin-inline-start: auto !important;
}

/* The dedicated search filter replaces Filament's separate full-width table-search bar. */
.crm-followups-flat-table .fi-ta-header-toolbar:has(input[wire\:model*="tableSearch"]),
.crm-followups-flat-table .fi-ta-header-toolbar:has(input[wire\:model*="tableSearch"]) * {
  --crm-followup-table-search-hidden: 1;
}


/* Follow-up Table filter card is flush with the table shell. Internal padding
   stays on the filter surface itself, matching Kanban without an extra outer gap. */
.crm-followups-flat-table .fi-ta-filters-above-content-ctn {
  box-sizing: border-box !important;
  margin: 0 !important;
  inline-size: 100% !important;
  max-inline-size: 100% !important;
}

/* Follow-up table uses deferFilters(false), matching Kanban's live filtering.
   Hide a stale deferred action container if an old compiled view survives a deploy. */
.crm-followups-flat-table .fi-ta-filters .fi-ta-filters-apply-action-ctn {
  display: none !important;
}


/* 2026-08-18 Follow-up label parity + compact top navigation.
   Filter labels keep all available width while helper icons occupy one fixed
   slot. This prevents Arabic titles from wrapping merely because a hint icon
   is present and makes Table/Kanban labels behave the same. */
.crm-kanban-field > label,
.crm-followup-field-label,
.crm-followups-flat-table .fi-ta-filters-above-content-ctn .fi-fo-field-label-ctn {
  inline-size: 100% !important;
  min-inline-size: 0 !important;
}

.crm-followup-field-label {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: .3rem !important;
}

.crm-followup-field-label > span:first-child {
  flex: 1 1 auto !important;
  min-inline-size: 0 !important;
  max-inline-size: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.crm-followup-help-icon {
  flex: 0 0 1rem !important;
  margin-inline: 0 !important;
}

/* Filament field wrappers place hint content at the opposite edge by default.
   Keep the title as the flexible part and the hint icon as the fixed part. */
.crm-followups-flat-table .fi-ta-filters-above-content-ctn .fi-fo-field-label-ctn {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: .3rem !important;
}

.crm-followups-flat-table .fi-ta-filters-above-content-ctn .fi-fo-field-label {
  flex: 1 1 auto !important;
  min-inline-size: 0 !important;
  max-inline-size: 100% !important;
}

.crm-followups-flat-table .fi-ta-filters-above-content-ctn .fi-fo-field-label-content {
  display: block !important;
  min-inline-size: 0 !important;
  max-inline-size: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.crm-followups-flat-table .fi-ta-filters-above-content-ctn .fi-fo-field-label-ctn > :not(.fi-fo-field-label) {
  flex: 0 0 auto !important;
  margin-inline: 0 !important;
}

/* Top navigation tabs: icons are redundant beside text and consume valuable
   width. Keep utility icons untouched, show complete tab labels, and scroll the
   tab strip horizontally when it exceeds the available width. */
.fi-topbar-nav-groups {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  scrollbar-width: none !important;
  -webkit-overflow-scrolling: touch;
}

.fi-topbar-nav-groups::-webkit-scrollbar {
  display: none !important;
}

.fi-topbar-nav-groups > *,
.fi-topbar-nav-groups .fi-topbar-item {
  flex: 0 0 auto !important;
  min-inline-size: max-content !important;
}

.fi-topbar-nav-groups .fi-topbar-item-btn {
  flex: 0 0 auto !important;
  max-inline-size: none !important;
  white-space: nowrap !important;
}

.fi-topbar-nav-groups .fi-topbar-item-btn > .fi-topbar-item-icon {
  display: none !important;
}

/* Keep Filament's submenu chevron visible. The previous broad `.fi-icon`
   selector also hid `.fi-topbar-group-toggle-icon`, so navigation groups
   looked identical to ordinary links. */
.fi-topbar-nav-groups .fi-topbar-item-btn > .fi-topbar-group-toggle-icon {
  display: block !important;
  flex: 0 0 auto !important;
  width: .9rem !important;
  height: .9rem !important;
}

.fi-topbar-nav-groups .fi-topbar-item-label {
  min-inline-size: max-content !important;
  max-inline-size: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}


/* 2026-08-18: unified helper hints + icon-only quick actions. */
.crm-global-helper-icon,
.crm-quick-action-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, opacity .15s ease;
}

.crm-global-helper-icon {
  width: 1.15rem;
  height: 1.15rem;
  color: rgb(202 138 4);
  cursor: help;
}
.crm-global-helper-icon svg { width: 1rem; height: 1rem; }
.crm-global-helper-icon:hover,
.crm-global-helper-icon:focus-visible { color: rgb(161 98 7); outline: none; }
.dark .crm-global-helper-icon { color: rgb(250 204 21); }

.crm-helper-text-converted { display: none !important; }

.crm-quick-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .18rem;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}
.crm-quick-action-icon { color: rgb(75 85 99); }
.crm-quick-action-icon:hover,
.crm-quick-action-icon:focus-visible { background: rgb(243 244 246); outline: none; }
.dark .crm-quick-action-icon { color: rgb(209 213 219); }
.dark .crm-quick-action-icon:hover,
.dark .crm-quick-action-icon:focus-visible { background: rgb(31 41 55); }
.crm-quick-action-icon.is-call { color: rgb(217 119 6); }
.crm-quick-action-icon.is-whatsapp { color: rgb(22 163 74); }
.crm-quick-action-icon.is-add { color: rgb(var(--primary-600, 37 99 235)); }
.crm-quick-action-icon.is-edit { color: rgb(75 85 99); }
.crm-quick-action-icon.is-email { color: rgb(71 85 105); }
.crm-quick-action-icon:disabled { cursor: wait; opacity: .5; }

/* The Follow-up title should remain visible on one line. Fields wrap to the next
   grid column instead of wrapping or truncating the title itself. */
.crm-followup-field-label > span:first-child,
.crm-followups-flat-table .fi-ta-filters-above-content-ctn .fi-fo-field-label-content {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

.crm-followup-filter-grid,
.crm-kanban-filter-grid,
.crm-followup-advanced-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14.5rem), 1fr)) !important;
}

/* Helper icon sits directly beside the title throughout Filament forms. */
.fi-fo-field-label-ctn:has(> .crm-global-helper-icon) {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: .3rem !important;
}
.fi-fo-field-label-ctn:has(> .crm-global-helper-icon) > .fi-fo-field-label {
  flex: 0 1 auto !important;
  min-width: 0 !important;
}

/* 2026-08-18 Follow-up filter parity refinement.
   Kanban uses the same seven-column primary row as the Table on wide desktops,
   while retaining the existing auto-fit responsive behavior below 2xl. */
@media (min-width: 1280px) {
  .crm-kanban-filter-grid.crm-followup-filter-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }
}

/* The Table advanced area is part of the main filter surface, not a nested card.
   Keep all structural layers transparent while preserving the actual input
   wrappers and controls. */
.crm-followups-flat-table .crm-inline-filter-section,
.crm-followups-flat-table .crm-inline-filter-section.fi-section,
.crm-followups-flat-table .crm-inline-filter-section > .fi-section,
.crm-followups-flat-table .crm-inline-filter-section .fi-section,
.crm-followups-flat-table .crm-inline-filter-section .fi-section-header,
.crm-followups-flat-table .crm-inline-filter-section .fi-section-content-ctn,
.crm-followups-flat-table .crm-inline-filter-section .fi-section-content {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}


/* 2026-08-18: Follow-up Table advanced filters are visually flat.
   Keep only the dashed divider + label; remove the nested section/card shell. */
.crm-followups-flat-table .crm-inline-filter-section,
.crm-followups-flat-table .crm-inline-filter-section.fi-section,
.crm-followups-flat-table .crm-inline-filter-section > .fi-section,
.crm-followups-flat-table .crm-inline-filter-section .fi-section,
.crm-followups-flat-table .crm-inline-filter-section .fi-section-content-ctn,
.crm-followups-flat-table .crm-inline-filter-section .fi-section-content {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  --tw-ring-offset-shadow: 0 0 #0000 !important;
  --tw-ring-shadow: 0 0 #0000 !important;
  padding-inline: 0 !important;
}

/* The Advanced toggle is text on the dotted divider, not another white pill/card. */
.crm-followups-flat-table .crm-inline-filter-section .fi-section-header-text-ctn {
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: .15rem .3rem !important;
}

.crm-followups-flat-table .crm-inline-filter-section .fi-section-header {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding-inline: 0 !important;
}

.crm-followups-flat-table .crm-inline-filter-section .fi-section-content {
  padding: .35rem 0 .4rem !important;
}

/* Wide Kanban: seven primary controls on one line, same contract as Table. */
@media (min-width: 1280px) {
  .crm-followup-filter-surface .crm-kanban-filter-grid.crm-followup-filter-grid {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: .6rem !important;
  }
}

/* 2026-08-18: horizontal navigation is desktop-only.
   Tablet/mobile use the sidebar button; large screens keep the menu tabs visible. */
.fi-topbar-nav-groups {
  display: none !important;
}

@media (min-width: 1024px) {
  .fi-topbar-nav-groups {
    display: flex !important;
  }
}

/* Keep Filament page header actions on the physical left in RTL layouts. */
html[dir='rtl'] .fi-header-actions-ctn {
  margin-right: auto !important;
  margin-left: 0 !important;
  justify-content: flex-start !important;
}

html[dir='rtl'] .fi-header-actions-ctn > .fi-ac {
  justify-content: flex-start !important;
}

/* 2026-08-18: use Filament default responsive sidebar trigger behavior.
   Desktop uses top-navigation tabs only; tablet/mobile keep the sidebar trigger. */
@media (min-width: 1024px) {
  .fi-body.fi-body-has-top-navigation .fi-topbar-open-sidebar-btn,
  .fi-body.fi-body-has-top-navigation .fi-topbar-close-sidebar-btn {
    display: none !important;
  }
}
