/**
 * Select estilizado compartilhado entre páginas (Histórico, Estatísticas, etc.)
 * Aplique a classe `.bc-styled-select` em qualquer <select> nativo.
 */
.bc-styled-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: 1px solid var(--app-border, rgba(15, 23, 42, 0.08));
  border-radius: 0.875rem;
  padding: 0.95rem 2.85rem 0.95rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  background-color: var(--app-surface, #fff);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236a0392' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1.15rem center;
  color: #4e4351;
  min-width: 10rem;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bc-styled-select:hover {
  border-color: rgba(106, 3, 146, 0.35);
}

.bc-styled-select:focus,
.bc-styled-select:focus-visible {
  outline: 2px solid rgba(106, 3, 146, 0.35);
  outline-offset: 1px;
  border-color: rgba(106, 3, 146, 0.45);
}

[data-theme="dark"] .bc-styled-select,
[data-bs-theme="dark"] .bc-styled-select {
  background-color: #1a1a22;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23b4b4c0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  border-color: rgba(255, 255, 255, 0.08);
  color: #ececf1;
}

[data-theme="dark"] .bc-styled-select:hover,
[data-bs-theme="dark"] .bc-styled-select:hover {
  border-color: rgba(244, 228, 255, 0.35);
}

/* === Custom dropdown enhancement (styled-select.js) === */
.bc-styled-select-wrap {
  position: relative;
  display: inline-block;
}

.bc-styled-select__native {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  margin: 0;
  border: 0;
}

button.bc-styled-select__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  width: 100%;
  font-family: inherit;
  line-height: 1.5;
  box-sizing: border-box;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
}

.bc-styled-select-wrap.is-disabled .bc-styled-select__toggle {
  opacity: 0.52;
}

/* Ocupa 100% da coluna (cadastro, banco configurar, etc.) */
.bc-styled-select-wrap.bc-styled-select--fluid {
  display: block;
  width: 100%;
}

.bc-styled-select-wrap.bc-styled-select--fluid .bc-styled-select__toggle {
  width: 100%;
}

.bc-styled-select__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 0.4rem;
}

.bc-styled-select__list {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 1080;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--app-surface, #fff);
  border: 1px solid rgba(106, 3, 146, 0.22);
  border-radius: 0.875rem;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
  max-height: 18rem;
  overflow-y: auto;
  min-width: 100%;
  display: none;
  transform-origin: top center;
}

.bc-styled-select-wrap.is-open .bc-styled-select__list {
  display: block;
  animation: bcSsFade 0.12s ease-out;
}

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

.bc-styled-select__item {
  padding: 0.6rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--app-text, #181c20);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  line-height: 1.2;
  min-height: 2.375rem;
  box-sizing: border-box;
}

.bc-styled-select__item.is-focus {
  background: rgba(106, 3, 146, 0.1);
  color: #6a0392;
}

.bc-styled-select__item.is-selected {
  background: rgba(106, 3, 146, 0.14);
  color: #6a0392;
}

.bc-styled-select__item.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

[data-theme="dark"] .bc-styled-select__list,
[data-bs-theme="dark"] .bc-styled-select__list {
  background: #1a1a22;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .bc-styled-select__item,
[data-bs-theme="dark"] .bc-styled-select__item {
  color: rgba(255, 255, 255, 0.88);
}

[data-theme="dark"] .bc-styled-select__item.is-focus,
[data-bs-theme="dark"] .bc-styled-select__item.is-focus {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

[data-theme="dark"] .bc-styled-select__item.is-selected,
[data-bs-theme="dark"] .bc-styled-select__item.is-selected {
  background: rgba(244, 228, 255, 0.14);
  color: #f4e4ff;
}
