/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(196, 125, 138, 0.3);
}
.btn-primary:hover { background: var(--accent2); }
.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}
.btn-icon {
  padding: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: all 0.15s;
}
.btn-icon:hover { background: var(--surface2); color: var(--accent); }
.btn-icon:active { transform: scale(0.92); }

/* Filter chips */
.chip {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  transition: all 0.15s;
  user-select: none;
}
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(196, 125, 138, 0.25);
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 20px;
  transition: 0.2s;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: var(--text2);
  border-radius: 50%;
  transition: 0.2s;
}
.toggle input:checked + .toggle-slider {
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(196, 125, 138, 0.3);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background: #fff;
}

/* Tags */
.tag {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 10px;
  background: #f9f0ea;
  color: var(--accent);
  border: 1px solid #f0ddd4;
  font-weight: 500;
}

/* Search autocomplete */
.search-wrap {
  position: relative;
  width: 100%;
}
.search-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.82rem;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(196, 125, 138, 0.15);
}
.search-input::placeholder {
  color: var(--text2);
  opacity: 0.7;
}
.search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 150;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(60, 48, 40, 0.12);
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
}
.search-dropdown.open {
  display: block;
}
.search-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover {
  background: var(--surface2);
}
.search-result-name {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 8px;
}
.search-result-meta {
  color: var(--text2);
  font-size: 0.75rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.search-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 600;
}
.search-empty {
  padding: 12px;
  text-align: center;
  color: var(--text2);
  font-size: 0.82rem;
}

/* Create recipe form in modal */
.create-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
}
.create-form label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.create-form input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.85rem;
}
.create-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(196, 125, 138, 0.15);
}
