/* Live lookup typeahead (customers / vendors / projects) – see wwwroot/js/lookup-typeahead.js */
.lookup-typeahead {
  position: relative;
}

.lookup-input-wrap {
  position: relative;
}

.lookup-typeahead .lookup-input {
  padding-left: 2.1rem;
  padding-right: 3.6rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.lookup-typeahead .lookup-input.lookup-unresolved {
  border-color: #f59e0b;
  box-shadow: 0 0 0 .2rem rgba(245, 158, 11, .15);
}

.lookup-typeahead .lookup-input.lookup-selected {
  border-color: rgba(16, 185, 129, .55);
}

.lookup-search-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: .8rem;
  pointer-events: none;
}

.lookup-spinner {
  position: absolute;
  right: 2.1rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  margin-top: -.5rem;
  border: 2px solid rgba(0, 122, 255, .2);
  border-top-color: var(--primary-blue, #007AFF);
  border-radius: 50%;
  animation: lookup-spin .7s linear infinite;
}

.lookup-clear {
  position: absolute;
  right: .45rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 1.15rem;
  line-height: 1;
  padding: .1rem .35rem;
  border-radius: 50%;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}

.lookup-clear:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, .08);
}

@keyframes lookup-spin {
  to { transform: rotate(360deg); }
}

.lookup-listbox {
  position: absolute;
  z-index: 1080;
  left: 0;
  right: 0;
  top: 100%;
  margin: .25rem 0 0;
  padding: .3rem;
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: var(--radius-md, 12px);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, .1));
  animation: lookup-fade-in .12s ease-out;
}

@keyframes lookup-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.lookup-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .45rem .65rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color .1s ease;
}

.lookup-option:hover,
.lookup-option.active {
  background: rgba(0, 122, 255, .08);
}

.lookup-option[aria-selected="true"] {
  background: rgba(0, 122, 255, .14);
}

.lookup-option-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.lookup-option-name {
  font-weight: 600;
  font-size: .9rem;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lookup-option-secondary {
  font-size: .75rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lookup-pill-new {
  flex-shrink: 0;
  font-size: .65rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 999px;
  color: #047857;
  background: rgba(16, 185, 129, .12);
  border: 1px solid rgba(16, 185, 129, .3);
  white-space: nowrap;
}

.lookup-status-row {
  padding: .45rem .65rem;
  font-size: .8rem;
  color: #64748b;
  cursor: default;
}

.lookup-status-row .lookup-inline-spinner {
  display: inline-block;
  width: .75rem;
  height: .75rem;
  margin-right: .4rem;
  vertical-align: -1px;
  border: 2px solid rgba(0, 122, 255, .2);
  border-top-color: var(--primary-blue, #007AFF);
  border-radius: 50%;
  animation: lookup-spin .7s linear infinite;
}

.lookup-status-row .lookup-link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--primary-blue, #007AFF);
  font-weight: 600;
  font-size: .8rem;
  cursor: pointer;
  text-decoration: underline;
}

.lookup-note {
  font-size: .75rem;
  color: #b45309;
  margin-top: .2rem;
}

.lookup-note:empty {
  display: none;
}

.lookup-note.lookup-note-error {
  color: #dc2626;
}

.lookup-note.lookup-note-info {
  color: #64748b;
}

.lookup-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .4rem;
  min-height: 1.6rem;
  font-size: .72rem;
  color: #94a3b8;
}

.lookup-footer.lookup-stale .lookup-updated {
  color: #b45309;
}

.lookup-refresh {
  border: 0;
  background: transparent;
  color: var(--primary-blue, #007AFF);
  font-size: .95rem;
  line-height: 1;
  padding: .1rem .3rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color .15s ease, transform .3s ease;
}

.lookup-refresh:hover:not(:disabled) {
  background: rgba(0, 122, 255, .08);
}

.lookup-refresh:disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}

.lookup-refresh.lookup-refreshing {
  animation: lookup-spin .9s linear infinite;
}
