:root {
  --crm-accent: #0540f2;
  --crm-accent-dark: #05215c;
  --crm-accent-soft: rgba(5, 64, 242, 0.12);
  --crm-panel-shadow: 0 22px 50px rgba(15, 23, 42, 0.16);
  --crm-soft-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
  --crm-border: rgba(148, 163, 184, 0.28);
  --crm-text-muted: #64748b;
}

body.crm-motion-ready .crm-card,
body.crm-motion-ready .crm-kpi,
body.crm-motion-ready .card,
body.crm-motion-ready .alert,
body.crm-motion-ready .btn,
body.crm-motion-ready .form-control,
body.crm-motion-ready .form-select,
body.crm-motion-ready .nav-link,
body.crm-motion-ready .table tbody tr,
body.crm-motion-ready .crm-search-select__trigger {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

body.crm-motion-ready .crm-card:hover,
body.crm-motion-ready .crm-kpi:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

body.crm-motion-ready .btn:hover,
body.crm-motion-ready .btn:focus-visible {
  transform: translateY(-1px);
}

body.crm-motion-ready .crm-nav .nav-link:hover,
body.crm-motion-ready .crm-nav .nav-link:focus-visible {
  opacity: 1;
  transform: translateY(-1px);
}

body.crm-motion-ready .form-control:focus,
body.crm-motion-ready .form-select:focus,
body.crm-motion-ready .crm-search-select.is-open .crm-search-select__trigger,
body.crm-motion-ready .crm-search-select__trigger:focus-visible {
  border-color: rgba(5, 64, 242, 0.45);
  box-shadow: 0 0 0 0.25rem rgba(5, 64, 242, 0.16);
}

body.crm-motion-ready .table tbody tr:hover {
  background-color: rgba(219, 234, 254, 0.55);
}

.crm-animate-in {
  opacity: 0;
  transform: translateY(16px);
}

body.crm-motion-ready .crm-animate-in {
  animation: crm-fade-up 420ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--crm-delay, 0ms);
}

.crm-search-select {
  position: relative;
}

.crm-search-select__native {
  display: none;
}

.crm-search-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  background: #fff;
  color: #212529;
  text-align: left;
}

.crm-search-select__trigger-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-search-select__trigger-icon {
  flex: 0 0 auto;
  color: var(--crm-text-muted);
  font-size: 0.8rem;
}

.crm-search-select__panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  z-index: 1100;
  padding: 0.85rem;
  border: 1px solid var(--crm-border);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--crm-panel-shadow);
  backdrop-filter: blur(12px);
}

.crm-search-select__panel[hidden] {
  display: none;
}

.crm-search-select.is-open .crm-search-select__panel {
  animation: crm-panel-in 180ms ease-out;
}

.crm-search-select__search-wrap {
  position: relative;
  margin-bottom: 0.75rem;
}

.crm-search-select__search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--crm-text-muted);
  pointer-events: none;
}

.crm-search-select__search {
  width: 100%;
  padding: 0.625rem 0.875rem 0.625rem 2.3rem;
  border: 1px solid var(--crm-border);
  border-radius: 0.8rem;
  background: #f8fafc;
  outline: none;
}

.crm-search-select__search:focus {
  border-color: rgba(5, 64, 242, 0.35);
  box-shadow: 0 0 0 0.2rem rgba(5, 64, 242, 0.12);
}

.crm-search-select__list {
  display: grid;
  gap: 0.35rem;
  max-height: 260px;
  overflow-y: auto;
}

.crm-search-select__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: inherit;
  text-align: left;
}

.crm-search-select__option:hover,
.crm-search-select__option:focus-visible,
.crm-search-select__option.is-active {
  background: rgba(219, 234, 254, 0.92);
  color: var(--crm-accent-dark);
  outline: none;
}

.crm-search-select__option.is-selected {
  background: rgba(5, 64, 242, 0.1);
  color: var(--crm-accent-dark);
  font-weight: 600;
}

.crm-search-select__option-check {
  color: var(--crm-accent);
  opacity: 0;
}

.crm-search-select__option.is-selected .crm-search-select__option-check {
  opacity: 1;
}

.crm-search-select__empty {
  padding: 0.7rem 0.85rem;
  border-radius: 0.75rem;
  background: #f8fafc;
  color: var(--crm-text-muted);
  font-size: 0.95rem;
}

.crm-search-select.is-invalid .crm-search-select__trigger {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.12);
}

.crm-search-select__feedback {
  display: none;
  margin-top: 0.45rem;
  color: #dc3545;
  font-size: 0.875rem;
}

.crm-search-select.is-invalid .crm-search-select__feedback {
  display: block;
}

@keyframes crm-fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes crm-panel-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 575.98px) {
  .crm-search-select__panel {
    padding: 0.7rem;
  }

  .crm-search-select__list {
    max-height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.crm-motion-ready .crm-card,
  body.crm-motion-ready .crm-kpi,
  body.crm-motion-ready .card,
  body.crm-motion-ready .alert,
  body.crm-motion-ready .btn,
  body.crm-motion-ready .form-control,
  body.crm-motion-ready .form-select,
  body.crm-motion-ready .nav-link,
  body.crm-motion-ready .table tbody tr,
  body.crm-motion-ready .crm-search-select__trigger,
  body.crm-motion-ready .crm-animate-in {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
