/* se-select — the family dropdown, shared by both consoles.
 *
 * Shape and values come from the back-office prototype's progressive-
 * enhancement variant (the one to follow, because it keeps the native <select>
 * as the submitted value and preserves inline onchange handlers for free).
 * Every colour is a canonical --se-* token; the two rgba() glows are the
 * prototype's own literals, derived from color.secondary.60, and shadows are
 * not tokenised upstream (dialect.json: canonical null).
 *
 * WHERE THIS DEPARTS FROM THE PROTOTYPE, DELIBERATELY:
 *   - Keyboard focus exists. The prototype's trigger is `all:unset` with no
 *     :focus-visible rule anywhere, leaving a control with NO focus ring; ours
 *     draws the family's keyboard treatment (navy, visually 2px) using an
 *     inset shadow on top of the 1px border, so focusing never shifts layout
 *     the way the prototype's 1px->2px border-width swap does.
 *   - One tab stop, not two. se-select.js takes the hidden native select out
 *     of the tab order; the trigger is the interactive element.
 *   - Options are focusable and carry a focus ring, because the script moves
 *     real focus through them.
 */

.se-select {
  position: relative;
}

/* The native select stays in the DOM as the submitted value and the source of
 * truth — visually hidden, and (via the script) out of the tab order and the
 * accessibility tree, because the trigger is its replacement, not its twin. */
.se-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* A filter-bar host strips its own chrome; the wrapper takes over. */
.filter-select.has-se-select {
  border: 0;
  padding: 0;
  background: none;
}

.se-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 14px;
  background: var(--se-color-bg-surface);
  border: 1px solid var(--se-color-border-default);
  border-radius: var(--se-radius-pill);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--se-color-text-title);
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.se-select--form .se-select-trigger {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 16px;
  font-weight: 400;
}

.se-select-trigger:hover {
  border-color: var(--se-color-secondary-60);
}

/* Keyboard focus: the family's navy treatment. Inset shadow supplies the
 * second visual pixel so the box never changes size. */
.se-select-trigger:focus-visible {
  outline: none;
  border-color: var(--se-color-primary-60);
  box-shadow: inset 0 0 0 1px var(--se-color-primary-60);
}

.se-select.is-open .se-select-trigger {
  border-color: var(--se-color-secondary-60);
  box-shadow: 0 0 4px 2px rgba(202, 56, 93, 0.1); /* glow of color.secondary.60; not tokenised upstream */
}

.se-select.is-disabled .se-select-trigger {
  background: var(--se-color-bg-console);
  border-color: var(--se-color-border-default);
  color: var(--se-color-text-placeholder);
  cursor: not-allowed;
}

.se-select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.se-select-label.is-placeholder {
  color: var(--se-color-text-placeholder);
  font-weight: 400;
}

.se-select-caret {
  flex: none;
  transition: transform 0.15s;
}

.se-select.is-open .se-select-caret {
  transform: rotate(180deg);
}

.se-select-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: max-content;
  max-height: 260px;
  overflow-y: auto;
  padding: 12px;
  background: var(--se-color-bg-surface);
  border-radius: var(--se-radius-lg);
  box-shadow:
    0 12px 8px rgba(16, 24, 40, 0.08),
    0 4px 3px rgba(16, 24, 40, 0.03); /* prototype's own float shadow; shadows are not tokenised upstream */
  z-index: 30;
}

.se-select.is-open .se-select-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.se-select-option {
  padding: 10px 8px;
  border-radius: var(--se-radius-pill);
  font-size: 14px;
  color: var(--se-color-text-title);
  cursor: pointer;
  white-space: nowrap;
}

.se-select--form .se-select-option {
  font-size: 16px;
}

.se-select-option:hover {
  background: var(--se-color-secondary-20);
}

.se-select-option:active {
  background: var(--se-color-secondary-30);
}

.se-select-option:focus-visible,
.se-select-option.is-focused {
  outline: 2px solid var(--se-color-primary-60);
  outline-offset: -2px;
}

.se-select-option.is-selected {
  background: var(--se-color-bg-console);
  font-weight: 600;
}

/* O opțiune indisponibilă se ARATĂ, deci trebuie și citită: --se-color-primary-20
 * (#D1D3DC) pe fundalul ei #F8F8FA dădea 1.41:1, adică arătarea ei nu însemna
 * nimic. Tokenul acela e o tentă decorativă (linii, degete de scroll), n-a fost
 * niciodată text. --se-color-text-description e cel mai deschis token care trece
 * pragul de text normal pe fundalul ăsta — 4.69:1 — deci rămâne „stinsă", dar se
 * citește. Setul de tokeni nu are un prim-plan propriu de „dezactivat" care să
 * treacă pragul; până apare unul, ăsta e.
 *
 * Stările se rescriu aici anume: fără ele, regula asta bate `:hover`/`:active`
 * (0,2,0 amândouă) doar fiindcă e scrisă mai jos în fișier. O rearanjare ar
 * pune rozul de hover pe un rând pe care nu se poate apăsa. Acum câștigă pe
 * SPECIFICITATE (0,3,0). */
.se-select-option.is-option-disabled {
  color: var(--se-color-text-description);
  background: var(--se-color-bg-console);
  cursor: default;
}

.se-select-option.is-option-disabled:hover,
.se-select-option.is-option-disabled:active {
  color: var(--se-color-text-description);
  background: var(--se-color-bg-console);
}
