/* ── Combobox (autocomplete dropdown — filters + inline edit) ──────────────
   Input + floating suggestion panel. The panel is position:fixed (positioned
   from JS) so it escapes .data-scroll clipping and is height-capped instead
   of expanding to the full option list like a native <select>. */
.cbx { position: relative; width: 100%; min-width: 0; }
.cbx-control { position: relative; display: flex; align-items: center; }
.cbx .cbx-control .cbx-input {
  box-sizing: border-box;
  width: 100%;
  height: var(--control-height, 36px);
  min-height: 0;
  margin: 0;
  padding: 7px 36px 7px 10px;
  border: 1px solid var(--border-dark, #D2CDE1);
  border-radius: var(--radius-sm, 6px);
  background: var(--surface, #FFFFFF);
  color: var(--ink, #181626);
  font: 400 13px/1.4 var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  letter-spacing: normal;
  text-transform: none;
  text-overflow: ellipsis;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cbx .cbx-control .cbx-input:hover { border-color: var(--border-dark, #D2CDE1); }
.cbx .cbx-control .cbx-input:focus {
  outline: none;
  outline-offset: 0;
  border-color: var(--orange, #5B4BD6);
  box-shadow: 0 0 0 3px var(--orange-pale, #EEEBFB);
}
.cbx-input::placeholder { color: var(--ink-light, #847F97); }
.cbx-caret {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  cursor: pointer; user-select: none;
}
.cbx-clear {
  position: absolute; right: 30px; top: 50%; transform: translateY(-50%);
  width: auto; height: auto; min-height: 0; margin: 0;
  border: none; border-radius: 0; background: transparent; padding: 2px;
  box-shadow: none;
  font-size: 11px; line-height: 1;
  color: var(--ink-light, #847F97);
  cursor: pointer;
}
.cbx-clear:hover { color: var(--ink, #181626); }

/* Compact variant for table controls */
.cbx-sm {
  min-height: 28px;
}
.editable-cell-cbx {
  width: var(--editable-cell-width);
  min-width: var(--editable-cell-width);
  max-width: var(--editable-cell-width);
  flex: 0 0 var(--editable-cell-width);
}
.cbx .cbx-control.cbx-has-clear .cbx-input { padding-right: 52px; }
.cbx.cbx-sm .cbx-control .cbx-input { height: 28px; padding: 4px 32px 4px 8px; font-size: 12px; }
.cbx.cbx-sm .cbx-control.cbx-has-clear .cbx-input { padding-right: 48px; }
.cbx-sm .cbx-caret { right: 5px; }
.cbx-sm .cbx-clear { right: 28px; }
.cbx-placeholder {
  box-sizing: border-box;
  height: 28px; padding: 4px 8px; border: 1px solid var(--border-dark, #D2CDE1); border-radius: var(--radius-sm, 6px);
  background: var(--surface, #FFFFFF); color: var(--ink, #181626); font-size: 12px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center;
}
.cbx-ready .cbx-placeholder { display: none; }
.cbx-panel {
  position: fixed; z-index: 6000;
  min-width: 160px;
  max-width: min(440px, 92vw);
  overflow-y: auto; overflow-x: hidden;
  background: var(--surface, #FFFFFF);
  border: 1px solid var(--border-dark, #D2CDE1);
  border-radius: var(--radius-sm, 6px);
  box-shadow: var(--shadow-lg, 0 8px 32px rgba(24,22,38,0.14));
  padding: 4px;
  font: 400 13px/1.4 var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
}
.cbx-option {
  padding: 6px 10px;
  font-size: 13px;
  color: var(--ink, #181626);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cbx-option:hover, .cbx-option.hi { background: var(--orange-pale, #EEEBFB); color: var(--orange-dark, #4536B0); }
.cbx-option.sel { font-weight: 600; }
.cbx-option > .ui-small { white-space: normal; overflow-wrap: anywhere; font-weight: 400; }
.cbx-option.cbx-all { color: var(--ink-light, #847F97); font-style: italic; }
.cbx-option.cbx-all:hover { color: var(--orange-dark, #4536B0); }
.cbx-new {
  color: var(--orange-dark, #4536B0);
  font-weight: 500;
  border-top: 1px dashed var(--border, #E7E4F0);
  border-radius: 0 0 4px 4px;
  margin-top: 2px; padding-top: 7px;
}
.cbx-empty { padding: 8px 10px; font-size: 12px; color: var(--ink-light, #847F97); }

/* Keep the visual center of the drawn chevron on the field's center line. */
.cbx-caret, .header-user-caret, .cp-caret, .provider-caret {
  display: grid; place-items: center; width: 18px; height: 18px;
  flex: 0 0 18px; font-size: 0; line-height: 1; color: var(--ink-mid, #423E54);
}
.cbx-caret::before, .header-user-caret::before, .cp-caret::before, .provider-caret::before, .editable-cell::after {
  content: ''; box-sizing: border-box; width: 8px; height: 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.editable-cell::after { flex-shrink: 0; margin-inline: 4px; color: var(--ink-mid, #423E54); }
.header-user-caret { transition: transform 120ms ease; }
.header-user-caret.open { transform: rotate(180deg); }
.cbx .cbx-control .cbx-input:disabled { background: var(--surface-warm, #F6F5FB); color: var(--ink-light, #847F97); cursor: not-allowed; }
.cbx-input:disabled ~ .cbx-caret { color: var(--ink-faint, #BDB8CC); cursor: not-allowed; }
.styled-dropdown { width: 100%; min-width: 0; }

/* The invitation page uses the same dropdown field and menu treatment. */
#provider-toggle { height: var(--control-height, 36px); padding: 7px 7px 7px 10px; border: 1px solid var(--border-dark, #D2CDE1); border-radius: var(--radius-sm, 6px); background: var(--surface, #FFFFFF); color: var(--ink, #181626); font: 400 13px/1.4 var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif); }
#provider-toggle:focus { outline: none; border-color: var(--orange, #5B4BD6); box-shadow: 0 0 0 3px var(--orange-pale, #EEEBFB); }
#provider-options { top: calc(100% + 4px); padding: 4px; border: 1px solid var(--border-dark, #D2CDE1); border-radius: var(--radius-sm, 6px); background: var(--surface, #FFFFFF); box-shadow: var(--shadow-lg, 0 8px 32px rgba(24,22,38,0.14)); }
#provider-options button { border-radius: 4px; padding: 6px 10px; color: var(--ink, #181626); font: 400 13px/1.4 var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif); }
#provider-options button:hover, #provider-options button:focus { outline: none; background: var(--orange-pale, #EEEBFB); color: var(--orange-dark, #4536B0); }
#provider-options button[aria-selected=true] { background: var(--surface, #FFFFFF); color: var(--ink, #181626); font-weight: 600; }
#provider-options button[aria-selected=true]:is(:hover,:focus) { background: var(--orange-pale, #EEEBFB); color: var(--orange-dark, #4536B0); }
