.search-window {
  position: fixed;
  inset: 0;
  z-index: 12000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.search-window.is-open {
  pointer-events: auto;
  opacity: 1;
}

.search-window__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 15, 30, 0.55);
  backdrop-filter: blur(2px);
}

.search-window__panel {
  position: relative;
  margin: 2rem auto;
  background: #fff;
  border-radius: 1.25rem;
  padding: 1.5rem;
  width: min(1200px, 92vw);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

.search-window__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.search-window__subtitle {
  margin: 0.25rem 0 0;
  color: #64748b;
  font-size: 0.9rem;
}

.search-row {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.search-row input,
.search-row select {
  border: 1px solid #cbd5f5;
  border-radius: 0.75rem;
  padding: 0.6rem 0.8rem;
}

.search-row--secondary {
  grid-template-columns: 220px 160px 1fr auto;
}

.search-window__buttons {
  margin: 1rem 0;
}

.button-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search-window__advanced {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #f8fafc;
}

.search-window__advanced header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.advanced-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.advanced-row {
  display: grid;
  grid-template-columns: 1fr 160px 1fr 120px auto;
  gap: 0.5rem;
  align-items: center;
}

.advanced-row input,
.advanced-row select {
  border: 1px solid #cbd5f5;
  border-radius: 0.6rem;
  padding: 0.5rem 0.7rem;
}

.search-window__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.search-window__results {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem;
  min-height: 200px;
  background: #fff;
}

.results-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
  max-height: 360px;
  overflow-y: auto;
}

.result-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  padding: 0.75rem;
  background: #fdfdfd;
}

.result-card--inactive {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}

.result-card--deleted {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #991b1b;
}

.result-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-left: 0.5rem;
}

.result-chip--inactive {
  background: #e2e8f0;
  color: #334155;
}

.result-chip--deleted {
  background: #fecdd3;
  color: #991b1b;
}

.result-row--status dt {
  color: #0f172a;
}

.result-row--status dd {
  font-weight: 600;
}

.result-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.result-card dt {
  font-weight: 600;
  color: #475569;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 21, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 13000;
}

.modal-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  width: min(480px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-card input,
.modal-card select {
  border: 1px solid #d8e0f0;
  border-radius: 0.6rem;
  padding: 0.5rem 0.75rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.button-editor__row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 0.5rem;
  align-items: center;
}

.btn {
  border: 1px solid #cbd5f5;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.btn-secondary {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: #475569;
}

.btn-circle {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  line-height: 1;
}

.link {
  background: none;
  border: none;
  color: #2563eb;
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
}

.text-muted {
  color: #94a3b8;
  font-size: 0.9rem;
}

.text-error {
  color: #dc2626;
  font-weight: 600;
}
