/* Shared select fields and menus. The native control still owns the form value. */
select:not([multiple]) {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237345ed' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 42px;
}
.rv-select { position: relative; display: block; min-width: 0; width: 100%; }
.rv-select > select.rv-select-native {
  position: absolute !important; left: 0; top: 0;
  width: 1px !important; height: 1px !important; min-width: 0 !important; min-height: 0 !important;
  padding: 0 !important; margin: 0 !important; border: 0 !important;
  clip-path: inset(50%); opacity: 0; overflow: hidden; pointer-events: none;
}
.rv-select-trigger {
  appearance: none; display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-width: 0; min-height: 50px; gap: 14px; padding: 11px 13px 11px 15px;
  border: 1px solid #ccc3d9; border-radius: 12px; background: #fff; color: var(--ink, #21182e);
  font: inherit; font-size: 16px; font-weight: 450; line-height: 1.5; text-align: left;
  cursor: pointer; transition: border-color .16s, box-shadow .16s, background .16s;
}
.rv-select-value { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-select-chevron {
  display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px;
  color: var(--accent, #7345ed); background: var(--surface, #f7f5fc); border-radius: 8px;
  transition: background .16s;
}
.rv-select-chevron svg { width: 16px; height: 16px; transition: transform .18s; }
.rv-select-trigger:hover:not(:disabled) { border-color: #a48bcf; background: #fdfcff; }
.rv-select-trigger[aria-expanded="true"] { border-color: var(--accent, #7345ed); box-shadow: 0 0 0 3px #7345ed14; }
.rv-select-trigger[aria-expanded="true"] .rv-select-chevron { background: var(--accent-soft, #eee8fc); }
.rv-select-trigger[aria-expanded="true"] .rv-select-chevron svg { transform: rotate(180deg); }
.rv-select-trigger:focus-visible { outline: 3px solid #7345ed35; outline-offset: 3px; border-color: var(--accent, #7345ed); }
.rv-select-trigger:disabled { cursor: not-allowed; color: #9a91a5; background: #f7f5fa; border-color: #e4dfeb; }
.rv-select-trigger:disabled .rv-select-chevron { opacity: .5; }
.rv-select.is-placeholder .rv-select-value { color: var(--muted, #655d70); }
.rv-select-trigger[aria-invalid="true"] { border-color: #c84a5c; }
.rv-select-error { display: block; margin-top: 7px; color: #a72f43; font-size: 13px; line-height: 1.5; font-weight: 400; }
.rv-select-error[hidden] { display: none; }
.rv-select-menu {
  position: fixed; inset: auto; margin: 0; box-sizing: border-box; padding: 6px;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  scrollbar-color: #c7b8e3 transparent; scroll-padding-block: 6px; touch-action: pan-y;
  border: 1px solid #e2daed; border-radius: 16px; background: #fff; color: var(--ink, #21182e);
  box-shadow: 0 18px 55px #28134222, 0 3px 10px #2813420a;
  font-family: inherit; font-size: 15px; font-weight: 450; line-height: 1.45; z-index: 1000;
}
.rv-select-menu[hidden] { display: none !important; }
.rv-select-menu:popover-open { animation: rv-select-in .14s ease-out; }
.rv-select-option {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  min-height: 44px; padding: 10px 11px; gap: 14px; border-radius: 10px; cursor: pointer;
  overflow-wrap: anywhere; user-select: none; -webkit-user-select: none;
}
.rv-select-option + .rv-select-option { margin-top: 2px; }
.rv-select-option.is-active { background: var(--accent-soft, #eee8fc); color: var(--accent-dark, #6032ce); }
.rv-select-option.is-selected { font-weight: 600; }
.rv-select-option.is-selected:not(.is-active) { background: #f7f4ff; color: var(--accent-dark, #6032ce); }
.rv-select-check {
  display: grid; place-items: center; flex: 0 0 21px; width: 21px; height: 21px;
  border-radius: 7px; background: var(--lime, #d8f77d); color: #35224c; visibility: hidden;
}
.rv-select-check svg { width: 13px; height: 13px; }
.rv-select-option.is-selected .rv-select-check { visibility: visible; }
.rv-select-option[aria-disabled="true"] { opacity: .43; cursor: not-allowed; }
.rv-select-group + .rv-select-group { border-top: 1px solid #eee8f5; margin-top: 6px; padding-top: 5px; }
.rv-select-group-title { padding: 9px 11px 6px; color: var(--muted, #655d70); font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.table-toolbar > .rv-select { width: auto; flex: 0 1 230px; min-width: 150px; }
.table-toolbar > .rv-select:nth-child(2) { margin-left: auto; }
.mobile-nav > .rv-select { width: auto; max-width: 230px; flex: 0 1 190px; }
@keyframes rv-select-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1000px) { .mobile-nav > .rv-select { order: 3; flex: 1 0 100%; width: 100%; max-width: none; } }
@media (max-width: 650px) {
  .table-toolbar > .rv-select { width: 100%; flex: none; max-width: none; min-width: 0; margin-left: 0; }
  .rv-select-menu { border-radius: 14px; }
  .rv-select-option { min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) { .rv-select-menu:popover-open { animation: none; } .rv-select-trigger, .rv-select-chevron, .rv-select-chevron svg { transition: none; } }
